decidim 0.27.3 → 0.27.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +16 -2
- data/babel.config.json +1 -4
- data/lib/decidim/release_manager.rb.new +43 -0
- data/lib/decidim/version.rb +1 -1
- data/package-lock.json +343 -255
- data/packages/browserslist-config/package.json +1 -1
- data/packages/core/node_modules/diff/CONTRIBUTING.md +39 -0
- data/packages/core/node_modules/diff/LICENSE +31 -0
- data/packages/core/node_modules/diff/README.md +211 -0
- data/packages/core/node_modules/diff/dist/diff.js +1627 -0
- data/packages/core/node_modules/diff/dist/diff.min.js +38 -0
- data/packages/core/node_modules/diff/lib/convert/dmp.js +32 -0
- data/packages/core/node_modules/diff/lib/convert/xml.js +42 -0
- data/packages/core/node_modules/diff/lib/diff/array.js +45 -0
- data/packages/core/node_modules/diff/lib/diff/base.js +307 -0
- data/packages/core/node_modules/diff/lib/diff/character.js +37 -0
- data/packages/core/node_modules/diff/lib/diff/css.js +41 -0
- data/packages/core/node_modules/diff/lib/diff/json.js +163 -0
- data/packages/core/node_modules/diff/lib/diff/line.js +89 -0
- data/packages/core/node_modules/diff/lib/diff/sentence.js +41 -0
- data/packages/core/node_modules/diff/lib/diff/word.js +108 -0
- data/packages/core/node_modules/diff/lib/index.es6.js +1561 -0
- data/packages/core/node_modules/diff/lib/index.js +216 -0
- data/packages/core/node_modules/diff/lib/index.mjs +1561 -0
- data/packages/core/node_modules/diff/lib/patch/apply.js +238 -0
- data/packages/core/node_modules/diff/lib/patch/create.js +272 -0
- data/packages/core/node_modules/diff/lib/patch/merge.js +613 -0
- data/packages/core/node_modules/diff/lib/patch/parse.js +167 -0
- data/packages/core/node_modules/diff/lib/util/array.js +32 -0
- data/packages/core/node_modules/diff/lib/util/distance-iterator.js +57 -0
- data/packages/core/node_modules/diff/lib/util/params.js +24 -0
- data/packages/core/node_modules/diff/package.json +87 -0
- data/packages/core/node_modules/diff/release-notes.md +309 -0
- data/packages/core/node_modules/diff/runtime.js +3 -0
- data/packages/core/package-lock.json +4889 -0
- data/packages/core/package.json +1 -1
- data/packages/dev/package.json +1 -1
- data/packages/elections/package.json +1 -1
- data/packages/eslint-config/package.json +1 -1
- data/packages/stylelint-config/package.json +1 -1
- data/packages/webpacker/node_modules/argparse/CHANGELOG.md +216 -0
- data/packages/webpacker/node_modules/argparse/LICENSE +254 -0
- data/packages/webpacker/node_modules/argparse/README.md +84 -0
- data/packages/webpacker/node_modules/argparse/argparse.js +3707 -0
- data/packages/webpacker/node_modules/argparse/lib/sub.js +67 -0
- data/packages/webpacker/node_modules/argparse/lib/textwrap.js +440 -0
- data/packages/webpacker/node_modules/argparse/package.json +31 -0
- data/packages/{core/node_modules/uuid/LICENSE.md → webpacker/node_modules/brace-expansion/LICENSE} +2 -2
- data/packages/webpacker/node_modules/brace-expansion/README.md +135 -0
- data/packages/webpacker/node_modules/brace-expansion/index.js +203 -0
- data/packages/webpacker/node_modules/brace-expansion/package.json +46 -0
- data/packages/webpacker/node_modules/glob/LICENSE +15 -0
- data/packages/webpacker/node_modules/glob/README.md +1214 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/package.json +4 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts +3 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js +270 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts +344 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js +238 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts +14 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js +27 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts +20 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js +103 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts +95 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js +68 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts +77 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js +219 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts +59 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js +309 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts +96 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js +358 -0
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts +344 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.js +234 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts +14 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js +23 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts +20 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js +99 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts +95 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/index.js +56 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/index.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/package.json +4 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts +77 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js +215 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts +59 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.js +302 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.js.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts +96 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts.map +1 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.js +352 -0
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.js.map +1 -0
- data/packages/webpacker/node_modules/glob/package.json +98 -0
- data/packages/webpacker/node_modules/js-yaml/CHANGELOG.md +616 -0
- data/packages/webpacker/node_modules/js-yaml/LICENSE +21 -0
- data/packages/webpacker/node_modules/js-yaml/README.md +246 -0
- data/packages/webpacker/node_modules/js-yaml/bin/js-yaml.js +126 -0
- data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.js +3874 -0
- data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.min.js +2 -0
- data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.mjs +3851 -0
- data/packages/webpacker/node_modules/js-yaml/index.js +47 -0
- data/packages/webpacker/node_modules/js-yaml/lib/common.js +59 -0
- data/packages/webpacker/node_modules/js-yaml/lib/dumper.js +965 -0
- data/packages/webpacker/node_modules/js-yaml/lib/exception.js +55 -0
- data/packages/webpacker/node_modules/js-yaml/lib/loader.js +1727 -0
- data/packages/webpacker/node_modules/js-yaml/lib/schema/core.js +11 -0
- data/packages/webpacker/node_modules/js-yaml/lib/schema/default.js +22 -0
- data/packages/webpacker/node_modules/js-yaml/lib/schema/failsafe.js +17 -0
- data/packages/webpacker/node_modules/js-yaml/lib/schema/json.js +19 -0
- data/packages/webpacker/node_modules/js-yaml/lib/schema.js +121 -0
- data/packages/webpacker/node_modules/js-yaml/lib/snippet.js +101 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/binary.js +125 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/bool.js +35 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/float.js +97 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/int.js +156 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/map.js +8 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/merge.js +12 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/null.js +35 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/omap.js +44 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/pairs.js +53 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/seq.js +8 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/set.js +29 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/str.js +8 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type/timestamp.js +88 -0
- data/packages/webpacker/node_modules/js-yaml/lib/type.js +66 -0
- data/packages/webpacker/node_modules/js-yaml/package.json +66 -0
- data/packages/webpacker/node_modules/minimatch/LICENSE +15 -0
- data/packages/webpacker/node_modules/minimatch/README.md +454 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts +2 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +14 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts +19 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js +589 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts +8 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js +152 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts +12 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js +22 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts +94 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js +1011 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/package.json +3 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts +17 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js +24 -0
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts +2 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +10 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts +19 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js +585 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts +8 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js +148 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts +12 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js +18 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts +94 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js +995 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/package.json +3 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts +17 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts.map +1 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js +20 -0
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js.map +1 -0
- data/packages/webpacker/node_modules/minimatch/package.json +86 -0
- data/packages/webpacker/package.json +2 -2
- metadata +237 -64
- data/packages/core/node_modules/uuid/AUTHORS +0 -5
- data/packages/core/node_modules/uuid/CHANGELOG.md +0 -119
- data/packages/core/node_modules/uuid/README.md +0 -276
- data/packages/core/node_modules/uuid/bin/uuid +0 -65
- data/packages/core/node_modules/uuid/index.js +0 -8
- data/packages/core/node_modules/uuid/lib/bytesToUuid.js +0 -26
- data/packages/core/node_modules/uuid/lib/md5-browser.js +0 -216
- data/packages/core/node_modules/uuid/lib/md5.js +0 -25
- data/packages/core/node_modules/uuid/lib/rng-browser.js +0 -34
- data/packages/core/node_modules/uuid/lib/rng.js +0 -8
- data/packages/core/node_modules/uuid/lib/sha1-browser.js +0 -89
- data/packages/core/node_modules/uuid/lib/sha1.js +0 -25
- data/packages/core/node_modules/uuid/lib/v35.js +0 -57
- data/packages/core/node_modules/uuid/package.json +0 -49
- data/packages/core/node_modules/uuid/v1.js +0 -109
- data/packages/core/node_modules/uuid/v3.js +0 -4
- data/packages/core/node_modules/uuid/v4.js +0 -29
- data/packages/core/node_modules/uuid/v5.js +0 -3
@@ -0,0 +1,203 @@
|
|
1
|
+
var balanced = require('balanced-match');
|
2
|
+
|
3
|
+
module.exports = expandTop;
|
4
|
+
|
5
|
+
var escSlash = '\0SLASH'+Math.random()+'\0';
|
6
|
+
var escOpen = '\0OPEN'+Math.random()+'\0';
|
7
|
+
var escClose = '\0CLOSE'+Math.random()+'\0';
|
8
|
+
var escComma = '\0COMMA'+Math.random()+'\0';
|
9
|
+
var escPeriod = '\0PERIOD'+Math.random()+'\0';
|
10
|
+
|
11
|
+
function numeric(str) {
|
12
|
+
return parseInt(str, 10) == str
|
13
|
+
? parseInt(str, 10)
|
14
|
+
: str.charCodeAt(0);
|
15
|
+
}
|
16
|
+
|
17
|
+
function escapeBraces(str) {
|
18
|
+
return str.split('\\\\').join(escSlash)
|
19
|
+
.split('\\{').join(escOpen)
|
20
|
+
.split('\\}').join(escClose)
|
21
|
+
.split('\\,').join(escComma)
|
22
|
+
.split('\\.').join(escPeriod);
|
23
|
+
}
|
24
|
+
|
25
|
+
function unescapeBraces(str) {
|
26
|
+
return str.split(escSlash).join('\\')
|
27
|
+
.split(escOpen).join('{')
|
28
|
+
.split(escClose).join('}')
|
29
|
+
.split(escComma).join(',')
|
30
|
+
.split(escPeriod).join('.');
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
// Basically just str.split(","), but handling cases
|
35
|
+
// where we have nested braced sections, which should be
|
36
|
+
// treated as individual members, like {a,{b,c},d}
|
37
|
+
function parseCommaParts(str) {
|
38
|
+
if (!str)
|
39
|
+
return [''];
|
40
|
+
|
41
|
+
var parts = [];
|
42
|
+
var m = balanced('{', '}', str);
|
43
|
+
|
44
|
+
if (!m)
|
45
|
+
return str.split(',');
|
46
|
+
|
47
|
+
var pre = m.pre;
|
48
|
+
var body = m.body;
|
49
|
+
var post = m.post;
|
50
|
+
var p = pre.split(',');
|
51
|
+
|
52
|
+
p[p.length-1] += '{' + body + '}';
|
53
|
+
var postParts = parseCommaParts(post);
|
54
|
+
if (post.length) {
|
55
|
+
p[p.length-1] += postParts.shift();
|
56
|
+
p.push.apply(p, postParts);
|
57
|
+
}
|
58
|
+
|
59
|
+
parts.push.apply(parts, p);
|
60
|
+
|
61
|
+
return parts;
|
62
|
+
}
|
63
|
+
|
64
|
+
function expandTop(str) {
|
65
|
+
if (!str)
|
66
|
+
return [];
|
67
|
+
|
68
|
+
// I don't know why Bash 4.3 does this, but it does.
|
69
|
+
// Anything starting with {} will have the first two bytes preserved
|
70
|
+
// but *only* at the top level, so {},a}b will not expand to anything,
|
71
|
+
// but a{},b}c will be expanded to [a}c,abc].
|
72
|
+
// One could argue that this is a bug in Bash, but since the goal of
|
73
|
+
// this module is to match Bash's rules, we escape a leading {}
|
74
|
+
if (str.substr(0, 2) === '{}') {
|
75
|
+
str = '\\{\\}' + str.substr(2);
|
76
|
+
}
|
77
|
+
|
78
|
+
return expand(escapeBraces(str), true).map(unescapeBraces);
|
79
|
+
}
|
80
|
+
|
81
|
+
function embrace(str) {
|
82
|
+
return '{' + str + '}';
|
83
|
+
}
|
84
|
+
function isPadded(el) {
|
85
|
+
return /^-?0\d/.test(el);
|
86
|
+
}
|
87
|
+
|
88
|
+
function lte(i, y) {
|
89
|
+
return i <= y;
|
90
|
+
}
|
91
|
+
function gte(i, y) {
|
92
|
+
return i >= y;
|
93
|
+
}
|
94
|
+
|
95
|
+
function expand(str, isTop) {
|
96
|
+
var expansions = [];
|
97
|
+
|
98
|
+
var m = balanced('{', '}', str);
|
99
|
+
if (!m) return [str];
|
100
|
+
|
101
|
+
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
102
|
+
var pre = m.pre;
|
103
|
+
var post = m.post.length
|
104
|
+
? expand(m.post, false)
|
105
|
+
: [''];
|
106
|
+
|
107
|
+
if (/\$$/.test(m.pre)) {
|
108
|
+
for (var k = 0; k < post.length; k++) {
|
109
|
+
var expansion = pre+ '{' + m.body + '}' + post[k];
|
110
|
+
expansions.push(expansion);
|
111
|
+
}
|
112
|
+
} else {
|
113
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
114
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
115
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
116
|
+
var isOptions = m.body.indexOf(',') >= 0;
|
117
|
+
if (!isSequence && !isOptions) {
|
118
|
+
// {a},b}
|
119
|
+
if (m.post.match(/,.*\}/)) {
|
120
|
+
str = m.pre + '{' + m.body + escClose + m.post;
|
121
|
+
return expand(str);
|
122
|
+
}
|
123
|
+
return [str];
|
124
|
+
}
|
125
|
+
|
126
|
+
var n;
|
127
|
+
if (isSequence) {
|
128
|
+
n = m.body.split(/\.\./);
|
129
|
+
} else {
|
130
|
+
n = parseCommaParts(m.body);
|
131
|
+
if (n.length === 1) {
|
132
|
+
// x{{a,b}}y ==> x{a}y x{b}y
|
133
|
+
n = expand(n[0], false).map(embrace);
|
134
|
+
if (n.length === 1) {
|
135
|
+
return post.map(function(p) {
|
136
|
+
return m.pre + n[0] + p;
|
137
|
+
});
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
// at this point, n is the parts, and we know it's not a comma set
|
143
|
+
// with a single entry.
|
144
|
+
var N;
|
145
|
+
|
146
|
+
if (isSequence) {
|
147
|
+
var x = numeric(n[0]);
|
148
|
+
var y = numeric(n[1]);
|
149
|
+
var width = Math.max(n[0].length, n[1].length)
|
150
|
+
var incr = n.length == 3
|
151
|
+
? Math.abs(numeric(n[2]))
|
152
|
+
: 1;
|
153
|
+
var test = lte;
|
154
|
+
var reverse = y < x;
|
155
|
+
if (reverse) {
|
156
|
+
incr *= -1;
|
157
|
+
test = gte;
|
158
|
+
}
|
159
|
+
var pad = n.some(isPadded);
|
160
|
+
|
161
|
+
N = [];
|
162
|
+
|
163
|
+
for (var i = x; test(i, y); i += incr) {
|
164
|
+
var c;
|
165
|
+
if (isAlphaSequence) {
|
166
|
+
c = String.fromCharCode(i);
|
167
|
+
if (c === '\\')
|
168
|
+
c = '';
|
169
|
+
} else {
|
170
|
+
c = String(i);
|
171
|
+
if (pad) {
|
172
|
+
var need = width - c.length;
|
173
|
+
if (need > 0) {
|
174
|
+
var z = new Array(need + 1).join('0');
|
175
|
+
if (i < 0)
|
176
|
+
c = '-' + z + c.slice(1);
|
177
|
+
else
|
178
|
+
c = z + c;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}
|
182
|
+
N.push(c);
|
183
|
+
}
|
184
|
+
} else {
|
185
|
+
N = [];
|
186
|
+
|
187
|
+
for (var j = 0; j < n.length; j++) {
|
188
|
+
N.push.apply(N, expand(n[j], false));
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
for (var j = 0; j < N.length; j++) {
|
193
|
+
for (var k = 0; k < post.length; k++) {
|
194
|
+
var expansion = pre + N[j] + post[k];
|
195
|
+
if (!isTop || isSequence || expansion)
|
196
|
+
expansions.push(expansion);
|
197
|
+
}
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
return expansions;
|
202
|
+
}
|
203
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
{
|
2
|
+
"name": "brace-expansion",
|
3
|
+
"description": "Brace expansion as known from sh/bash",
|
4
|
+
"version": "2.0.1",
|
5
|
+
"repository": {
|
6
|
+
"type": "git",
|
7
|
+
"url": "git://github.com/juliangruber/brace-expansion.git"
|
8
|
+
},
|
9
|
+
"homepage": "https://github.com/juliangruber/brace-expansion",
|
10
|
+
"main": "index.js",
|
11
|
+
"scripts": {
|
12
|
+
"test": "tape test/*.js",
|
13
|
+
"gentest": "bash test/generate.sh",
|
14
|
+
"bench": "matcha test/perf/bench.js"
|
15
|
+
},
|
16
|
+
"dependencies": {
|
17
|
+
"balanced-match": "^1.0.0"
|
18
|
+
},
|
19
|
+
"devDependencies": {
|
20
|
+
"@c4312/matcha": "^1.3.1",
|
21
|
+
"tape": "^4.6.0"
|
22
|
+
},
|
23
|
+
"keywords": [],
|
24
|
+
"author": {
|
25
|
+
"name": "Julian Gruber",
|
26
|
+
"email": "mail@juliangruber.com",
|
27
|
+
"url": "http://juliangruber.com"
|
28
|
+
},
|
29
|
+
"license": "MIT",
|
30
|
+
"testling": {
|
31
|
+
"files": "test/*.js",
|
32
|
+
"browsers": [
|
33
|
+
"ie/8..latest",
|
34
|
+
"firefox/20..latest",
|
35
|
+
"firefox/nightly",
|
36
|
+
"chrome/25..latest",
|
37
|
+
"chrome/canary",
|
38
|
+
"opera/12..latest",
|
39
|
+
"opera/next",
|
40
|
+
"safari/5.1..latest",
|
41
|
+
"ipad/6.0..latest",
|
42
|
+
"iphone/6.0..latest",
|
43
|
+
"android-browser/4.2..latest"
|
44
|
+
]
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
The ISC License
|
2
|
+
|
3
|
+
Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors
|
4
|
+
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|