diff options
author | Rebecca Turner <me@re-becca.org> | 2016-01-21 02:36:35 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2016-01-21 04:43:31 +0300 |
commit | 3cc26a58e35ed9da8c274ea935aedf2a97712d48 (patch) | |
tree | 7c590886488b65b22030887a9d6709d544ab80bd /node_modules/fstream-npm | |
parent | 0e8c4cebddaefbf5eca0abaad512db266c6722c9 (diff) |
deps: fstream-npm subsubdep updates
brace-expansion@1.1.2
Diffstat (limited to 'node_modules/fstream-npm')
5 files changed, 233 insertions, 134 deletions
diff --git a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index 2aff0ebff..421f3aa5f 100644 --- a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,6 +47,15 @@ If there's no match, `undefined` will be returned. If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ <a index>, <b index> ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. + ## Installation With [npm](https://npmjs.org) do: diff --git a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index d165ae817..75f3d71cb 100644 --- a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -1,38 +1,50 @@ module.exports = balanced; function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i < str.length && i >= 0 && ! result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); } + + i = ai < bi && ai >= 0 ? ai : bi; } - } - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; + if (begs.length) { + result = [ left, right ]; } - return m; } + + return result; } diff --git a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 662faff69..d71e6b979 100644 --- a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -1,73 +1,98 @@ { - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.2.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test" + "_args": [ + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.3.0 <0.4.0", + "_id": "balanced-match@0.3.0", + "_inCache": true, + "_installable": true, + "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.1" + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "balanced-match", + "raw": "balanced-match@^0.3.0", + "rawSpec": "^0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" + "_requiredBy": [ + "/fstream-npm/fstream-ignore/minimatch/brace-expansion" ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", + "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "_shrinkwrap": null, + "_spec": "balanced-match@^0.3.0", + "_where": "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion", "author": { - "name": "Julian Gruber", "email": "mail@juliangruber.com", + "name": "Julian Gruber", "url": "http://juliangruber.com" }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "d743dd31d7376e0fcf99392a4be7227f2e99bf5d", "bugs": { "url": "https://github.com/juliangruber/balanced-match/issues" }, - "_id": "balanced-match@0.2.1", - "_shasum": "7bc658b4bed61eee424ad74f75f5c3e2c4df3cc7", - "_from": "balanced-match@>=0.2.0 <0.3.0", - "_npmVersion": "2.14.7", - "_nodeVersion": "4.2.1", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "~4.2.2" }, + "directories": {}, "dist": { - "shasum": "7bc658b4bed61eee424ad74f75f5c3e2c4df3cc7", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz" + "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" }, + "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "balanced", + "match", + "parse", + "regexp", + "test" + ], + "license": "MIT", + "main": "index.js", "maintainers": [ { "name": "juliangruber", "email": "julian@juliangruber.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz", - "readme": "ERROR: No README data found!" + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/25..latest", + "chrome/canary", + "firefox/20..latest", + "firefox/nightly", + "ie/8..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "0.3.0" } diff --git a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js index 36bfd3995..f5e98e3f2 100644 --- a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -52,5 +52,33 @@ test('balanced', function(t) { body: 'in<b>nest</b>', post: 'post' }); + t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 9, + pre: 'pre', + body: '{in}', + post: 'post' + }); + t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'in', + post: '}post' + }); + t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { + start: 4, + end: 10, + pre: 'pre{', + body: 'first', + post: 'in{second}post' + }); + t.deepEqual(balanced('<?', '?>', 'pre<?>post'), { + start: 3, + end: 4, + pre: 'pre', + body: '', + post: 'post' + }); t.end(); }); diff --git a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json index 4cb3e05d7..14febd4da 100644 --- a/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,60 +1,64 @@ { - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh" - }, - "dependencies": { - "balanced-match": "^0.2.0", - "concat-map": "0.0.1" + "_args": [ + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.2", + "_inCache": true, + "_installable": true, + "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" }, - "devDependencies": { - "tape": "^3.0.3" + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "brace-expansion", + "raw": "brace-expansion@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" }, - "keywords": [], + "_requiredBy": [ + "/fstream-npm/fstream-ignore/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz", + "_shasum": "f21445d0488b658e2771efd870eff51df29f04ef", + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch", "author": { - "name": "Julian Gruber", "email": "mail@juliangruber.com", + "name": "Julian Gruber", "url": "http://juliangruber.com" }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "f50da498166d76ea570cf3b30179f01f0f119612", "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, - "_id": "brace-expansion@1.1.1", - "_shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.6.1", - "_nodeVersion": "0.10.36", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" + "dependencies": { + "balanced-match": "^0.3.0", + "concat-map": "0.0.1" }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "tape": "4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "f21445d0488b658e2771efd870eff51df29f04ef", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz" + }, + "gitHead": "b03773a30fa516b1374945b68e9acb6253d595fa", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", "maintainers": [ { "name": "juliangruber", @@ -65,11 +69,32 @@ "email": "isaacs@npmjs.com" } ], - "dist": { - "shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz" + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/25..latest", + "chrome/canary", + "firefox/20..latest", + "firefox/nightly", + "ie/8..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "1.1.2" } |