We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deep
When options.deep is set to 1, items with depth 2 are also returned
options.deep
Only items with depth less than 2 should be returned
npm i fast-glob mkdir -p test/fixture/foo touch test/fixture/foo/index.js node repro.js
repro.js
const fg = require('fast-glob') fg('test/**/*.js', { deep: 1 }).then(console.log)
I believe is due to some lines of code in https://github.com/JS-DevTools/readdir-enhanced/blob/master/lib/directory-reader.js#L187
if (this.shouldRecurse(stats, posixPath, maxDepthReached)) { // Add this subdirectory to the queue this.queue.push({ path: fullPath, basePath: itemPath + options.sep, posixBasePath: posixPath + '/', depth: dir.depth + 1, }); } // Determine whether this item matches the filter criteria if (this.filter(stats, posixPath)) { this.pushOrBuffer({ data: options.stats ? stats : itemPath, file: stats.isFile(), directory: stats.isDirectory(), symlink: stats.isSymbolicLink(), }); }
Though this.shouldRecurse returns false, this.filter does return true.
this.shouldRecurse
false
this.filter
true
The text was updated successfully, but these errors were encountered:
Also related to the #120.
Sorry, something went wrong.
Should work correctly after #132. Thanks for report issue 🌮
Will be shipped at #136.
mrmlnc
No branches or pull requests
Environment
Actual behavior
When
options.deep
is set to 1, items with depth 2 are also returnedExpected behavior
Only items with depth less than 2 should be returned
Steps to reproduce
Code sample
repro.js
More
I believe is due to some lines of code in https://github.com/JS-DevTools/readdir-enhanced/blob/master/lib/directory-reader.js#L187
Though
this.shouldRecurse
returnsfalse
,this.filter
does returntrue
.The text was updated successfully, but these errors were encountered: