-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
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
.walk includes root directory, regardless of filter #11
Comments
@jprichardson Is this expected behavior? |
Good question. It seems that it should NOT operate this way. But since this was never clearly documented, I think we should fix it and bump major to just be extra cautious. |
SGTM, PR welcome. |
This is actually very closely related to #17. When the Walker stream is constructed the source dir is set as the only item in I think an interesting compromise would be for The most important part of this is to more clearly document the purpose and effect of the filter function - the most important reason for it to exist is to prune branches from the directory tree that we are not interested in traversing at all. The performance savings of not Conversely, the type of filter described in this issue is not intended to filter out subdirectories and can be implemented more effectively by As an alternative to breaking changes, another solution would be to introduce a new option called |
Any updates on this issue? |
I am walking a directory,
./source
, and even though I have specified a filter to include only markdown files viapath.extname()
, I am still receiving the root directory as an item in my final array.I expected
['foo.md', 'bar.md', 'baz.md'];
I actually got
['foo.md', 'bar.md', 'baz.md', 'source'];
The text was updated successfully, but these errors were encountered: