diff options
author | Rebecca Turner <me@re-becca.org> | 2015-07-24 11:19:29 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-07-24 12:39:55 +0300 |
commit | f130bfcb2b020da7627c866674311f09d22eff41 (patch) | |
tree | f407a66d66ab259cd1565e5d0b481fe84c09bb09 /node_modules/node-gyp | |
parent | 36c6a0d82b550866f53e8aa13932ebe4c781b1d5 (diff) |
node-gyp/glob/minimatch@2.0.10
Diffstat (limited to 'node_modules/node-gyp')
3 files changed, 119 insertions, 28 deletions
diff --git a/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js b/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js index 967b45c0d..7d0515920 100644 --- a/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js +++ b/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js @@ -1,4 +1,4 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.minimatch = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ module.exports = minimatch minimatch.Minimatch = Minimatch @@ -273,6 +273,7 @@ function parse (pattern, isSub) { var escaping = false // ? => one single character var patternListStack = [] + var negativeLists = [] var plType var stateChar var inClass = false @@ -373,9 +374,13 @@ function parse (pattern, isSub) { } plType = stateChar - patternListStack.push({ type: plType, start: i - 1, reStart: re.length }) + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!' : '(?:' + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue @@ -389,12 +394,15 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true re += ')' - plType = patternListStack.pop().type + var pl = patternListStack.pop() + plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:<pattern>)<type> switch (plType) { case '!': - re += '[^/]*?)' + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length break case '?': case '+': @@ -508,7 +516,7 @@ function parse (pattern, isSub) { // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. - for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + 3) // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { @@ -551,12 +559,49 @@ function parse (pattern, isSub) { case '(': addPatternStart = true } + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) re = '(?=.)' + re + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } - if (addPatternStart) re = patternStart + re + if (addPatternStart) { + re = patternStart + re + } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { @@ -1110,4 +1155,5 @@ module.exports = function (xs, fn) { return res; }; -},{}]},{},[1]); +},{}]},{},[1])(1) +});
\ No newline at end of file diff --git a/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js b/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js index 5e13d6d5b..ec4c05c57 100644 --- a/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js @@ -272,6 +272,7 @@ function parse (pattern, isSub) { var escaping = false // ? => one single character var patternListStack = [] + var negativeLists = [] var plType var stateChar var inClass = false @@ -372,9 +373,13 @@ function parse (pattern, isSub) { } plType = stateChar - patternListStack.push({ type: plType, start: i - 1, reStart: re.length }) + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!' : '(?:' + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue @@ -388,12 +393,15 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true re += ')' - plType = patternListStack.pop().type + var pl = patternListStack.pop() + plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:<pattern>)<type> switch (plType) { case '!': - re += '[^/]*?)' + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length break case '?': case '+': @@ -507,7 +515,7 @@ function parse (pattern, isSub) { // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. - for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + 3) // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { @@ -550,12 +558,49 @@ function parse (pattern, isSub) { case '(': addPatternStart = true } + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) re = '(?=.)' + re + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } - if (addPatternStart) re = patternStart + re + if (addPatternStart) { + re = patternStart + re + } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { diff --git a/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json b/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json index cd6902773..17ccc275e 100644 --- a/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json +++ b/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json @@ -2,23 +2,23 @@ "_args": [ [ "minimatch@^2.0.1", - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob" + "/Users/rebecca/code/npm/node_modules/glob" ], [ "minimatch@^2.0.1", - "/Users/rebecca/code/npm/node_modules/rimraf/node_modules/glob" + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob" ] ], "_from": "minimatch@>=2.0.1 <3.0.0", - "_id": "minimatch@2.0.8", + "_id": "minimatch@2.0.10", "_inCache": true, "_location": "/node-gyp/glob/minimatch", - "_nodeVersion": "2.0.1", + "_nodeVersion": "2.2.1", "_npmUser": { "email": "isaacs@npmjs.com", "name": "isaacs" }, - "_npmVersion": "2.10.0", + "_npmVersion": "3.1.0", "_phantomChildren": {}, "_requested": { "name": "minimatch", @@ -49,12 +49,12 @@ "devDependencies": { "browserify": "^9.0.3", "standard": "^3.7.2", - "tap": "" + "tap": "^1.2.0" }, "directories": {}, "dist": { - "shasum": "0bc20f6bf3570a698ef0ddff902063c6cabda6bf", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz" + "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" }, "engines": { "node": "*" @@ -63,7 +63,7 @@ "browser.js", "minimatch.js" ], - "gitHead": "0bc7d9c4b2bc816502184862b45bd090de3406a3", + "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", "homepage": "https://github.com/isaacs/minimatch#readme", "license": "ISC", "main": "minimatch.js", @@ -80,9 +80,9 @@ "url": "git://github.com/isaacs/minimatch.git" }, "scripts": { - "prepublish": "browserify -o browser.js -e minimatch.js --bare", - "pretest": "standard minimatch.js test/*.js", + "posttest": "standard minimatch.js test/*.js", + "prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare", "test": "tap test/*.js" }, - "version": "2.0.8" + "version": "2.0.10" } |