Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #158.
GlobSync.prototype._processSimple
exists
toprefixStat
so that it’d make sense when I’d refer to it later.abs
was being built withpath.resolve
, butpath.resolve
trims the trailing slash off files and folder paths, which means any trailing slash check onabs
will always be negative. I switched it topath.join
instead.GlobSync.prototype._stat
fs.statSync
comes undone if a file path ends in a slash but isn’t a directory, so I’m runningpath.resolve
on it beforefs.statSync
._stat
was returning false ifabs
ended with a slash but wasn’t a directory, but hey, that’s not its job, that’s_processSimple
’s job, so I moved it up there. Also, since the trailing slash was beingresolve
d away that particular blob of code would never ever run. Poor lil guy.Hope this all makes sense 😰
Ran tests with
npm test
, everything looks good.