File tree 2 files changed +17
-10
lines changed
2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 60
60
],
61
61
"dependencies" : {
62
62
"dir-glob" : " ^3.0.1" ,
63
- "fast-glob" : " ^3.2.11 " ,
64
- "ignore" : " ^5.2.0 " ,
63
+ "fast-glob" : " ^3.3.0 " ,
64
+ "ignore" : " ^5.2.4 " ,
65
65
"merge2" : " ^1.4.1" ,
66
66
"slash" : " ^4.0.0"
67
67
},
68
68
"devDependencies" : {
69
69
"@globby/main-branch" : " sindresorhus/globby#main" ,
70
- "@types/node" : " ^17.0.18 " ,
70
+ "@types/node" : " ^20.3.3 " ,
71
71
"ava" : " ^5.3.1" ,
72
72
"benchmark" : " 2.1.4" ,
73
- "get-stream" : " ^6.0.1" ,
74
- "glob-stream" : " ^7.0.0" ,
75
- "rimraf" : " ^3.0.2" ,
73
+ "glob-stream" : " ^8.0.0" ,
74
+ "rimraf" : " ^5.0.1" ,
76
75
"tempy" : " ^3.0.0" ,
77
76
"tsd" : " ^0.28.1" ,
78
- "typescript" : " ^4.5.5 " ,
77
+ "typescript" : " ^5.1.6 " ,
79
78
"xo" : " ^0.54.2"
80
79
},
81
80
"xo" : {
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import fs from 'node:fs';
3
3
import path from 'node:path' ;
4
4
import util from 'node:util' ;
5
5
import test from 'ava' ;
6
- import getStream from 'get-stream' ;
7
6
import { temporaryDirectory } from 'tempy' ;
8
7
import {
9
8
globby ,
@@ -42,11 +41,20 @@ const stabilizeResult = result => result
42
41
} )
43
42
. sort ( ( a , b ) => ( a . path || a ) . localeCompare ( b . path || b ) ) ;
44
43
44
+ const streamToArray = async stream => {
45
+ const result = [ ] ;
46
+ for await ( const chunk of stream ) {
47
+ result . push ( chunk ) ;
48
+ }
49
+
50
+ return result ;
51
+ } ;
52
+
45
53
const runGlobby = async ( t , patterns , options ) => {
46
54
const syncResult = globbySync ( patterns , options ) ;
47
55
const promiseResult = await globby ( patterns , options ) ;
48
- // TODO: Use `Array.fromAsync ` when Node.js supports it
49
- const streamResult = await getStream . array ( globbyStream ( patterns , options ) ) ;
56
+ // TODO: Use `stream.toArray() ` when targeting Node.js 16.
57
+ const streamResult = await streamToArray ( globbyStream ( patterns , options ) ) ;
50
58
51
59
const result = stabilizeResult ( promiseResult ) ;
52
60
t . deepEqual (
You can’t perform that action at this time.
0 commit comments