Skip to content
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

Use Minimatch class for improved perf #29

Closed
UltCombo opened this issue Dec 31, 2014 · 5 comments
Closed

Use Minimatch class for improved perf #29

UltCombo opened this issue Dec 31, 2014 · 5 comments

Comments

@UltCombo
Copy link
Contributor

While node-glob doesn't implement the ignore option, it would be faster to handle handle globs with the Minimatch class (see sindresorhus/globby#6 (comment) and the comment below).

@UltCombo
Copy link
Contributor Author

Before I send a PR to fix this, does glob-stream's globs argument support anything other than strings? There's this typeof pattern !== 'string' and pattern instanceof RegExp, but there are no docs nor tests regarding these apparently. Can these be removed safely?

@yocontra
Copy link
Member

@UltCombo We do support custom RegExps at the post-scan level https://github.com/wearefractal/glob-stream/blob/master/index.js#L104 I'd like to keep that if possible

@UltCombo
Copy link
Contributor Author

@contra Oh I see. But https://github.com/wearefractal/glob-stream/blob/master/index.js#L109 shouldn't be return false;? Or are RegExps considered as negative globs for some reason? I can't seem to find any unit test using RegExps.

@yocontra
Copy link
Member

@UltCombo All RegExps are treated as negative since they are used to filter post-scan which means they cannot be positive. You can't give a regex to node-glob so there is no way it could be positive. There probably aren't tests if you can't find any, but there should be

@UltCombo
Copy link
Contributor Author

Oh I see, thanks for the explanation :)
I'll write some tests for those as well after I get this working.

UltCombo added a commit to UltCombo/glob-stream that referenced this issue Dec 31, 2014
yocontra pushed a commit that referenced this issue Dec 31, 2014
use Minimatch class to improve perf, fixes #29; fix RegExp handling
phated pushed a commit that referenced this issue Feb 16, 2017
use Minimatch class to improve perf, fixes #29; fix RegExp handling
phated pushed a commit that referenced this issue Feb 16, 2017
use Minimatch class to improve perf, fixes #29; fix RegExp handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants