Skip to content

Commit

Permalink
fix url
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed May 29, 2017
1 parent d44afb5 commit bf2cc5a
Show file tree
Hide file tree
Showing 14 changed files with 556 additions and 349 deletions.
1 change: 1 addition & 0 deletions benchmark/fixtures/isMatch/star.js
@@ -0,0 +1 @@
module.exports = ["abc.txt", "*"];
7 changes: 4 additions & 3 deletions benchmark/index.js
Expand Up @@ -3,15 +3,16 @@
var path = require('path');
var util = require('util');
var cyan = require('ansi-cyan');
var argv = require('yargs-parser')(process.argv.slice(2));
var opts = { alias: {pattern: 'p' }};
var argv = require('minimist')(process.argv.slice(2), opts);
var isPrimitive = require('is-primitive');
var isObject = require('is-object');
var Suite = require('benchmarked');

function run(type, pattern) {
var suite = new Suite({
cwd: __dirname,
fixtures: path.join('fixtures', type, '*.js'),
fixtures: path.join('fixtures', type, pattern || '*.js'),
code: path.join('code', type, '*.js')
});

Expand Down Expand Up @@ -39,4 +40,4 @@ function run(type, pattern) {
}
}

run(argv._[0] || 'match', argv._[1] || 'large*');
run(argv._[0] || 'match', argv._[1] || argv.pattern);
25 changes: 20 additions & 5 deletions benchmark/package.json
Expand Up @@ -6,16 +6,31 @@
"scripts": {
"test": "mocha"
},
"lintDeps": {
"dependencies": {
"options": {
"ignore": [
"index.js"
]
}
},
"devDependencies": {
"files": [
"code/**/*.js",
"*.js"
]
}
},
"devDependencies": {
"ansi-cyan": "^0.1.1",
"benchmarked": "^0.2.5",
"braces": "^2.0.2",
"benchmarked": "^1.1.1",
"braces": "^2.2.0",
"is-object": "^1.0.1",
"is-primitive": "^2.0.0",
"minimatch": "^3.0.3",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"multimatch": "^2.1.0",
"repeat-string": "^1.6.1",
"write": "^0.3.2",
"yargs-parser": "^4.0.2"
"write": "^0.3.3"
}
}
19 changes: 12 additions & 7 deletions examples/braces.js
@@ -1,13 +1,18 @@
var mm = require('../');

console.log(mm.braces('{a,b}'));
//=> [ '(a|b)' ]
/**
* Brace optimization
*/

console.log(mm.braces('{a,b}', {expand: true}));
//=> [ 'a', 'b' ]
console.log(mm.braces('{a,b,c}/{001..100}'));
//=> [ '{a,b,c}/{1..100}' ]

console.log(mm.braces('foo/{a,b}/bar'));
//=> [ 'foo/(a|b)/bar' ]
/**
* Brace expansion
*/

console.log(mm.braces('foo/{a,b}/bar', {expand: true}));
console.log(mm.braceExpand('{a,b,c}/{001..100}'));
//=> ['a/a', 'a/b', 'a/c', 'a/d', 'a/e', 'b/a', 'b/b', 'b/c', 'b/d', 'b/e', 'c/a', 'c/b', 'c/c', 'c/d', 'c/e']

console.log(mm.braces('{a,b,c}/{001..100}', {expand: true}));
//=> [ 'foo/a/bar', 'foo/b/bar' ]
2 changes: 1 addition & 1 deletion gulpfile.js
Expand Up @@ -22,4 +22,4 @@ gulp.task('unused', function() {
.pipe(unused({keys: Object.keys(require('./lib/utils.js'))}));
});

gulp.task('default', ['test', 'lint']);
gulp.task('default', ['test']);

0 comments on commit bf2cc5a

Please sign in to comment.