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
c2e1e0b
commit d44afb5
Showing
6 changed files
with
70 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,13 @@ | ||
var mm = require('..'); | ||
|
||
console.log(mm.all('foo.js', ['foo.js'])); | ||
// true | ||
|
||
console.log(mm.all('foo.js', ['*.js', '!foo.js'])); | ||
// false | ||
|
||
console.log(mm.all('foo.js', ['*.js', 'foo.js'])); | ||
// true | ||
|
||
console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); | ||
// 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,8 @@ | ||
var mm = require('..'); | ||
|
||
console.log(mm.any('foo.js', ['foo.js'])); | ||
// true | ||
|
||
// the following is correct, because one of the patterns matches | ||
console.log(mm.any('foo.js', ['*.js', '!foo.js'])); | ||
// 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,13 @@ | ||
var mm = require('..'); | ||
|
||
console.log(mm.every('foo.js', ['foo.js'])); | ||
// true | ||
|
||
console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); | ||
// true | ||
|
||
console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); | ||
// false | ||
|
||
console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); | ||
// false |
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,16 @@ | ||
var mm = require('..'); | ||
|
||
console.log(mm.not('foo.js', ['foo.js'])); | ||
// [] | ||
|
||
console.log(mm.not(['foo.js', 'bar.js'], ['*.js'])); | ||
// [] | ||
|
||
console.log(mm.not(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); | ||
// ['foo.js'] | ||
|
||
console.log(mm.not(['foo.js', 'bar.js', 'baz.js', 'foo.md'], ['!*.js'], {ignore: 'baz.js'})); | ||
// ['foo.js', 'bar.js'] | ||
|
||
console.log(mm.not(['foo.js'], ['*.js', '!foo.js'])); | ||
// ['foo.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,10 @@ | ||
var mm = require('..'); | ||
|
||
console.log(mm.some('foo.js', ['foo.js'])); | ||
// true | ||
|
||
console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); | ||
// true | ||
|
||
console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); | ||
// false |
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,10 @@ | ||
'use strict'; | ||
|
||
var parsers = require('../lib/parsers'); | ||
var Extglob = require('../lib/extglob'); | ||
var extglob = new Extglob(); | ||
extglob.use(parsers); | ||
|
||
var pattern = '*(*(of*(a)x)z)'; | ||
var res = extglob.parse(pattern); | ||
console.log(res); |