-
Notifications
You must be signed in to change notification settings - Fork 26
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
add { ignore: [globs] } #23
Comments
Is there a way to get this kind of behavior right now? I'm working on this PR and after hearing you mention this project last night at the Ember meetup, figured it was worth checking to see if this is faster than the glob package that I'm using right now. I want to be able to explicitly avoid walking through the whole |
@alexlafroscia in many cases walkSync will just do the right thing (no need to ignore) as it decomposes the globs to prune directories early. For example:
Will be smart enough to only traverse the following deeply |
but yes, in your case |
Gotcha, thanks for the pointers. I'll look into some of those links you provided above and see if I can get a PR together to implement this. |
Anything else I should know before trying it out? |
@alexlafroscia not that I can think of, feel free to submit a PR early (here or maybe matcher-collection) so I can provide feedback and help guide. |
Sounds good! |
@alexlafroscia awesome, I am excited to get a hand \w this. It seems like your use-case is perfect. |
Often the current whitelist globs do the trick, but implementing the blacklist performantly is non-obvious and sometimes not possible.
I'm leaving this as a place-holder, I intend to implement this sometime. But if someone beats me to it, I will not be offended.
My thoughts are as follows:
Similar to, https://github.com/joliss/node-walk-sync/blob/master/index.js#L53-L55 we would just prune a dir early. And instead of
mayContain
I believe we must use an explicitmatch
, whichMatcherCollection
already supportsThen finally before appending to the output paths, a full check should occur.
All of this should be pay as you go, if people don't use it we should avoid those branches.
The text was updated successfully, but these errors were encountered: