minimatch
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -1,2 +0,30 @@ | ||
module.exports = minimatch | ||
;(function (require, exports, module, platform) { | ||
if (module) module.exports = minimatch | ||
else exports.minimatch = minimatch | ||
if (!require) { | ||
require = function (id) { | ||
switch (id) { | ||
case "path": return { basename: function (f) { | ||
f = f.split(/[\/\\]/) | ||
var e = f.pop() | ||
if (!e) e = f.pop() | ||
return e | ||
}} | ||
case "lru-cache": return function LRUCache () { | ||
// not quite an LRU, but still space-limited. | ||
var cache = {} | ||
var cnt = 0 | ||
this.set = function (k, v) { | ||
cnt ++ | ||
if (cnt >= 100) cache = {} | ||
cache[k] = v | ||
} | ||
this.get = function (k) { return cache[k] } | ||
} | ||
} | ||
} | ||
} | ||
minimatch.Minimatch = Minimatch | ||
@@ -58,2 +86,26 @@ | ||
function ext (a, b) { | ||
Object.keys(b).forEach(function (k) { | ||
a[k] = b[k] | ||
}) | ||
return a | ||
} | ||
minimatch.defaults = function (def) { | ||
function m (p, pattern, options) { | ||
return minimatch(p, pattern, ext(ext({}, def), options)) | ||
} | ||
m.Minimatch = function (pattern, options) { | ||
return new Minimatch(pattern, ext(ext({}, def), options)) | ||
} | ||
return m | ||
} | ||
Minimatch.defaults = function (def) { | ||
return minimatch.defaults(def).Minimatch | ||
} | ||
function minimatch (p, pattern, options) { | ||
@@ -772,8 +824,5 @@ if (typeof pattern !== "string") { | ||
// first, normalize any slash-separated path parts. | ||
// f = path.normalize(f) | ||
// windows: need to use /, not \ | ||
// On other platforms, \ is a valid (albeit bad) filename char. | ||
if (process.platform === "win32") { | ||
if (platform === "win32") { | ||
f = f.split("\\").join("/") | ||
@@ -989,1 +1038,7 @@ } | ||
} | ||
})( typeof require === "function" ? require : null, | ||
this, | ||
typeof module === "object" ? module : null, | ||
typeof process === "object" ? process.platform : "win32" | ||
) |
@@ -5,3 +5,3 @@ { | ||
"description": "a glob matcher in javascript", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
84265
10
1399
1