File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ const checkCwdOption = options => {
22
22
}
23
23
} ;
24
24
25
+ const getPathString = p => p instanceof fs . Stats ? p . path : p ;
26
+
25
27
const generateGlobTasks = ( patterns , taskOptions ) => {
26
28
patterns = arrayUnion ( [ ] . concat ( patterns ) ) ;
27
29
assertPatternsInput ( patterns ) ;
@@ -110,7 +112,7 @@ const globby = (patterns, options) => {
110
112
return getTasks
111
113
. then ( tasks => Promise . all ( tasks . map ( task => fastGlob ( task . pattern , task . options ) ) ) )
112
114
. then ( paths => arrayUnion ( ...paths ) )
113
- . then ( paths => paths . filter ( p => ! filter ( p ) ) ) ;
115
+ . then ( paths => paths . filter ( p => ! filter ( getPathString ( p ) ) ) ) ;
114
116
} ) ;
115
117
} ;
116
118
Original file line number Diff line number Diff line change @@ -221,6 +221,12 @@ test('respects gitignore option false - sync', t => {
221
221
t . true ( actual . indexOf ( 'node_modules' ) > - 1 ) ;
222
222
} ) ;
223
223
224
+ test ( 'gitignore option with stats option' , async t => {
225
+ const res = await globby ( '*' , { gitignore : true , stats : true } ) ;
226
+ const actual = res . map ( s => s . path ) ;
227
+ t . false ( actual . indexOf ( 'node_modules' ) > - 1 ) ;
228
+ } ) ;
229
+
224
230
// https://github.com/sindresorhus/globby/issues/97
225
231
test . failing ( '`{extension: false}` and `expandDirectories.extensions` option' , t => {
226
232
t . deepEqual (
You can’t perform that action at this time.
0 commit comments