Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
473e35c
commit b59d910
Showing
3 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var mm = require('..'); | ||
console.log(mm.match(['a.js', 'a.txt'], './**/**/**/*.js')); | ||
//=> [ 'a.js' ] |
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,22 @@ | ||
const mm = require('minimatch'); | ||
const μm = require('..'); | ||
|
||
const glob1 = '/a/**'; | ||
const glob2 = '/a{,/**}'; | ||
const strA = '/a/whatever'; | ||
const strB = '/a/whatever/comes/next'; | ||
|
||
console.log(mm(strA, glob1)); | ||
console.log(mm(strA, glob2)); | ||
console.log(mm(strB, glob1)); | ||
console.log(mm(strB, glob2)); | ||
|
||
console.log(μm.isMatch(strA, glob1)); | ||
console.log(μm.isMatch(strA, glob2)); | ||
console.log(μm.isMatch(strB, glob1)); | ||
console.log(μm.isMatch(strB, glob2)); // FAILS | ||
|
||
const glob3 = 'a/*/b' | ||
const strC = 'a//b' | ||
console.log(mm(strC, glob3)) // false | ||
console.log(μm.isMatch(strC, glob3)) // true |
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,6 @@ | ||
var mm = require('..'); | ||
var pattern = './something/*.js'; | ||
|
||
console.log(mm.isMatch('./something/file.js', pattern)); | ||
console.log(mm.makeRe(pattern).test('./something/file.js')); | ||
|