-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not apply magic unnecessarily for nocase
If the pattern part's upper and lower case forms are identical, then nocase has no effect, and there's no need to turn it into a regular expression. Not sure if this is related to #178, but it seems like it may be.
- Loading branch information
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const t = require('tap') | ||
const { Minimatch } = require('../') | ||
|
||
const nomagic = '../1/2/3' | ||
const yesmagic = '../x' | ||
|
||
t.same(new Minimatch(nomagic, { nocase: true }).set, [ | ||
[ '..', '1', '2', '3'] | ||
]) | ||
|
||
t.same(new Minimatch(yesmagic, { nocase: true }).set, [ | ||
['..', /^x$/i] | ||
]) |