minimatch
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -87,15 +87,25 @@ ;(function (require, exports, module, platform) { | ||
function ext (a, b) { | ||
a = a || {} | ||
b = b || {} | ||
var t = {} | ||
Object.keys(b).forEach(function (k) { | ||
a[k] = b[k] | ||
t[k] = b[k] | ||
}) | ||
return a | ||
Object.keys(a).forEach(function (k) { | ||
t[k] = a[k] | ||
}) | ||
return t | ||
} | ||
minimatch.defaults = function (def) { | ||
function m (p, pattern, options) { | ||
return minimatch(p, pattern, ext(ext({}, def), options)) | ||
if (!def || !Object.keys(def).length) return minimatch | ||
var orig = minimatch | ||
var m = function minimatch (p, pattern, options) { | ||
return orig.minimatch(p, pattern, ext(def, options)) | ||
} | ||
m.Minimatch = function (pattern, options) { | ||
return new Minimatch(pattern, ext(ext({}, def), options)) | ||
m.Minimatch = function Minimatch (pattern, options) { | ||
return new orig.Minimatch(pattern, ext(def, options)) | ||
} | ||
@@ -107,2 +117,3 @@ | ||
Minimatch.defaults = function (def) { | ||
if (!def || !Object.keys(def).length) return Minimatch | ||
return minimatch.defaults(def).Minimatch | ||
@@ -109,0 +120,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "a glob matcher in javascript", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -245,4 +245,4 @@ // http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test | ||
// options.debug = true | ||
var Class = options ? mm.defaults(options).Minimatch : mm.Minimatch | ||
var m = new Class(pattern, options) | ||
var Class = mm.defaults(options).Minimatch | ||
var m = new Class(pattern, {}) | ||
var r = m.makeRe() | ||
@@ -249,0 +249,0 @@ tapOpts.re = String(r) || JSON.stringify(r) |
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
1408
56864
9