brace-expansion 1.0.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +3 -2
- package/README.md +7 -1
- package/index.js +9 -8
- package/package.json +4 -4
- package/.travis.yml +0 -4
- package/test/bash-comparison.js +0 -29
- package/test/bash-results.txt +0 -705
- package/test/cases.txt +0 -86
- package/test/dollar.js +0 -9
- package/test/empty-option.js +0 -10
- package/test/generate.sh +0 -24
- package/test/negative-increment.js +0 -15
- package/test/nested.js +0 -16
- package/test/order.js +0 -10
- package/test/pad.js +0 -13
- package/test/same-type.js +0 -7
- package/test/sequence.js +0 -50
package/.npmignore
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
test
|
|
2
|
+
.gitignore
|
|
3
|
+
.travis.yml
|
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
|
|
4
4
|
as known from sh/bash, in JavaScript.
|
|
5
5
|
|
|
6
|
-
[](http://travis-ci.org/juliangruber/brace-expansion)
|
|
7
|
+
[](https://www.npmjs.org/package/brace-expansion)
|
|
7
8
|
|
|
8
9
|
[](https://ci.testling.com/juliangruber/brace-expansion)
|
|
9
10
|
|
|
@@ -91,6 +92,11 @@ With [npm](https://npmjs.org) do:
|
|
|
91
92
|
npm install brace-expansion
|
|
92
93
|
```
|
|
93
94
|
|
|
95
|
+
## Contributors
|
|
96
|
+
|
|
97
|
+
- [Julian Gruber](https://github.com/juliangruber)
|
|
98
|
+
- [Isaac Z. Schlueter](https://github.com/isaacs)
|
|
99
|
+
|
|
94
100
|
## License
|
|
95
101
|
|
|
96
102
|
(MIT)
|
package/index.js
CHANGED
|
@@ -66,8 +66,7 @@ function expandTop(str) {
|
|
|
66
66
|
if (!str)
|
|
67
67
|
return [];
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
return expansions.filter(identity).map(unescapeBraces);
|
|
69
|
+
return expand(escapeBraces(str), true).map(unescapeBraces);
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
function identity(e) {
|
|
@@ -88,7 +87,7 @@ function gte(i, y) {
|
|
|
88
87
|
return i >= y;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
|
-
function expand(str) {
|
|
90
|
+
function expand(str, isTop) {
|
|
92
91
|
var expansions = [];
|
|
93
92
|
|
|
94
93
|
var m = balanced('{', '}', str);
|
|
@@ -114,10 +113,10 @@ function expand(str) {
|
|
|
114
113
|
n = parseCommaParts(m.body);
|
|
115
114
|
if (n.length === 1) {
|
|
116
115
|
// x{{a,b}}y ==> x{a}y x{b}y
|
|
117
|
-
n = expand(n[0]).map(embrace);
|
|
116
|
+
n = expand(n[0], false).map(embrace);
|
|
118
117
|
if (n.length === 1) {
|
|
119
118
|
var post = m.post.length
|
|
120
|
-
? expand(m.post)
|
|
119
|
+
? expand(m.post, false)
|
|
121
120
|
: [''];
|
|
122
121
|
return post.map(function(p) {
|
|
123
122
|
return m.pre + n[0] + p;
|
|
@@ -132,7 +131,7 @@ function expand(str) {
|
|
|
132
131
|
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
|
133
132
|
var pre = m.pre;
|
|
134
133
|
var post = m.post.length
|
|
135
|
-
? expand(m.post)
|
|
134
|
+
? expand(m.post, false)
|
|
136
135
|
: [''];
|
|
137
136
|
|
|
138
137
|
var N;
|
|
@@ -176,12 +175,14 @@ function expand(str) {
|
|
|
176
175
|
N.push(c);
|
|
177
176
|
}
|
|
178
177
|
} else {
|
|
179
|
-
N = concatMap(n, function(el) { return expand(el) });
|
|
178
|
+
N = concatMap(n, function(el) { return expand(el, false) });
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
for (var j = 0; j < N.length; j++) {
|
|
183
182
|
for (var k = 0; k < post.length; k++) {
|
|
184
|
-
|
|
183
|
+
var expansion = pre + N[j] + post[k];
|
|
184
|
+
if (!isTop || isSequence || expansion)
|
|
185
|
+
expansions.push(expansion);
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brace-expansion",
|
|
3
3
|
"description": "Brace expansion as known from sh/bash",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git://github.com/juliangruber/brace-expansion.git"
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"gentest": "bash test/generate.sh"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"balanced-match": "^0.
|
|
17
|
-
"concat-map": "0.0.
|
|
16
|
+
"balanced-match": "^0.3.0",
|
|
17
|
+
"concat-map": "0.0.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"tape": "
|
|
20
|
+
"tape": "4.2.2"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [],
|
|
23
23
|
"author": {
|
package/.travis.yml
DELETED
package/test/bash-comparison.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var test = require('tape');
|
|
2
|
-
var expand = require('..');
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
var resfile = __dirname + '/bash-results.txt';
|
|
5
|
-
var cases = fs.readFileSync(resfile, 'utf8').split('><><><><');
|
|
6
|
-
|
|
7
|
-
// throw away the EOF marker
|
|
8
|
-
cases.pop()
|
|
9
|
-
|
|
10
|
-
test('matches bash expansions', function(t) {
|
|
11
|
-
cases.forEach(function(testcase) {
|
|
12
|
-
var set = testcase.split('\n');
|
|
13
|
-
var pattern = set.shift();
|
|
14
|
-
var actual = expand(pattern);
|
|
15
|
-
|
|
16
|
-
// If it expands to the empty string, then it's actually
|
|
17
|
-
// just nothing, but Bash is a singly typed language, so
|
|
18
|
-
// "nothing" is the same as "". Bash doesn't include them
|
|
19
|
-
// $ for i in {a,,,b}; do echo $i; done
|
|
20
|
-
// a
|
|
21
|
-
// b
|
|
22
|
-
set = set.filter(function(s) {
|
|
23
|
-
return s;
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
t.same(actual, set, pattern);
|
|
27
|
-
});
|
|
28
|
-
t.end();
|
|
29
|
-
})
|
package/test/bash-results.txt
DELETED
|
@@ -1,705 +0,0 @@
|
|
|
1
|
-
A{b,{d,e},{f,g}}Z
|
|
2
|
-
AbZ
|
|
3
|
-
AdZ
|
|
4
|
-
AeZ
|
|
5
|
-
AfZ
|
|
6
|
-
AgZ><><><><PRE-{a,b}{{a,b},a,b}-POST
|
|
7
|
-
PRE-aa-POST
|
|
8
|
-
PRE-ab-POST
|
|
9
|
-
PRE-aa-POST
|
|
10
|
-
PRE-ab-POST
|
|
11
|
-
PRE-ba-POST
|
|
12
|
-
PRE-bb-POST
|
|
13
|
-
PRE-ba-POST
|
|
14
|
-
PRE-bb-POST><><><><{a,b}{{a,b},a,b}
|
|
15
|
-
aa
|
|
16
|
-
ab
|
|
17
|
-
aa
|
|
18
|
-
ab
|
|
19
|
-
ba
|
|
20
|
-
bb
|
|
21
|
-
ba
|
|
22
|
-
bb><><><><{{a,b}
|
|
23
|
-
{a
|
|
24
|
-
{b><><><><{a,b}}
|
|
25
|
-
a}
|
|
26
|
-
b}><><><><{,}
|
|
27
|
-
><><><><a{,}
|
|
28
|
-
a
|
|
29
|
-
a><><><><{,}b
|
|
30
|
-
b
|
|
31
|
-
b><><><><a{,}b
|
|
32
|
-
ab
|
|
33
|
-
ab><><><><a{b}c
|
|
34
|
-
a{b}c><><><><a{1..5}b
|
|
35
|
-
a1b
|
|
36
|
-
a2b
|
|
37
|
-
a3b
|
|
38
|
-
a4b
|
|
39
|
-
a5b><><><><a{01..5}b
|
|
40
|
-
a01b
|
|
41
|
-
a02b
|
|
42
|
-
a03b
|
|
43
|
-
a04b
|
|
44
|
-
a05b><><><><a{-01..5}b
|
|
45
|
-
a-01b
|
|
46
|
-
a000b
|
|
47
|
-
a001b
|
|
48
|
-
a002b
|
|
49
|
-
a003b
|
|
50
|
-
a004b
|
|
51
|
-
a005b><><><><a{-01..5..3}b
|
|
52
|
-
a-01b
|
|
53
|
-
a002b
|
|
54
|
-
a005b><><><><a{001..9}b
|
|
55
|
-
a001b
|
|
56
|
-
a002b
|
|
57
|
-
a003b
|
|
58
|
-
a004b
|
|
59
|
-
a005b
|
|
60
|
-
a006b
|
|
61
|
-
a007b
|
|
62
|
-
a008b
|
|
63
|
-
a009b><><><><a{b,c{d,e},{f,g}h}x{y,z
|
|
64
|
-
abx{y,z
|
|
65
|
-
acdx{y,z
|
|
66
|
-
acex{y,z
|
|
67
|
-
afhx{y,z
|
|
68
|
-
aghx{y,z><><><><a{b,c{d,e},{f,g}h}x{y,z}
|
|
69
|
-
abxy
|
|
70
|
-
abxz
|
|
71
|
-
acdxy
|
|
72
|
-
acdxz
|
|
73
|
-
acexy
|
|
74
|
-
acexz
|
|
75
|
-
afhxy
|
|
76
|
-
afhxz
|
|
77
|
-
aghxy
|
|
78
|
-
aghxz><><><><a{b,c{d,e},{f,g}h}x{y,z}
|
|
79
|
-
abxy
|
|
80
|
-
abxz
|
|
81
|
-
acdxy
|
|
82
|
-
acdxz
|
|
83
|
-
acexy
|
|
84
|
-
acexz
|
|
85
|
-
afhxy
|
|
86
|
-
afhxz
|
|
87
|
-
aghxy
|
|
88
|
-
aghxz><><><><a{b{c{d,e}f{x,y{{g}h
|
|
89
|
-
a{b{cdf{x,y{{g}h
|
|
90
|
-
a{b{cef{x,y{{g}h><><><><a{b{c{d,e}f{x,y{}g}h
|
|
91
|
-
a{b{cdfxh
|
|
92
|
-
a{b{cdfy{}gh
|
|
93
|
-
a{b{cefxh
|
|
94
|
-
a{b{cefy{}gh><><><><a{b{c{d,e}f{x,y}}g}h
|
|
95
|
-
a{b{cdfx}g}h
|
|
96
|
-
a{b{cdfy}g}h
|
|
97
|
-
a{b{cefx}g}h
|
|
98
|
-
a{b{cefy}g}h><><><><a{b{c{d,e}f}g}h
|
|
99
|
-
a{b{cdf}g}h
|
|
100
|
-
a{b{cef}g}h><><><><a{{x,y},z}b
|
|
101
|
-
axb
|
|
102
|
-
ayb
|
|
103
|
-
azb><><><><f{x,y{g,z}}h
|
|
104
|
-
fxh
|
|
105
|
-
fygh
|
|
106
|
-
fyzh><><><><f{x,y{{g,z}}h
|
|
107
|
-
f{x,y{g}h
|
|
108
|
-
f{x,y{z}h><><><><f{x,y{{g,z}}h}
|
|
109
|
-
fx
|
|
110
|
-
fy{g}h
|
|
111
|
-
fy{z}h><><><><f{x,y{{g}h
|
|
112
|
-
f{x,y{{g}h><><><><f{x,y{{g}}h
|
|
113
|
-
f{x,y{{g}}h><><><><f{x,y{}g}h
|
|
114
|
-
fxh
|
|
115
|
-
fy{}gh><><><><z{a,b{,c}d
|
|
116
|
-
z{a,bd
|
|
117
|
-
z{a,bcd><><><><z{a,b},c}d
|
|
118
|
-
za,c}d
|
|
119
|
-
zb,c}d><><><><{-01..5}
|
|
120
|
-
-01
|
|
121
|
-
000
|
|
122
|
-
001
|
|
123
|
-
002
|
|
124
|
-
003
|
|
125
|
-
004
|
|
126
|
-
005><><><><{-05..100..5}
|
|
127
|
-
-05
|
|
128
|
-
000
|
|
129
|
-
005
|
|
130
|
-
010
|
|
131
|
-
015
|
|
132
|
-
020
|
|
133
|
-
025
|
|
134
|
-
030
|
|
135
|
-
035
|
|
136
|
-
040
|
|
137
|
-
045
|
|
138
|
-
050
|
|
139
|
-
055
|
|
140
|
-
060
|
|
141
|
-
065
|
|
142
|
-
070
|
|
143
|
-
075
|
|
144
|
-
080
|
|
145
|
-
085
|
|
146
|
-
090
|
|
147
|
-
095
|
|
148
|
-
100><><><><{-05..100}
|
|
149
|
-
-05
|
|
150
|
-
-04
|
|
151
|
-
-03
|
|
152
|
-
-02
|
|
153
|
-
-01
|
|
154
|
-
000
|
|
155
|
-
001
|
|
156
|
-
002
|
|
157
|
-
003
|
|
158
|
-
004
|
|
159
|
-
005
|
|
160
|
-
006
|
|
161
|
-
007
|
|
162
|
-
008
|
|
163
|
-
009
|
|
164
|
-
010
|
|
165
|
-
011
|
|
166
|
-
012
|
|
167
|
-
013
|
|
168
|
-
014
|
|
169
|
-
015
|
|
170
|
-
016
|
|
171
|
-
017
|
|
172
|
-
018
|
|
173
|
-
019
|
|
174
|
-
020
|
|
175
|
-
021
|
|
176
|
-
022
|
|
177
|
-
023
|
|
178
|
-
024
|
|
179
|
-
025
|
|
180
|
-
026
|
|
181
|
-
027
|
|
182
|
-
028
|
|
183
|
-
029
|
|
184
|
-
030
|
|
185
|
-
031
|
|
186
|
-
032
|
|
187
|
-
033
|
|
188
|
-
034
|
|
189
|
-
035
|
|
190
|
-
036
|
|
191
|
-
037
|
|
192
|
-
038
|
|
193
|
-
039
|
|
194
|
-
040
|
|
195
|
-
041
|
|
196
|
-
042
|
|
197
|
-
043
|
|
198
|
-
044
|
|
199
|
-
045
|
|
200
|
-
046
|
|
201
|
-
047
|
|
202
|
-
048
|
|
203
|
-
049
|
|
204
|
-
050
|
|
205
|
-
051
|
|
206
|
-
052
|
|
207
|
-
053
|
|
208
|
-
054
|
|
209
|
-
055
|
|
210
|
-
056
|
|
211
|
-
057
|
|
212
|
-
058
|
|
213
|
-
059
|
|
214
|
-
060
|
|
215
|
-
061
|
|
216
|
-
062
|
|
217
|
-
063
|
|
218
|
-
064
|
|
219
|
-
065
|
|
220
|
-
066
|
|
221
|
-
067
|
|
222
|
-
068
|
|
223
|
-
069
|
|
224
|
-
070
|
|
225
|
-
071
|
|
226
|
-
072
|
|
227
|
-
073
|
|
228
|
-
074
|
|
229
|
-
075
|
|
230
|
-
076
|
|
231
|
-
077
|
|
232
|
-
078
|
|
233
|
-
079
|
|
234
|
-
080
|
|
235
|
-
081
|
|
236
|
-
082
|
|
237
|
-
083
|
|
238
|
-
084
|
|
239
|
-
085
|
|
240
|
-
086
|
|
241
|
-
087
|
|
242
|
-
088
|
|
243
|
-
089
|
|
244
|
-
090
|
|
245
|
-
091
|
|
246
|
-
092
|
|
247
|
-
093
|
|
248
|
-
094
|
|
249
|
-
095
|
|
250
|
-
096
|
|
251
|
-
097
|
|
252
|
-
098
|
|
253
|
-
099
|
|
254
|
-
100><><><><{0..5..2}
|
|
255
|
-
0
|
|
256
|
-
2
|
|
257
|
-
4><><><><{0001..05..2}
|
|
258
|
-
0001
|
|
259
|
-
0003
|
|
260
|
-
0005><><><><{0001..-5..2}
|
|
261
|
-
0001
|
|
262
|
-
-001
|
|
263
|
-
-003
|
|
264
|
-
-005><><><><{0001..-5..-2}
|
|
265
|
-
0001
|
|
266
|
-
-001
|
|
267
|
-
-003
|
|
268
|
-
-005><><><><{0001..5..-2}
|
|
269
|
-
0001
|
|
270
|
-
0003
|
|
271
|
-
0005><><><><{01..5}
|
|
272
|
-
01
|
|
273
|
-
02
|
|
274
|
-
03
|
|
275
|
-
04
|
|
276
|
-
05><><><><{1..05}
|
|
277
|
-
01
|
|
278
|
-
02
|
|
279
|
-
03
|
|
280
|
-
04
|
|
281
|
-
05><><><><{1..05..3}
|
|
282
|
-
01
|
|
283
|
-
04><><><><{05..100}
|
|
284
|
-
005
|
|
285
|
-
006
|
|
286
|
-
007
|
|
287
|
-
008
|
|
288
|
-
009
|
|
289
|
-
010
|
|
290
|
-
011
|
|
291
|
-
012
|
|
292
|
-
013
|
|
293
|
-
014
|
|
294
|
-
015
|
|
295
|
-
016
|
|
296
|
-
017
|
|
297
|
-
018
|
|
298
|
-
019
|
|
299
|
-
020
|
|
300
|
-
021
|
|
301
|
-
022
|
|
302
|
-
023
|
|
303
|
-
024
|
|
304
|
-
025
|
|
305
|
-
026
|
|
306
|
-
027
|
|
307
|
-
028
|
|
308
|
-
029
|
|
309
|
-
030
|
|
310
|
-
031
|
|
311
|
-
032
|
|
312
|
-
033
|
|
313
|
-
034
|
|
314
|
-
035
|
|
315
|
-
036
|
|
316
|
-
037
|
|
317
|
-
038
|
|
318
|
-
039
|
|
319
|
-
040
|
|
320
|
-
041
|
|
321
|
-
042
|
|
322
|
-
043
|
|
323
|
-
044
|
|
324
|
-
045
|
|
325
|
-
046
|
|
326
|
-
047
|
|
327
|
-
048
|
|
328
|
-
049
|
|
329
|
-
050
|
|
330
|
-
051
|
|
331
|
-
052
|
|
332
|
-
053
|
|
333
|
-
054
|
|
334
|
-
055
|
|
335
|
-
056
|
|
336
|
-
057
|
|
337
|
-
058
|
|
338
|
-
059
|
|
339
|
-
060
|
|
340
|
-
061
|
|
341
|
-
062
|
|
342
|
-
063
|
|
343
|
-
064
|
|
344
|
-
065
|
|
345
|
-
066
|
|
346
|
-
067
|
|
347
|
-
068
|
|
348
|
-
069
|
|
349
|
-
070
|
|
350
|
-
071
|
|
351
|
-
072
|
|
352
|
-
073
|
|
353
|
-
074
|
|
354
|
-
075
|
|
355
|
-
076
|
|
356
|
-
077
|
|
357
|
-
078
|
|
358
|
-
079
|
|
359
|
-
080
|
|
360
|
-
081
|
|
361
|
-
082
|
|
362
|
-
083
|
|
363
|
-
084
|
|
364
|
-
085
|
|
365
|
-
086
|
|
366
|
-
087
|
|
367
|
-
088
|
|
368
|
-
089
|
|
369
|
-
090
|
|
370
|
-
091
|
|
371
|
-
092
|
|
372
|
-
093
|
|
373
|
-
094
|
|
374
|
-
095
|
|
375
|
-
096
|
|
376
|
-
097
|
|
377
|
-
098
|
|
378
|
-
099
|
|
379
|
-
100><><><><{0a..0z}
|
|
380
|
-
{0a..0z}><><><><{a,b}c,d}
|
|
381
|
-
ac,d}
|
|
382
|
-
bc,d}><><><><{a,b{c,d}
|
|
383
|
-
{a,bc
|
|
384
|
-
{a,bd><><><><{a,b}c,d}
|
|
385
|
-
ac,d}
|
|
386
|
-
bc,d}><><><><{a..F}
|
|
387
|
-
a
|
|
388
|
-
`
|
|
389
|
-
_
|
|
390
|
-
^
|
|
391
|
-
]
|
|
392
|
-
|
|
393
|
-
[
|
|
394
|
-
Z
|
|
395
|
-
Y
|
|
396
|
-
X
|
|
397
|
-
W
|
|
398
|
-
V
|
|
399
|
-
U
|
|
400
|
-
T
|
|
401
|
-
S
|
|
402
|
-
R
|
|
403
|
-
Q
|
|
404
|
-
P
|
|
405
|
-
O
|
|
406
|
-
N
|
|
407
|
-
M
|
|
408
|
-
L
|
|
409
|
-
K
|
|
410
|
-
J
|
|
411
|
-
I
|
|
412
|
-
H
|
|
413
|
-
G
|
|
414
|
-
F><><><><{A..f}
|
|
415
|
-
A
|
|
416
|
-
B
|
|
417
|
-
C
|
|
418
|
-
D
|
|
419
|
-
E
|
|
420
|
-
F
|
|
421
|
-
G
|
|
422
|
-
H
|
|
423
|
-
I
|
|
424
|
-
J
|
|
425
|
-
K
|
|
426
|
-
L
|
|
427
|
-
M
|
|
428
|
-
N
|
|
429
|
-
O
|
|
430
|
-
P
|
|
431
|
-
Q
|
|
432
|
-
R
|
|
433
|
-
S
|
|
434
|
-
T
|
|
435
|
-
U
|
|
436
|
-
V
|
|
437
|
-
W
|
|
438
|
-
X
|
|
439
|
-
Y
|
|
440
|
-
Z
|
|
441
|
-
[
|
|
442
|
-
|
|
443
|
-
]
|
|
444
|
-
^
|
|
445
|
-
_
|
|
446
|
-
`
|
|
447
|
-
a
|
|
448
|
-
b
|
|
449
|
-
c
|
|
450
|
-
d
|
|
451
|
-
e
|
|
452
|
-
f><><><><{a..Z}
|
|
453
|
-
a
|
|
454
|
-
`
|
|
455
|
-
_
|
|
456
|
-
^
|
|
457
|
-
]
|
|
458
|
-
|
|
459
|
-
[
|
|
460
|
-
Z><><><><{A..z}
|
|
461
|
-
A
|
|
462
|
-
B
|
|
463
|
-
C
|
|
464
|
-
D
|
|
465
|
-
E
|
|
466
|
-
F
|
|
467
|
-
G
|
|
468
|
-
H
|
|
469
|
-
I
|
|
470
|
-
J
|
|
471
|
-
K
|
|
472
|
-
L
|
|
473
|
-
M
|
|
474
|
-
N
|
|
475
|
-
O
|
|
476
|
-
P
|
|
477
|
-
Q
|
|
478
|
-
R
|
|
479
|
-
S
|
|
480
|
-
T
|
|
481
|
-
U
|
|
482
|
-
V
|
|
483
|
-
W
|
|
484
|
-
X
|
|
485
|
-
Y
|
|
486
|
-
Z
|
|
487
|
-
[
|
|
488
|
-
|
|
489
|
-
]
|
|
490
|
-
^
|
|
491
|
-
_
|
|
492
|
-
`
|
|
493
|
-
a
|
|
494
|
-
b
|
|
495
|
-
c
|
|
496
|
-
d
|
|
497
|
-
e
|
|
498
|
-
f
|
|
499
|
-
g
|
|
500
|
-
h
|
|
501
|
-
i
|
|
502
|
-
j
|
|
503
|
-
k
|
|
504
|
-
l
|
|
505
|
-
m
|
|
506
|
-
n
|
|
507
|
-
o
|
|
508
|
-
p
|
|
509
|
-
q
|
|
510
|
-
r
|
|
511
|
-
s
|
|
512
|
-
t
|
|
513
|
-
u
|
|
514
|
-
v
|
|
515
|
-
w
|
|
516
|
-
x
|
|
517
|
-
y
|
|
518
|
-
z><><><><{z..A}
|
|
519
|
-
z
|
|
520
|
-
y
|
|
521
|
-
x
|
|
522
|
-
w
|
|
523
|
-
v
|
|
524
|
-
u
|
|
525
|
-
t
|
|
526
|
-
s
|
|
527
|
-
r
|
|
528
|
-
q
|
|
529
|
-
p
|
|
530
|
-
o
|
|
531
|
-
n
|
|
532
|
-
m
|
|
533
|
-
l
|
|
534
|
-
k
|
|
535
|
-
j
|
|
536
|
-
i
|
|
537
|
-
h
|
|
538
|
-
g
|
|
539
|
-
f
|
|
540
|
-
e
|
|
541
|
-
d
|
|
542
|
-
c
|
|
543
|
-
b
|
|
544
|
-
a
|
|
545
|
-
`
|
|
546
|
-
_
|
|
547
|
-
^
|
|
548
|
-
]
|
|
549
|
-
|
|
550
|
-
[
|
|
551
|
-
Z
|
|
552
|
-
Y
|
|
553
|
-
X
|
|
554
|
-
W
|
|
555
|
-
V
|
|
556
|
-
U
|
|
557
|
-
T
|
|
558
|
-
S
|
|
559
|
-
R
|
|
560
|
-
Q
|
|
561
|
-
P
|
|
562
|
-
O
|
|
563
|
-
N
|
|
564
|
-
M
|
|
565
|
-
L
|
|
566
|
-
K
|
|
567
|
-
J
|
|
568
|
-
I
|
|
569
|
-
H
|
|
570
|
-
G
|
|
571
|
-
F
|
|
572
|
-
E
|
|
573
|
-
D
|
|
574
|
-
C
|
|
575
|
-
B
|
|
576
|
-
A><><><><{Z..a}
|
|
577
|
-
Z
|
|
578
|
-
[
|
|
579
|
-
|
|
580
|
-
]
|
|
581
|
-
^
|
|
582
|
-
_
|
|
583
|
-
`
|
|
584
|
-
a><><><><{a..F..2}
|
|
585
|
-
a
|
|
586
|
-
_
|
|
587
|
-
]
|
|
588
|
-
[
|
|
589
|
-
Y
|
|
590
|
-
W
|
|
591
|
-
U
|
|
592
|
-
S
|
|
593
|
-
Q
|
|
594
|
-
O
|
|
595
|
-
M
|
|
596
|
-
K
|
|
597
|
-
I
|
|
598
|
-
G><><><><{A..f..02}
|
|
599
|
-
A
|
|
600
|
-
C
|
|
601
|
-
E
|
|
602
|
-
G
|
|
603
|
-
I
|
|
604
|
-
K
|
|
605
|
-
M
|
|
606
|
-
O
|
|
607
|
-
Q
|
|
608
|
-
S
|
|
609
|
-
U
|
|
610
|
-
W
|
|
611
|
-
Y
|
|
612
|
-
[
|
|
613
|
-
]
|
|
614
|
-
_
|
|
615
|
-
a
|
|
616
|
-
c
|
|
617
|
-
e><><><><{a..Z..5}
|
|
618
|
-
a><><><><d{a..Z..5}b
|
|
619
|
-
dab
|
|
620
|
-
db><><><><{A..z..10}
|
|
621
|
-
A
|
|
622
|
-
K
|
|
623
|
-
U
|
|
624
|
-
_
|
|
625
|
-
i
|
|
626
|
-
s><><><><{z..A..-2}
|
|
627
|
-
z
|
|
628
|
-
x
|
|
629
|
-
v
|
|
630
|
-
t
|
|
631
|
-
r
|
|
632
|
-
p
|
|
633
|
-
n
|
|
634
|
-
l
|
|
635
|
-
j
|
|
636
|
-
h
|
|
637
|
-
f
|
|
638
|
-
d
|
|
639
|
-
b
|
|
640
|
-
`
|
|
641
|
-
^
|
|
642
|
-
|
|
643
|
-
Z
|
|
644
|
-
X
|
|
645
|
-
V
|
|
646
|
-
T
|
|
647
|
-
R
|
|
648
|
-
P
|
|
649
|
-
N
|
|
650
|
-
L
|
|
651
|
-
J
|
|
652
|
-
H
|
|
653
|
-
F
|
|
654
|
-
D
|
|
655
|
-
B><><><><{Z..a..20}
|
|
656
|
-
Z><><><><{a{,b}
|
|
657
|
-
{a
|
|
658
|
-
{ab><><><><{a},b}
|
|
659
|
-
a}
|
|
660
|
-
b><><><><{x,y{,}g}
|
|
661
|
-
x
|
|
662
|
-
yg
|
|
663
|
-
yg><><><><{x,y{}g}
|
|
664
|
-
x
|
|
665
|
-
y{}g><><><><{{a,b}
|
|
666
|
-
{a
|
|
667
|
-
{b><><><><{{a,b},c}
|
|
668
|
-
a
|
|
669
|
-
b
|
|
670
|
-
c><><><><{{a,b}c}
|
|
671
|
-
{ac}
|
|
672
|
-
{bc}><><><><{{a,b},}
|
|
673
|
-
a
|
|
674
|
-
b><><><><X{{a,b},}X
|
|
675
|
-
XaX
|
|
676
|
-
XbX
|
|
677
|
-
XX><><><><{{a,b},}c
|
|
678
|
-
ac
|
|
679
|
-
bc
|
|
680
|
-
c><><><><{{a,b}.}
|
|
681
|
-
{a.}
|
|
682
|
-
{b.}><><><><{{a,b}}
|
|
683
|
-
{a}
|
|
684
|
-
{b}><><><><X{a..#}X
|
|
685
|
-
X{a..#}X><><><><
|
|
686
|
-
><><><><{-10..00}
|
|
687
|
-
-10
|
|
688
|
-
-09
|
|
689
|
-
-08
|
|
690
|
-
-07
|
|
691
|
-
-06
|
|
692
|
-
-05
|
|
693
|
-
-04
|
|
694
|
-
-03
|
|
695
|
-
-02
|
|
696
|
-
-01
|
|
697
|
-
000><><><><{a,\\{a,b}c}
|
|
698
|
-
a
|
|
699
|
-
\ac
|
|
700
|
-
\bc><><><><{a,\{a,b}c}
|
|
701
|
-
ac}
|
|
702
|
-
{ac}
|
|
703
|
-
bc}><><><><a,\{b,c}
|
|
704
|
-
a,{b,c}><><><><{-10.\.00}
|
|
705
|
-
{-10..00}><><><><
|
package/test/cases.txt
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# skip quotes for now
|
|
2
|
-
# "{x,x}"
|
|
3
|
-
# {"x,x"}
|
|
4
|
-
# {x","x}
|
|
5
|
-
# '{a,b}{{a,b},a,b}'
|
|
6
|
-
A{b,{d,e},{f,g}}Z
|
|
7
|
-
PRE-{a,b}{{a,b},a,b}-POST
|
|
8
|
-
\{a,b}{{a,b},a,b}
|
|
9
|
-
{{a,b}
|
|
10
|
-
{a,b}}
|
|
11
|
-
{,}
|
|
12
|
-
a{,}
|
|
13
|
-
{,}b
|
|
14
|
-
a{,}b
|
|
15
|
-
a{b}c
|
|
16
|
-
a{1..5}b
|
|
17
|
-
a{01..5}b
|
|
18
|
-
a{-01..5}b
|
|
19
|
-
a{-01..5..3}b
|
|
20
|
-
a{001..9}b
|
|
21
|
-
a{b,c{d,e},{f,g}h}x{y,z
|
|
22
|
-
a{b,c{d,e},{f,g}h}x{y,z\}
|
|
23
|
-
a{b,c{d,e},{f,g}h}x{y,z}
|
|
24
|
-
a{b{c{d,e}f{x,y{{g}h
|
|
25
|
-
a{b{c{d,e}f{x,y{}g}h
|
|
26
|
-
a{b{c{d,e}f{x,y}}g}h
|
|
27
|
-
a{b{c{d,e}f}g}h
|
|
28
|
-
a{{x,y},z}b
|
|
29
|
-
f{x,y{g,z}}h
|
|
30
|
-
f{x,y{{g,z}}h
|
|
31
|
-
f{x,y{{g,z}}h}
|
|
32
|
-
f{x,y{{g}h
|
|
33
|
-
f{x,y{{g}}h
|
|
34
|
-
f{x,y{}g}h
|
|
35
|
-
z{a,b{,c}d
|
|
36
|
-
z{a,b},c}d
|
|
37
|
-
{-01..5}
|
|
38
|
-
{-05..100..5}
|
|
39
|
-
{-05..100}
|
|
40
|
-
{0..5..2}
|
|
41
|
-
{0001..05..2}
|
|
42
|
-
{0001..-5..2}
|
|
43
|
-
{0001..-5..-2}
|
|
44
|
-
{0001..5..-2}
|
|
45
|
-
{01..5}
|
|
46
|
-
{1..05}
|
|
47
|
-
{1..05..3}
|
|
48
|
-
{05..100}
|
|
49
|
-
{0a..0z}
|
|
50
|
-
{a,b\}c,d}
|
|
51
|
-
{a,b{c,d}
|
|
52
|
-
{a,b}c,d}
|
|
53
|
-
{a..F}
|
|
54
|
-
{A..f}
|
|
55
|
-
{a..Z}
|
|
56
|
-
{A..z}
|
|
57
|
-
{z..A}
|
|
58
|
-
{Z..a}
|
|
59
|
-
{a..F..2}
|
|
60
|
-
{A..f..02}
|
|
61
|
-
{a..Z..5}
|
|
62
|
-
d{a..Z..5}b
|
|
63
|
-
{A..z..10}
|
|
64
|
-
{z..A..-2}
|
|
65
|
-
{Z..a..20}
|
|
66
|
-
{a{,b}
|
|
67
|
-
{a},b}
|
|
68
|
-
{x,y{,}g}
|
|
69
|
-
{x,y{}g}
|
|
70
|
-
{{a,b}
|
|
71
|
-
{{a,b},c}
|
|
72
|
-
{{a,b}c}
|
|
73
|
-
{{a,b},}
|
|
74
|
-
X{{a,b},}X
|
|
75
|
-
{{a,b},}c
|
|
76
|
-
{{a,b}.}
|
|
77
|
-
{{a,b}}
|
|
78
|
-
X{a..#}X
|
|
79
|
-
# this next one is an empty string
|
|
80
|
-
|
|
81
|
-
{-10..00}
|
|
82
|
-
# Need to escape slashes in here for reasons i guess.
|
|
83
|
-
{a,\\\\{a,b}c}
|
|
84
|
-
{a,\\{a,b}c}
|
|
85
|
-
a,\\{b,c}
|
|
86
|
-
{-10.\\.00}
|
package/test/dollar.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var test = require('tape');
|
|
2
|
-
var expand = require('..');
|
|
3
|
-
|
|
4
|
-
test('ignores ${', function(t) {
|
|
5
|
-
t.deepEqual(expand('${1..3}'), ['${1..3}']);
|
|
6
|
-
t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']);
|
|
7
|
-
t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']);
|
|
8
|
-
t.end();
|
|
9
|
-
});
|
package/test/empty-option.js
DELETED
package/test/generate.sh
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -e
|
|
4
|
-
|
|
5
|
-
# Bash 4.3 because of arbitrary need to pick a single standard.
|
|
6
|
-
|
|
7
|
-
if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then
|
|
8
|
-
echo "this script requires bash 4.3" >&2
|
|
9
|
-
exit 1
|
|
10
|
-
fi
|
|
11
|
-
|
|
12
|
-
CDPATH= cd "$(dirname "$0")"
|
|
13
|
-
|
|
14
|
-
js='require("./")(process.argv[1]).join(" ")'
|
|
15
|
-
|
|
16
|
-
cat cases.txt | \
|
|
17
|
-
while read case; do
|
|
18
|
-
if [ "${case:0:1}" = "#" ]; then
|
|
19
|
-
continue;
|
|
20
|
-
fi;
|
|
21
|
-
b=$($BASH -c 'for c in '"$case"'; do echo "$c"; done')
|
|
22
|
-
echo "$case"
|
|
23
|
-
echo -n "$b><><><><";
|
|
24
|
-
done > bash-results.txt
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var test = require('tape');
|
|
2
|
-
var expand = require('..');
|
|
3
|
-
|
|
4
|
-
test('negative increment', function(t) {
|
|
5
|
-
t.deepEqual(expand('{3..1}'), ['3', '2', '1']);
|
|
6
|
-
t.deepEqual(expand('{10..8}'), ['10', '9', '8']);
|
|
7
|
-
t.deepEqual(expand('{10..08}'), ['10', '09', '08']);
|
|
8
|
-
t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']);
|
|
9
|
-
|
|
10
|
-
t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']);
|
|
11
|
-
t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']);
|
|
12
|
-
t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']);
|
|
13
|
-
|
|
14
|
-
t.end();
|
|
15
|
-
});
|
package/test/nested.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var test = require('tape');
|
|
2
|
-
var expand = require('..');
|
|
3
|
-
|
|
4
|
-
test('nested', function(t) {
|
|
5
|
-
t.deepEqual(expand('{a,b{1..3},c}'), [
|
|
6
|
-
'a', 'b1', 'b2', 'b3', 'c'
|
|
7
|
-
]);
|
|
8
|
-
t.deepEqual(expand('{{A..Z},{a..z}}'),
|
|
9
|
-
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
|
|
10
|
-
);
|
|
11
|
-
t.deepEqual(expand('ppp{,config,oe{,conf}}'), [
|
|
12
|
-
'ppp', 'pppconfig', 'pppoe', 'pppoeconf'
|
|
13
|
-
]);
|
|
14
|
-
t.end();
|
|
15
|
-
});
|
|
16
|
-
|
package/test/order.js
DELETED
package/test/pad.js
DELETED
package/test/same-type.js
DELETED
package/test/sequence.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
var test = require('tape');
|
|
2
|
-
var expand = require('..');
|
|
3
|
-
|
|
4
|
-
test('numeric sequences', function(t) {
|
|
5
|
-
t.deepEqual(expand('a{1..2}b{2..3}c'), [
|
|
6
|
-
'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c'
|
|
7
|
-
]);
|
|
8
|
-
t.deepEqual(expand('{1..2}{2..3}'), [
|
|
9
|
-
'12', '13', '22', '23'
|
|
10
|
-
]);
|
|
11
|
-
t.end();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('numeric sequences with step count', function(t) {
|
|
15
|
-
t.deepEqual(expand('{0..8..2}'), [
|
|
16
|
-
'0', '2', '4', '6', '8'
|
|
17
|
-
]);
|
|
18
|
-
t.deepEqual(expand('{1..8..2}'), [
|
|
19
|
-
'1', '3', '5', '7'
|
|
20
|
-
]);
|
|
21
|
-
t.end();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test('numeric sequence with negative x / y', function(t) {
|
|
25
|
-
t.deepEqual(expand('{3..-2}'), [
|
|
26
|
-
'3', '2', '1', '0', '-1', '-2'
|
|
27
|
-
]);
|
|
28
|
-
t.end();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test('alphabetic sequences', function(t) {
|
|
32
|
-
t.deepEqual(expand('1{a..b}2{b..c}3'), [
|
|
33
|
-
'1a2b3', '1a2c3', '1b2b3', '1b2c3'
|
|
34
|
-
]);
|
|
35
|
-
t.deepEqual(expand('{a..b}{b..c}'), [
|
|
36
|
-
'ab', 'ac', 'bb', 'bc'
|
|
37
|
-
]);
|
|
38
|
-
t.end();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test('alphabetic sequences with step count', function(t) {
|
|
42
|
-
t.deepEqual(expand('{a..k..2}'), [
|
|
43
|
-
'a', 'c', 'e', 'g', 'i', 'k'
|
|
44
|
-
]);
|
|
45
|
-
t.deepEqual(expand('{b..k..2}'), [
|
|
46
|
-
'b', 'd', 'f', 'h', 'j'
|
|
47
|
-
]);
|
|
48
|
-
t.end();
|
|
49
|
-
});
|
|
50
|
-
|