pax_global_header00006660000000000000000000000064151614412200014506gustar00rootroot0000000000000052 comment=73b5459d2ab973c984d01324769d306f66440c7e juliangruber-brace-expansion-5efc551/000077500000000000000000000000001516144122000176725ustar00rootroot00000000000000juliangruber-brace-expansion-5efc551/.github/000077500000000000000000000000001516144122000212325ustar00rootroot00000000000000juliangruber-brace-expansion-5efc551/.github/FUNDING.yml000066400000000000000000000000661516144122000230510ustar00rootroot00000000000000tidelift: "npm/brace-expansion" patreon: juliangruber juliangruber-brace-expansion-5efc551/.gitignore000066400000000000000000000000231516144122000216550ustar00rootroot00000000000000node_modules *.sw* juliangruber-brace-expansion-5efc551/.npmignore000066400000000000000000000000621516144122000216670ustar00rootroot00000000000000test .gitignore .travis.yml example.js .npmignore juliangruber-brace-expansion-5efc551/.travis.yml000066400000000000000000000001341516144122000220010ustar00rootroot00000000000000sudo: false arch: - amd64 - ppc64le language: node_js node_js: - "10" - "12" - "14" juliangruber-brace-expansion-5efc551/LICENSE000066400000000000000000000021101516144122000206710ustar00rootroot00000000000000MIT License Copyright (c) 2013 Julian Gruber Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. juliangruber-brace-expansion-5efc551/README.md000066400000000000000000000102341516144122000211510ustar00rootroot00000000000000# brace-expansion [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) [![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) ## Example ```js var expand = require('brace-expansion'); expand('file-{a,b,c}.jpg') // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] expand('-v{,,}') // => ['-v', '-v', '-v'] expand('file{0..2}.jpg') // => ['file0.jpg', 'file1.jpg', 'file2.jpg'] expand('file-{a..c}.jpg') // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] expand('file{2..0}.jpg') // => ['file2.jpg', 'file1.jpg', 'file0.jpg'] expand('file{0..4..2}.jpg') // => ['file0.jpg', 'file2.jpg', 'file4.jpg'] expand('file-{a..e..2}.jpg') // => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] expand('file{00..10..5}.jpg') // => ['file00.jpg', 'file05.jpg', 'file10.jpg'] expand('{{A..C},{a..c}}') // => ['A', 'B', 'C', 'a', 'b', 'c'] expand('ppp{,config,oe{,conf}}') // => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] ``` ## API ```js var expand = require('brace-expansion'); ``` ### var expanded = expand(str) Return an array of all possible and valid expansions of `str`. If none are found, `[str]` is returned. Valid expansions are: ```js /^(.*,)+(.+)?$/ // {a,b,...} ``` A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. ```js /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ // {x..y[..incr]} ``` A numeric sequence from `x` to `y` inclusive, with optional increment. If `x` or `y` start with a leading `0`, all the numbers will be padded to have equal length. Negative numbers and backwards iteration work too. ```js /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ // {x..y[..incr]} ``` An alphabetic sequence from `x` to `y` inclusive, with optional increment. `x` and `y` must be exactly one character, and if given, `incr` must be a number. For compatibility reasons, the string `${` is not eligible for brace expansion. ## Installation With [npm](https://npmjs.org) do: ```bash npm install brace-expansion ``` ## Contributors - [Julian Gruber](https://github.com/juliangruber) - [Isaac Z. Schlueter](https://github.com/isaacs) ## Sponsors This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! ## Security contact information To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. ## License (MIT) Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. juliangruber-brace-expansion-5efc551/example.js000066400000000000000000000006161516144122000216660ustar00rootroot00000000000000var expand = require('./'); console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); console.log(expand('http://www.letters.com/file{a..z..2}.txt')); console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); juliangruber-brace-expansion-5efc551/index.js000066400000000000000000000116211516144122000213400ustar00rootroot00000000000000var balanced = require('balanced-match'); module.exports = expandTop; var escSlash = '\0SLASH'+Math.random()+'\0'; var escOpen = '\0OPEN'+Math.random()+'\0'; var escClose = '\0CLOSE'+Math.random()+'\0'; var escComma = '\0COMMA'+Math.random()+'\0'; var escPeriod = '\0PERIOD'+Math.random()+'\0'; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split('\\\\').join(escSlash) .split('\\{').join(escOpen) .split('\\}').join(escClose) .split('\\,').join(escComma) .split('\\.').join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join('\\') .split(escOpen).join('{') .split(escClose).join('}') .split(escComma).join(',') .split(escPeriod).join('.'); } // Basically just str.split(","), but handling cases // where we have nested braced sections, which should be // treated as individual members, like {a,{b,c},d} function parseCommaParts(str) { if (!str) return ['']; var parts = []; var m = balanced('{', '}', str); if (!m) return str.split(','); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(','); p[p.length-1] += '{' + body + '}'; var postParts = parseCommaParts(post); if (post.length) { p[p.length-1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} if (str.substr(0, 2) === '{}') { str = '\\{\\}' + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } function embrace(str) { return '{' + str + '}'; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); if (!m) return [str]; // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; var post = m.post.length ? expand(m.post, false) : ['']; if (/\$$/.test(m.pre)) { for (var k = 0; k < post.length; k++) { var expansion = pre+ '{' + m.body + '}' + post[k]; expansions.push(expansion); } } else { var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,(?!,).*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { // x{{a,b}}y ==> x{a}y x{b}y n = expand(n[0], false).map(embrace); if (n.length === 1) { return post.map(function(p) { return m.pre + n[0] + p; }); } } } // at this point, n is the parts, and we know it's not a comma set // with a single entry. var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length) var incr = n.length == 3 ? Math.max(Math.abs(numeric(n[2])), 1) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') c = ''; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join('0'); if (i < 0) c = '-' + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = []; for (var j = 0; j < n.length; j++) { N.push.apply(N, expand(n[j], false)); } } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } } return expansions; } juliangruber-brace-expansion-5efc551/package-lock.json000066400000000000000000000551771516144122000231250ustar00rootroot00000000000000{ "name": "brace-expansion", "version": "2.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { "@c4312/matcha": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@c4312/matcha/-/matcha-1.3.1.tgz", "integrity": "sha512-JfkUCcWH5ez5N9UOEq7qFAbavkaASaGx9mQfmv+XIFrzp3YC08PKVWZfzv+u5kRQVrQmbZ+hLrnyqzEmLLkKlA==", "dev": true, "requires": { "benchmark": "^2.1.4", "chalk": "^3.0.0", "commander": "^4.1.0", "microtime": "^3.0.0" } }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" } }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "benchmark": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", "dev": true, "requires": { "lodash": "^4.17.4", "platform": "^1.3.3" } }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" } }, "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "deep-equal": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", "dev": true, "requires": { "is-arguments": "^1.0.4", "is-date-object": "^1.0.1", "is-regex": "^1.0.4", "object-is": "^1.0.1", "object-keys": "^1.1.1", "regexp.prototype.flags": "^1.2.0" } }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { "object-keys": "^1.0.12" } }, "defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", "dev": true }, "dotignore": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", "dev": true, "requires": { "minimatch": "^3.0.4" } }, "es-abstract": { "version": "1.18.0-next.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", "is-negative-zero": "^2.0.0", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" }, "dependencies": { "is-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { "has-symbols": "^1.0.1" } }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true } } }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" } }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { "is-callable": "^1.1.3" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { "function-bind": "^1.1.1" } }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "is-arguments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", "dev": true }, "is-callable": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true }, "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-negative-zero": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", "dev": true }, "is-regex": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "dev": true, "requires": { "has": "^1.0.3" } }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, "requires": { "has-symbols": "^1.0.1" } }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "microtime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/microtime/-/microtime-3.0.0.tgz", "integrity": "sha512-SirJr7ZL4ow2iWcb54bekS4aWyBQNVcEDBiwAz9D/sTgY59A+uE8UJU15cp5wyZmPBwg/3zf8lyCJ5NUe1nVlQ==", "dev": true, "requires": { "node-addon-api": "^1.2.0", "node-gyp-build": "^3.8.0" } }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "node-addon-api": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==", "dev": true }, "node-gyp-build": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.9.0.tgz", "integrity": "sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A==", "dev": true }, "object-inspect": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", "dev": true }, "object-is": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.3.tgz", "integrity": "sha512-teyqLvFWzLkq5B9ki8FVWA902UER2qkxmdA4nLf+wjOLAWgxzCWZNCxpDq9MvE8MmhWNr+I8w3BN49Vx36Y6Xg==", "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.1" } }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object.assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.0", "has-symbols": "^1.0.1", "object-keys": "^1.1.1" } }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" } }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "platform": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", "dev": true }, "regexp.prototype.flags": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" }, "dependencies": { "es-abstract": { "version": "1.17.7", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } }, "is-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { "has-symbols": "^1.0.1" } }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true } } }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" } }, "resumer": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, "requires": { "through": "~2.3.4" } }, "string.prototype.trim": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.2.tgz", "integrity": "sha512-b5yrbl3BXIjHau9Prk7U0RRYcUYdN4wGSVaqoBQS50CCE3KBuYU0TYRNPFCP7aVoNMX87HKThdMRVIP3giclKg==", "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.0" } }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" }, "dependencies": { "es-abstract": { "version": "1.17.7", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } }, "is-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { "has-symbols": "^1.0.1" } }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true } } }, "string.prototype.trimstart": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" }, "dependencies": { "es-abstract": { "version": "1.17.7", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } }, "is-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { "has-symbols": "^1.0.1" } }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true } } }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" } }, "tape": { "version": "4.13.3", "resolved": "https://registry.npmjs.org/tape/-/tape-4.13.3.tgz", "integrity": "sha512-0/Y20PwRIUkQcTCSi4AASs+OANZZwqPKaipGCEwp10dQMipVvSZwUUCi01Y/OklIGyHKFhIcjock+DKnBfLAFw==", "dev": true, "requires": { "deep-equal": "~1.1.1", "defined": "~1.0.0", "dotignore": "~0.1.2", "for-each": "~0.3.3", "function-bind": "~1.1.1", "glob": "~7.1.6", "has": "~1.0.3", "inherits": "~2.0.4", "is-regex": "~1.0.5", "minimist": "~1.2.5", "object-inspect": "~1.7.0", "resolve": "~1.17.0", "resumer": "~0.0.0", "string.prototype.trim": "~1.2.1", "through": "~2.3.8" } }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true } } } juliangruber-brace-expansion-5efc551/package.json000066400000000000000000000021571516144122000221650ustar00rootroot00000000000000{ "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", "version": "2.0.3", "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", "bench": "matcha test/perf/bench.js" }, "dependencies": { "balanced-match": "^1.0.0" }, "devDependencies": { "@c4312/matcha": "^1.3.1", "tape": "^4.6.0" }, "keywords": [], "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", "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" ] }, "publishConfig": { "tag": "2.x" } } juliangruber-brace-expansion-5efc551/test/000077500000000000000000000000001516144122000206515ustar00rootroot00000000000000juliangruber-brace-expansion-5efc551/test/bash-comparison.js000066400000000000000000000016151516144122000242770ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); var fs = require('fs'); var resfile = __dirname + '/bash-results.txt'; var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); // throw away the EOF marker cases.pop() test('matches bash expansions', function(t) { cases.forEach(function(testcase) { var set = testcase.split('\n'); var pattern = set.shift(); var actual = expand(pattern); // If it expands to the empty string, then it's actually // just nothing, but Bash is a singly typed language, so // "nothing" is the same as "". if (set.length === 1 && set[0] === '') { set = [] } else { // otherwise, strip off the [] that were added so that // "" expansions would be preserved properly. set = set.map(function (s) { return s.replace(/^\[|\]$/g, '') }) } t.same(actual, set, pattern); }); t.end(); }) juliangruber-brace-expansion-5efc551/test/bash-results.txt000066400000000000000000000206431516144122000240330ustar00rootroot00000000000000A{b,{d,e},{f,g}}Z [AbZ] [AdZ] [AeZ] [AfZ] [AgZ]><><><><><><><\{a,b}{{a,b},a,b} [{a,b}a] [{a,b}b] [{a,b}a] [{a,b}b]><><><><{{a,b} [{a] [{b]><><><><{a,b}} [a}] [b}]><><><><{,} ><><><><><><><{,}b [b] [b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} [-01] [000] [001] [002] [003] [004] [005]><><><><{-05..100..5} [-05] [000] [005] [010] [015] [020] [025] [030] [035] [040] [045] [050] [055] [060] [065] [070] [075] [080] [085] [090] [095] [100]><><><><{-05..100} [-05] [-04] [-03] [-02] [-01] [000] [001] [002] [003] [004] [005] [006] [007] [008] [009] [010] [011] [012] [013] [014] [015] [016] [017] [018] [019] [020] [021] [022] [023] [024] [025] [026] [027] [028] [029] [030] [031] [032] [033] [034] [035] [036] [037] [038] [039] [040] [041] [042] [043] [044] [045] [046] [047] [048] [049] [050] [051] [052] [053] [054] [055] [056] [057] [058] [059] [060] [061] [062] [063] [064] [065] [066] [067] [068] [069] [070] [071] [072] [073] [074] [075] [076] [077] [078] [079] [080] [081] [082] [083] [084] [085] [086] [087] [088] [089] [090] [091] [092] [093] [094] [095] [096] [097] [098] [099] [100]><><><><{0..5..2} [0] [2] [4]><><><><{0001..05..2} [0001] [0003] [0005]><><><><{0001..-5..2} [0001] [-001] [-003] [-005]><><><><{0001..-5..-2} [0001] [-001] [-003] [-005]><><><><{0001..5..-2} [0001] [0003] [0005]><><><><{01..5} [01] [02] [03] [04] [05]><><><><{1..05} [01] [02] [03] [04] [05]><><><><{1..05..3} [01] [04]><><><><{05..100} [005] [006] [007] [008] [009] [010] [011] [012] [013] [014] [015] [016] [017] [018] [019] [020] [021] [022] [023] [024] [025] [026] [027] [028] [029] [030] [031] [032] [033] [034] [035] [036] [037] [038] [039] [040] [041] [042] [043] [044] [045] [046] [047] [048] [049] [050] [051] [052] [053] [054] [055] [056] [057] [058] [059] [060] [061] [062] [063] [064] [065] [066] [067] [068] [069] [070] [071] [072] [073] [074] [075] [076] [077] [078] [079] [080] [081] [082] [083] [084] [085] [086] [087] [088] [089] [090] [091] [092] [093] [094] [095] [096] [097] [098] [099] [100]><><><><{0a..0z} [{0a..0z}]><><><><{a,b\}c,d} [a] [b}c] [d]><><><><{a,b{c,d} [{a,bc] [{a,bd]><><><><{a,b}c,d} [ac,d}] [bc,d}]><><><><{a..F} [a] [`] [_] [^] []] [] [[] [Z] [Y] [X] [W] [V] [U] [T] [S] [R] [Q] [P] [O] [N] [M] [L] [K] [J] [I] [H] [G] [F]><><><><{A..f} [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] [[] [] []] [^] [_] [`] [a] [b] [c] [d] [e] [f]><><><><{a..Z} [a] [`] [_] [^] []] [] [[] [Z]><><><><{A..z} [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] [[] [] []] [^] [_] [`] [a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]><><><><{z..A} [z] [y] [x] [w] [v] [u] [t] [s] [r] [q] [p] [o] [n] [m] [l] [k] [j] [i] [h] [g] [f] [e] [d] [c] [b] [a] [`] [_] [^] []] [] [[] [Z] [Y] [X] [W] [V] [U] [T] [S] [R] [Q] [P] [O] [N] [M] [L] [K] [J] [I] [H] [G] [F] [E] [D] [C] [B] [A]><><><><{Z..a} [Z] [[] [] []] [^] [_] [`] [a]><><><><{a..F..2} [a] [_] []] [[] [Y] [W] [U] [S] [Q] [O] [M] [K] [I] [G]><><><><{A..f..02} [A] [C] [E] [G] [I] [K] [M] [O] [Q] [S] [U] [W] [Y] [[] []] [_] [a] [c] [e]><><><><{a..Z..5} [a] []><><><><><><><{A..z..10} [A] [K] [U] [_] [i] [s]><><><><{z..A..-2} [z] [x] [v] [t] [r] [p] [n] [l] [j] [h] [f] [d] [b] [`] [^] [] [Z] [X] [V] [T] [R] [P] [N] [L] [J] [H] [F] [D] [B]><><><><{Z..a..20} [Z]><><><><{a{,b} [{a] [{ab]><><><><{a},b} [a}] [b]><><><><{x,y{,}g} [x] [yg] [yg]><><><><{x,y{}g} [x] [y{}g]><><><><{{a,b} [{a] [{b]><><><><{{a,b},c} [a] [b] [c]><><><><{{a,b}c} [{ac}] [{bc}]><><><><{{a,b},} [a] [b]><><><><><><><{{a,b},}c [ac] [bc] [c]><><><><{{a,b}.} [{a.}] [{b.}]><><><><{{a,b}} [{a}] [{b}]><><><><><><>< ><><><><{-10..00} [-10] [-09] [-08] [-07] [-06] [-05] [-04] [-03] [-02] [-01] [000]><><><><{a,\\{a,b}c} [a] [\ac] [\bc]><><><><{a,\{a,b}c} [ac}] [{ac}] [bc}]><><><><><><><{-10.\.00} [{-10..00}]><><><><><><><><><><{l,n,m}xyz [lxyz] [nxyz] [mxyz]><><><><{abc\,def} [{abc,def}]><><><><{abc} [{abc}]><><><><{x\,y,\{abc\},trie} [x,y] [{abc}] [trie]><><><><{} [{}]><><><><} [}]><><><><{ [{]><><><><><><><{1..10} [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]><><><><{0..10,braces} [0..10] [braces]><><><><{{0..10},braces} [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [braces]><><><><><><><{3..3} [3]><><><><><><><{10..1} [10] [9] [8] [7] [6] [5] [4] [3] [2] [1]><><><><{10..1}y [10y] [9y] [8y] [7y] [6y] [5y] [4y] [3y] [2y] [1y]><><><><><><><{a..f} [a] [b] [c] [d] [e] [f]><><><><{f..a} [f] [e] [d] [c] [b] [a]><><><><{a..A} [a] [`] [_] [^] []] [] [[] [Z] [Y] [X] [W] [V] [U] [T] [S] [R] [Q] [P] [O] [N] [M] [L] [K] [J] [I] [H] [G] [F] [E] [D] [C] [B] [A]><><><><{A..a} [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] [[] [] []] [^] [_] [`] [a]><><><><{f..f} [f]><><><><{1..f} [{1..f}]><><><><{f..1} [{f..1}]><><><><{-1..-10} [-1] [-2] [-3] [-4] [-5] [-6] [-7] [-8] [-9] [-10]><><><><{-20..0} [-20] [-19] [-18] [-17] [-16] [-15] [-14] [-13] [-12] [-11] [-10] [-9] [-8] [-7] [-6] [-5] [-4] [-3] [-2] [-1] [0]><><><><><><><><><><{klklkl}{1,2,3} [{klklkl}1] [{klklkl}2] [{klklkl}3]><><><><{1..10..2} [1] [3] [5] [7] [9]><><><><{-1..-10..2} [-1] [-3] [-5] [-7] [-9]><><><><{-1..-10..-2} [-1] [-3] [-5] [-7] [-9]><><><><{10..1..-2} [10] [8] [6] [4] [2]><><><><{10..1..2} [10] [8] [6] [4] [2]><><><><{1..20..2} [1] [3] [5] [7] [9] [11] [13] [15] [17] [19]><><><><{1..20..20} [1]><><><><{100..0..5} [100] [95] [90] [85] [80] [75] [70] [65] [60] [55] [50] [45] [40] [35] [30] [25] [20] [15] [10] [5] [0]><><><><{100..0..-5} [100] [95] [90] [85] [80] [75] [70] [65] [60] [55] [50] [45] [40] [35] [30] [25] [20] [15] [10] [5] [0]><><><><{a..z} [a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]><><><><{a..z..2} [a] [c] [e] [g] [i] [k] [m] [o] [q] [s] [u] [w] [y]><><><><{z..a..-2} [z] [x] [v] [t] [r] [p] [n] [l] [j] [h] [f] [d] [b]><><><><{2147483645..2147483649} [2147483645] [2147483646] [2147483647] [2147483648] [2147483649]><><><><{10..0..2} [10] [8] [6] [4] [2] [0]><><><><{10..0..-2} [10] [8] [6] [4] [2] [0]><><><><{-50..-0..5} [-50] [-45] [-40] [-35] [-30] [-25] [-20] [-15] [-10] [-5] [0]><><><><{1..10.f} [{1..10.f}]><><><><{1..ff} [{1..ff}]><><><><{1..10..ff} [{1..10..ff}]><><><><{1.20..2} [{1.20..2}]><><><><{1..20..f2} [{1..20..f2}]><><><><{1..20..2f} [{1..20..2f}]><><><><{1..2f..2} [{1..2f..2}]><><><><{1..ff..2} [{1..ff..2}]><><><><{1..ff} [{1..ff}]><><><><{1..f} [{1..f}]><><><><{1..0f} [{1..0f}]><><><><{1..10f} [{1..10f}]><><><><{1..10.f} [{1..10.f}]><><><><{},b}.h [{},b}.h]><><><><><><><{}{},a}b [{}}b] [{}ab]><><><><{{},a}}b [{}}b] [a}b]><><><><{}{{},a}}b [{}{}}b] [{}a}b]><><><><{}a,b}c [{}a,b}c]><><><><{1..2..0} [1] [2]><><><>< juliangruber-brace-expansion-5efc551/test/cases.txt000066400000000000000000000054471516144122000225220ustar00rootroot00000000000000# skip quotes for now # "{x,x}" # {"x,x"} # {x","x} # '{a,b}{{a,b},a,b}' A{b,{d,e},{f,g}}Z PRE-{a,b}{{a,b},a,b}-POST \\{a,b}{{a,b},a,b} {{a,b} {a,b}} {,} a{,} {,}b a{,}b a{b}c a{1..5}b a{01..5}b a{-01..5}b a{-01..5..3}b a{001..9}b a{b,c{d,e},{f,g}h}x{y,z a{b,c{d,e},{f,g}h}x{y,z\\} a{b,c{d,e},{f,g}h}x{y,z} a{b{c{d,e}f{x,y{{g}h a{b{c{d,e}f{x,y{}g}h a{b{c{d,e}f{x,y}}g}h a{b{c{d,e}f}g}h a{{x,y},z}b f{x,y{g,z}}h f{x,y{{g,z}}h f{x,y{{g,z}}h} f{x,y{{g}h f{x,y{{g}}h f{x,y{}g}h z{a,b{,c}d z{a,b},c}d {-01..5} {-05..100..5} {-05..100} {0..5..2} {0001..05..2} {0001..-5..2} {0001..-5..-2} {0001..5..-2} {01..5} {1..05} {1..05..3} {05..100} {0a..0z} {a,b\\}c,d} {a,b{c,d} {a,b}c,d} {a..F} {A..f} {a..Z} {A..z} {z..A} {Z..a} {a..F..2} {A..f..02} {a..Z..5} d{a..Z..5}b {A..z..10} {z..A..-2} {Z..a..20} {a{,b} {a},b} {x,y{,}g} {x,y{}g} {{a,b} {{a,b},c} {{a,b}c} {{a,b},} X{{a,b},}X {{a,b},}c {{a,b}.} {{a,b}} X{a..#}X # this next one is an empty string {-10..00} # Need to escape slashes in here for reasons i guess. {a,\\\\{a,b}c} {a,\\{a,b}c} a,\\{b,c} {-10.\\.00} #### bash tests/braces.tests # Note that some tests are edited out because some features of # bash are intentionally not supported in this brace expander. ff{c,b,a} f{d,e,f}g {l,n,m}xyz {abc\\,def} {abc} {x\\,y,\\{abc\\},trie} # not impementing back-ticks obviously # XXXX\\{`echo a b c | tr ' ' ','`\\} {} # We only ever have to worry about parsing a single argument, # not a command line, so spaces have a different meaning than bash. # { } } { abcd{efgh # spaces # foo {1,2} bar # not impementing back-ticks obviously # `zecho foo {1,2} bar` # $(zecho foo {1,2} bar) # ${var} is not a variable here, like it is in bash. omit. # foo{bar,${var}.} # foo{bar,${var}} # isaacs: skip quotes for now # "${var}"{x,y} # $var{x,y} # ${var}{x,y} # new sequence brace operators {1..10} # this doesn't work yet {0..10,braces} # but this does {{0..10},braces} x{{0..10},braces}y {3..3} x{3..3}y {10..1} {10..1}y x{10..1}y {a..f} {f..a} {a..A} {A..a} {f..f} # mixes are incorrectly-formed brace expansions {1..f} {f..1} # spaces # 0{1..9} {10..20} # do negative numbers work? {-1..-10} {-20..0} # weirdly-formed brace expansions -- fixed in post-bash-3.1 a-{b{d,e}}-c a-{bdef-{g,i}-c # isaacs: skip quotes for now # {"klklkl"}{1,2,3} # isaacs: this is a valid test, though {klklkl}{1,2,3} # {"x,x"} {1..10..2} {-1..-10..2} {-1..-10..-2} {10..1..-2} {10..1..2} {1..20..2} {1..20..20} {100..0..5} {100..0..-5} {a..z} {a..z..2} {z..a..-2} # make sure brace expansion handles ints > 2**31 - 1 using intmax_t {2147483645..2147483649} # unwanted zero-padding -- fixed post-bash-4.0 {10..0..2} {10..0..-2} {-50..-0..5} # bad {1..10.f} {1..ff} {1..10..ff} {1.20..2} {1..20..f2} {1..20..2f} {1..2f..2} {1..ff..2} {1..ff} {1..f} {1..0f} {1..10f} {1..10.f} {},b}.h y{},a}x {}{},a}b {{},a}}b {}{{},a}}b {}a,b}c {1..2..0} juliangruber-brace-expansion-5efc551/test/dollar.js000066400000000000000000000010161516144122000224620ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('ignores ${', function(t) { t.deepEqual(expand('${1..3}'), ['${1..3}']); t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); t.deepEqual(expand('${a,b}${c,d}{e,f}'), ['${a,b}${c,d}e','${a,b}${c,d}f']); t.deepEqual(expand('{a,b}${c,d}${e,f}'), ['a${c,d}${e,f}','b${c,d}${e,f}']); t.deepEqual(expand('${a,b}${c,d}{1..3}'), ['${a,b}${c,d}1','${a,b}${c,d}2','${a,b}${c,d}3']); t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); t.end(); }); juliangruber-brace-expansion-5efc551/test/empty-option.js000066400000000000000000000002671516144122000236600ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('empty option', function(t) { t.deepEqual(expand('-v{,,,,}'), [ '-v', '-v', '-v', '-v', '-v' ]); t.end(); }); juliangruber-brace-expansion-5efc551/test/generate.sh000077500000000000000000000010321516144122000227760ustar00rootroot00000000000000#!/usr/bin/env bash set -e # Bash 4.3 because of arbitrary need to pick a single standard. if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then echo "this script requires bash 4.3" >&2 exit 1 fi CDPATH= cd "$(dirname "$0")" js='require("./")(process.argv[1]).join(" ")' cat cases.txt | \ while read case; do if [ "${case:0:1}" = "#" ]; then continue; fi; b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" echo "$case" echo -n "$b><><><><"; done > bash-results.txt juliangruber-brace-expansion-5efc551/test/negative-increment.js000066400000000000000000000007421516144122000247760ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('negative increment', function(t) { t.deepEqual(expand('{3..1}'), ['3', '2', '1']); t.deepEqual(expand('{10..8}'), ['10', '9', '8']); t.deepEqual(expand('{10..08}'), ['10', '09', '08']); t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); t.end(); }); juliangruber-brace-expansion-5efc551/test/nested.js000066400000000000000000000006141516144122000224720ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('nested', function(t) { t.deepEqual(expand('{a,b{1..3},c}'), [ 'a', 'b1', 'b2', 'b3', 'c' ]); t.deepEqual(expand('{{A..Z},{a..z}}'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') ); t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' ]); t.end(); }); juliangruber-brace-expansion-5efc551/test/order.js000066400000000000000000000002501516144122000223170ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('order', function(t) { t.deepEqual(expand('a{d,c,b}e'), [ 'ade', 'ace', 'abe' ]); t.end(); }); juliangruber-brace-expansion-5efc551/test/pad.js000066400000000000000000000003371516144122000217560ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('pad', function(t) { t.deepEqual(expand('{9..11}'), [ '9', '10', '11' ]); t.deepEqual(expand('{09..11}'), [ '09', '10', '11' ]); t.end(); }); juliangruber-brace-expansion-5efc551/test/perf/000077500000000000000000000000001516144122000216055ustar00rootroot00000000000000juliangruber-brace-expansion-5efc551/test/perf/bench.js000066400000000000000000000004171516144122000232240ustar00rootroot00000000000000'use strict'; var expand = require('../../'); var fs = require('fs'); var resfile = __dirname + '/../cases.txt'; var cases = fs.readFileSync(resfile, 'utf8').split('\n'); bench('Average', function() { cases.forEach(function(testcase) { expand(testcase); }); }); juliangruber-brace-expansion-5efc551/test/redos.js000066400000000000000000000006051516144122000223240ustar00rootroot00000000000000import test from 'node:test' import assert from 'assert' import expand from '../index.js' test('redos', function () { const str = '{a}' + ','.repeat(100000) + '\u0000' const startTime = performance.now() expand(str) const endTime = performance.now() const timeTaken = endTime - startTime assert.ok(timeTaken < 1000, `Expected time (${timeTaken}ms) to be less than 1000ms`) }) juliangruber-brace-expansion-5efc551/test/same-type.js000066400000000000000000000002401516144122000231070ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('x and y of same type', function(t) { t.deepEqual(expand('{a..9}'), ['{a..9}']); t.end(); }); juliangruber-brace-expansion-5efc551/test/sequence.js000066400000000000000000000020641516144122000230210ustar00rootroot00000000000000var test = require('tape'); var expand = require('..'); test('numeric sequences', function(t) { t.deepEqual(expand('a{1..2}b{2..3}c'), [ 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' ]); t.deepEqual(expand('{1..2}{2..3}'), [ '12', '13', '22', '23' ]); t.end(); }); test('numeric sequences with step count', function(t) { t.deepEqual(expand('{0..8..2}'), [ '0', '2', '4', '6', '8' ]); t.deepEqual(expand('{1..8..2}'), [ '1', '3', '5', '7' ]); t.end(); }); test('numeric sequence with negative x / y', function(t) { t.deepEqual(expand('{3..-2}'), [ '3', '2', '1', '0', '-1', '-2' ]); t.end(); }); test('alphabetic sequences', function(t) { t.deepEqual(expand('1{a..b}2{b..c}3'), [ '1a2b3', '1a2c3', '1b2b3', '1b2c3' ]); t.deepEqual(expand('{a..b}{b..c}'), [ 'ab', 'ac', 'bb', 'bc' ]); t.end(); }); test('alphabetic sequences with step count', function(t) { t.deepEqual(expand('{a..k..2}'), [ 'a', 'c', 'e', 'g', 'i', 'k' ]); t.deepEqual(expand('{b..k..2}'), [ 'b', 'd', 'f', 'h', 'j' ]); t.end(); });