aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/minimatch
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-05-05 22:33:06 -0700
committerisaacs <i@izs.me>2012-05-05 22:33:12 -0700
commit33a9ac6087732da48e7d12ea7f7fbb41926fe46c (patch)
treea914e333e80a3401ce8726355b38f1d636500cb5 /deps/npm/node_modules/minimatch
parent1858d1c340ca2631e28a32eb542c85ee8f725cac (diff)
downloadandroid-node-v8-33a9ac6087732da48e7d12ea7f7fbb41926fe46c.tar.gz
android-node-v8-33a9ac6087732da48e7d12ea7f7fbb41926fe46c.tar.bz2
android-node-v8-33a9ac6087732da48e7d12ea7f7fbb41926fe46c.zip
Upgrade npm to 1.1.21
Somehow this got downgraded in the last v0.6 merge. Very strange.
Diffstat (limited to 'deps/npm/node_modules/minimatch')
-rw-r--r--deps/npm/node_modules/minimatch/README.md14
-rw-r--r--deps/npm/node_modules/minimatch/minimatch.js67
-rw-r--r--deps/npm/node_modules/minimatch/package.json29
3 files changed, 48 insertions, 62 deletions
diff --git a/deps/npm/node_modules/minimatch/README.md b/deps/npm/node_modules/minimatch/README.md
index d5f97234cd..6fd07d2e97 100644
--- a/deps/npm/node_modules/minimatch/README.md
+++ b/deps/npm/node_modules/minimatch/README.md
@@ -60,11 +60,12 @@ thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
`a/**b` will not. **Note that this is different from the way that `**` is
handled by ruby's `Dir` class.**
-If an escaped pattern has no matches, and the `null` flag is not set,
+If an escaped pattern has no matches, and the `nonull` flag is set,
then minimatch.match returns the pattern as-provided, rather than
interpreting the character escapes. For example,
`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
-`"*a?"`.
+`"*a?"`. This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
If brace expansion is not disabled, then it is performed before any
other interpretation of the glob pattern. Thus, a pattern like
@@ -147,8 +148,8 @@ var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))
### minimatch.match(list, pattern, options)
Match against the list of
-files, in the style of fnmatch or glob. If nothing is matched, then
-return the pattern (unless `{ null: true }` in the options.)
+files, in the style of fnmatch or glob. If nothing is matched, and
+options.nonull is set, then return a list containing the pattern itself.
```javascript
var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}))
@@ -210,3 +211,8 @@ comment.
### nonegate
Suppress the behavior of treating a leading `!` character as negation.
+
+### flipNegate
+
+Returns from negate expressions the same as if they were not negated.
+(Ie, true on a hit, false on a miss.)
diff --git a/deps/npm/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/minimatch/minimatch.js
index 768c8ebac7..1ca08104ee 100644
--- a/deps/npm/node_modules/minimatch/minimatch.js
+++ b/deps/npm/node_modules/minimatch/minimatch.js
@@ -4,7 +4,6 @@ minimatch.Minimatch = Minimatch
var LRU = require("lru-cache")
, cache = minimatch.cache = new LRU(100)
, GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
- , pathSplit = process.platform === "win32" ? /\\|\// : "/"
var path = require("path")
// any single thing other than /
@@ -130,7 +129,7 @@ function make () {
this.parseNegate()
// step 2: expand braces
- var set = this.braceExpand()
+ var set = this.globSet = this.braceExpand()
if (options.debug) console.error(this.pattern, set)
@@ -139,36 +138,10 @@ function make () {
// These will be regexps, except in the case of "**", which is
// set to the GLOBSTAR object for globstar behavior,
// and will not contain any / characters
- set = set.map(function (s) {
+ set = this.globParts = set.map(function (s) {
return s.split(slashSplit)
})
- // step 4: if we have a defined root, then patterns starting with ""
- // get attached to that. If we have a defined cwd, then patterns
- // *not* starting with "" get attached to that.
- // Exception 1: on windows, a pattern like //\?/c:/ or c:/ will
- // not get anything prefixed to it.
- // Exception 2: If matchBase is set, and it's just a filename,
- // then don't prefix anything onto it, since it'll only match
- // files with that basename anyhow.
- set = set.map(function (p) {
- if (process.platform === "win32" &&
- ( (p[0] === "" && p[1] === "" && p[2] === "\\?") // unc
- || (p[0].match(/^[a-zA-Z]:$/)) )) {
- return p
- }
- if (options.matchBase && p.length === 1) return p
- // do prefixing.
- if (options.root && p[0] === "") {
- return options.root.split(pathSplit).concat(p)
- }
- if (options.cwd && p[0] !== "") {
- return options.cwd.split(pathSplit).concat(p)
- }
- return p
- })
-
-
if (options.debug) console.error(this.pattern, set)
// glob --> regexps
@@ -545,7 +518,8 @@ function parse (pattern, isSub) {
patternListStack.push({ type: plType
, start: i - 1
, reStart: re.length })
- re += stateChar === "!" ? "(?!" : "(?:"
+ // negation is (?:(?!js)[^/]*)
+ re += stateChar === "!" ? "(?:(?!" : "(?:"
stateChar = false
continue
@@ -558,11 +532,15 @@ function parse (pattern, isSub) {
hasMagic = true
re += ")"
plType = patternListStack.pop().type
+ // negation is (?:(?!js)[^/]*)
+ // The others are (?:<pattern>)<type>
switch (plType) {
+ case "!":
+ re += "[^/]*?)"
+ break
case "?":
case "+":
case "*": re += plType
- case "!": // already handled by the start
case "@": break // the default anyway
}
continue
@@ -786,13 +764,12 @@ function match (f, partial) {
if (this.comment) return false
if (this.empty) return f === ""
+ if (f === "/" && partial) return true
+
var options = this.options
// first, normalize any slash-separated path parts.
// f = path.normalize(f)
- var absolute = isAbsolute(f)
-
- // console.error(this.pattern, f, absolute)
// windows: need to use /, not \
// On other platforms, \ is a valid (albeit bad) filename char.
@@ -802,7 +779,9 @@ function match (f, partial) {
// treat the test path as a set of pathparts.
f = f.split(slashSplit)
- // console.error(this.pattern, "split", f)
+ if (options.debug) {
+ console.error(this.pattern, "split", f)
+ }
// just ONE of the pattern sets in this.set needs to match
// in order for it to be valid. If negating, then just one
@@ -816,12 +795,14 @@ function match (f, partial) {
var pattern = set[i]
var hit = this.matchOne(f, pattern, partial)
if (hit) {
+ if (options.flipNegate) return true
return !this.negate
}
}
// didn't get any hits. this is success if it's a negative
// pattern, failure otherwise.
+ if (options.flipNegate) return false
return this.negate
}
@@ -1003,19 +984,3 @@ function globUnescape (s) {
function regExpEscape (s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")
}
-
-
-function isAbsolute (p) {
- if (process.platform !== "win32") return p.charAt(0) === "/"
-
- // yanked from node/lib/path.js
- var splitDeviceRe =
- /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?([\s\S]*?)$/
-
- var result = p.match(splitDeviceRe)
- , device = result[1] || ""
- , isUnc = device && device.charAt(1) !== ":"
- , isAbs = !!result[2] || isUnc // UNC always absolute
-
- return isAbs
-}
diff --git a/deps/npm/node_modules/minimatch/package.json b/deps/npm/node_modules/minimatch/package.json
index 92ccac5fb9..1bcb3d43e6 100644
--- a/deps/npm/node_modules/minimatch/package.json
+++ b/deps/npm/node_modules/minimatch/package.json
@@ -1,8 +1,12 @@
{
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me"
+ },
"name": "minimatch",
"description": "a glob matcher in javascript",
- "version": "0.1.3",
+ "version": "0.2.2",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/minimatch.git"
@@ -18,12 +22,23 @@
"lru-cache": "~1.0.5"
},
"devDependencies": {
- "tap": "~0.1.3"
+ "tap": ""
},
- "licenses" : [
+ "licenses": [
{
- "type" : "MIT",
- "url" : "http://github.com/isaacs/minimatch/raw/master/LICENSE"
+ "type": "MIT",
+ "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE"
}
- ]
+ ],
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "_id": "minimatch@0.2.2",
+ "optionalDependencies": {},
+ "_engineSupported": true,
+ "_npmVersion": "1.1.12",
+ "_nodeVersion": "v0.7.7-pre",
+ "_defaultsLoaded": true,
+ "_from": "minimatch@0"
}