Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Jan 8, 2018
1 parent 473e35c commit b59d910
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/duplicates.js
@@ -0,0 +1,3 @@
var mm = require('..');
console.log(mm.match(['a.js', 'a.txt'], './**/**/**/*.js'));
//=> [ 'a.js' ]
22 changes: 22 additions & 0 deletions examples/isMatch.js
@@ -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
6 changes: 6 additions & 0 deletions examples/issue-111.js
@@ -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'));

0 comments on commit b59d910

Please sign in to comment.