-
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 option #27
Conversation
I swapped out |
@@ -84,14 +89,15 @@ function _walkSync(baseDir, options, _relativePath) { | |||
|
|||
for (var i=0; i<sortedEntries.length; ++i) { | |||
var entry = sortedEntries[i]; | |||
var isIgnored = (ignoreMatcher && ignoreMatcher.match(entry.relativePath)); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we simply do if (isIgnored) { continue; }
, that should somewhat simplify the code the follows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, makes sense.
@@ -84,14 +89,17 @@ function _walkSync(baseDir, options, _relativePath) { | |||
|
|||
for (var i=0; i<sortedEntries.length; ++i) { | |||
var entry = sortedEntries[i]; | |||
if (ignoreMatcher && ignoreMatcher.match(entry.relativePath)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although correct, we may want to do this check between line 67 and 68. This prevents us from doing the costly getStat
, and to a lesser degree allocation of the new Entry
object for something we will drop anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see... Prevent it from ever being added to entries
instead, right? Makes sense to me.
@alexlafroscia perfect, thank you! |
released as v0.3.0, thank you kindly. |
Closes #23