File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ const checkCwdOption = options => {
2222 }
2323} ;
2424
25+ const getPathString = p => p instanceof fs . Stats ? p . path : p ;
26+
2527const generateGlobTasks = ( patterns , taskOptions ) => {
2628 patterns = arrayUnion ( [ ] . concat ( patterns ) ) ;
2729 assertPatternsInput ( patterns ) ;
@@ -110,7 +112,7 @@ const globby = (patterns, options) => {
110112 return getTasks
111113 . then ( tasks => Promise . all ( tasks . map ( task => fastGlob ( task . pattern , task . options ) ) ) )
112114 . then ( paths => arrayUnion ( ...paths ) )
113- . then ( paths => paths . filter ( p => ! filter ( p ) ) ) ;
115+ . then ( paths => paths . filter ( p => ! filter ( getPathString ( p ) ) ) ) ;
114116 } ) ;
115117} ;
116118
Original file line number Diff line number Diff line change @@ -221,6 +221,12 @@ test('respects gitignore option false - sync', t => {
221221 t . true ( actual . indexOf ( 'node_modules' ) > - 1 ) ;
222222} ) ;
223223
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+
224230// https://github.com/sindresorhus/globby/issues/97
225231test . failing ( '`{extension: false}` and `expandDirectories.extensions` option' , t => {
226232 t . deepEqual (
You can’t perform that action at this time.
0 commit comments