minimatch
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -263,2 +263,9 @@ ;(function (require, exports, module, platform) { | ||
Minimatch.prototype.braceExpand = braceExpand | ||
function pad(n, width, z) { | ||
z = z || '0'; | ||
n = n + ''; | ||
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; | ||
} | ||
function braceExpand (pattern, options) { | ||
@@ -336,9 +343,14 @@ options = options || this.options | ||
, start = +numset[1] | ||
, needPadding = numset[1][0] === '0' | ||
, startWidth = numset[1].length | ||
, padded | ||
, end = +numset[2] | ||
, inc = start > end ? -1 : 1 | ||
, set = [] | ||
for (var i = start; i != (end + inc); i += inc) { | ||
padded = needPadding ? pad(i, startWidth) : i + '' | ||
// append all the suffixes | ||
for (var ii = 0, ll = suf.length; ii < ll; ii ++) { | ||
set.push(i + suf[ii]) | ||
set.push(padded + suf[ii]) | ||
} | ||
@@ -345,0 +357,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "a glob matcher in javascript", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -24,2 +24,9 @@ var tap = require("tap") | ||
, [ "a{b}c", ["a{b}c"] ] | ||
, [ "a{00..05}b" | ||
, ["a00b" | ||
,"a01b" | ||
,"a02b" | ||
,"a03b" | ||
,"a04b" | ||
,"a05b" ] ] | ||
].forEach(function (tc) { | ||
@@ -26,0 +33,0 @@ var p = tc[0] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63175
1556