jiek 0.4.7-alpha.5 → 0.4.7-alpha.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,18 +5,4126 @@ var path = require('node:path');
5
5
  var entrypoints = require('@jiek/pkger/entrypoints');
6
6
  var rollupPluginDts = require('@jiek/rollup-plugin-dts');
7
7
  var getWorkspaceDir = require('@jiek/utils/getWorkspaceDir');
8
+ var commonjs = require('@rollup/plugin-commonjs');
8
9
  var json = require('@rollup/plugin-json');
9
10
  var pluginNodeResolve = require('@rollup/plugin-node-resolve');
10
11
  var terser = require('@rollup/plugin-terser');
11
12
  var execa = require('execa');
12
13
  var jsoncParser = require('jsonc-parser');
13
- var micromatch = require('micromatch');
14
+ var require$$0 = require('util');
15
+ var require$$0$1 = require('path');
14
16
  var esbuild = require('rollup-plugin-esbuild');
15
17
  var ts = require('typescript');
16
18
  var commander = require('commander');
17
19
  var jsYaml = require('js-yaml');
18
20
  require('@pnpm/filter-workspace-packages');
19
21
 
22
+ var utils$1 = {};
23
+
24
+ var hasRequiredUtils$1;
25
+
26
+ function requireUtils$1 () {
27
+ if (hasRequiredUtils$1) return utils$1;
28
+ hasRequiredUtils$1 = 1;
29
+ (function (exports) {
30
+
31
+ exports.isInteger = num => {
32
+ if (typeof num === 'number') {
33
+ return Number.isInteger(num);
34
+ }
35
+ if (typeof num === 'string' && num.trim() !== '') {
36
+ return Number.isInteger(Number(num));
37
+ }
38
+ return false;
39
+ };
40
+
41
+ /**
42
+ * Find a node of the given type
43
+ */
44
+
45
+ exports.find = (node, type) => node.nodes.find(node => node.type === type);
46
+
47
+ /**
48
+ * Find a node of the given type
49
+ */
50
+
51
+ exports.exceedsLimit = (min, max, step = 1, limit) => {
52
+ if (limit === false) return false;
53
+ if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
54
+ return ((Number(max) - Number(min)) / Number(step)) >= limit;
55
+ };
56
+
57
+ /**
58
+ * Escape the given node with '\\' before node.value
59
+ */
60
+
61
+ exports.escapeNode = (block, n = 0, type) => {
62
+ let node = block.nodes[n];
63
+ if (!node) return;
64
+
65
+ if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
66
+ if (node.escaped !== true) {
67
+ node.value = '\\' + node.value;
68
+ node.escaped = true;
69
+ }
70
+ }
71
+ };
72
+
73
+ /**
74
+ * Returns true if the given brace node should be enclosed in literal braces
75
+ */
76
+
77
+ exports.encloseBrace = node => {
78
+ if (node.type !== 'brace') return false;
79
+ if ((node.commas >> 0 + node.ranges >> 0) === 0) {
80
+ node.invalid = true;
81
+ return true;
82
+ }
83
+ return false;
84
+ };
85
+
86
+ /**
87
+ * Returns true if a brace node is invalid.
88
+ */
89
+
90
+ exports.isInvalidBrace = block => {
91
+ if (block.type !== 'brace') return false;
92
+ if (block.invalid === true || block.dollar) return true;
93
+ if ((block.commas >> 0 + block.ranges >> 0) === 0) {
94
+ block.invalid = true;
95
+ return true;
96
+ }
97
+ if (block.open !== true || block.close !== true) {
98
+ block.invalid = true;
99
+ return true;
100
+ }
101
+ return false;
102
+ };
103
+
104
+ /**
105
+ * Returns true if a node is an open or close node
106
+ */
107
+
108
+ exports.isOpenOrClose = node => {
109
+ if (node.type === 'open' || node.type === 'close') {
110
+ return true;
111
+ }
112
+ return node.open === true || node.close === true;
113
+ };
114
+
115
+ /**
116
+ * Reduce an array of text nodes.
117
+ */
118
+
119
+ exports.reduce = nodes => nodes.reduce((acc, node) => {
120
+ if (node.type === 'text') acc.push(node.value);
121
+ if (node.type === 'range') node.type = 'text';
122
+ return acc;
123
+ }, []);
124
+
125
+ /**
126
+ * Flatten an array
127
+ */
128
+
129
+ exports.flatten = (...args) => {
130
+ const result = [];
131
+ const flat = arr => {
132
+ for (let i = 0; i < arr.length; i++) {
133
+ let ele = arr[i];
134
+ Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele);
135
+ }
136
+ return result;
137
+ };
138
+ flat(args);
139
+ return result;
140
+ };
141
+ } (utils$1));
142
+ return utils$1;
143
+ }
144
+
145
+ var stringify;
146
+ var hasRequiredStringify;
147
+
148
+ function requireStringify () {
149
+ if (hasRequiredStringify) return stringify;
150
+ hasRequiredStringify = 1;
151
+
152
+ const utils = requireUtils$1();
153
+
154
+ stringify = (ast, options = {}) => {
155
+ let stringify = (node, parent = {}) => {
156
+ let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
157
+ let invalidNode = node.invalid === true && options.escapeInvalid === true;
158
+ let output = '';
159
+
160
+ if (node.value) {
161
+ if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
162
+ return '\\' + node.value;
163
+ }
164
+ return node.value;
165
+ }
166
+
167
+ if (node.value) {
168
+ return node.value;
169
+ }
170
+
171
+ if (node.nodes) {
172
+ for (let child of node.nodes) {
173
+ output += stringify(child);
174
+ }
175
+ }
176
+ return output;
177
+ };
178
+
179
+ return stringify(ast);
180
+ };
181
+ return stringify;
182
+ }
183
+
184
+ /*!
185
+ * is-number <https://github.com/jonschlinkert/is-number>
186
+ *
187
+ * Copyright (c) 2014-present, Jon Schlinkert.
188
+ * Released under the MIT License.
189
+ */
190
+
191
+ var isNumber;
192
+ var hasRequiredIsNumber;
193
+
194
+ function requireIsNumber () {
195
+ if (hasRequiredIsNumber) return isNumber;
196
+ hasRequiredIsNumber = 1;
197
+
198
+ isNumber = function(num) {
199
+ if (typeof num === 'number') {
200
+ return num - num === 0;
201
+ }
202
+ if (typeof num === 'string' && num.trim() !== '') {
203
+ return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
204
+ }
205
+ return false;
206
+ };
207
+ return isNumber;
208
+ }
209
+
210
+ /*!
211
+ * to-regex-range <https://github.com/micromatch/to-regex-range>
212
+ *
213
+ * Copyright (c) 2015-present, Jon Schlinkert.
214
+ * Released under the MIT License.
215
+ */
216
+
217
+ var toRegexRange_1;
218
+ var hasRequiredToRegexRange;
219
+
220
+ function requireToRegexRange () {
221
+ if (hasRequiredToRegexRange) return toRegexRange_1;
222
+ hasRequiredToRegexRange = 1;
223
+
224
+ const isNumber = requireIsNumber();
225
+
226
+ const toRegexRange = (min, max, options) => {
227
+ if (isNumber(min) === false) {
228
+ throw new TypeError('toRegexRange: expected the first argument to be a number');
229
+ }
230
+
231
+ if (max === void 0 || min === max) {
232
+ return String(min);
233
+ }
234
+
235
+ if (isNumber(max) === false) {
236
+ throw new TypeError('toRegexRange: expected the second argument to be a number.');
237
+ }
238
+
239
+ let opts = { relaxZeros: true, ...options };
240
+ if (typeof opts.strictZeros === 'boolean') {
241
+ opts.relaxZeros = opts.strictZeros === false;
242
+ }
243
+
244
+ let relax = String(opts.relaxZeros);
245
+ let shorthand = String(opts.shorthand);
246
+ let capture = String(opts.capture);
247
+ let wrap = String(opts.wrap);
248
+ let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
249
+
250
+ if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
251
+ return toRegexRange.cache[cacheKey].result;
252
+ }
253
+
254
+ let a = Math.min(min, max);
255
+ let b = Math.max(min, max);
256
+
257
+ if (Math.abs(a - b) === 1) {
258
+ let result = min + '|' + max;
259
+ if (opts.capture) {
260
+ return `(${result})`;
261
+ }
262
+ if (opts.wrap === false) {
263
+ return result;
264
+ }
265
+ return `(?:${result})`;
266
+ }
267
+
268
+ let isPadded = hasPadding(min) || hasPadding(max);
269
+ let state = { min, max, a, b };
270
+ let positives = [];
271
+ let negatives = [];
272
+
273
+ if (isPadded) {
274
+ state.isPadded = isPadded;
275
+ state.maxLen = String(state.max).length;
276
+ }
277
+
278
+ if (a < 0) {
279
+ let newMin = b < 0 ? Math.abs(b) : 1;
280
+ negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
281
+ a = state.a = 0;
282
+ }
283
+
284
+ if (b >= 0) {
285
+ positives = splitToPatterns(a, b, state, opts);
286
+ }
287
+
288
+ state.negatives = negatives;
289
+ state.positives = positives;
290
+ state.result = collatePatterns(negatives, positives);
291
+
292
+ if (opts.capture === true) {
293
+ state.result = `(${state.result})`;
294
+ } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) {
295
+ state.result = `(?:${state.result})`;
296
+ }
297
+
298
+ toRegexRange.cache[cacheKey] = state;
299
+ return state.result;
300
+ };
301
+
302
+ function collatePatterns(neg, pos, options) {
303
+ let onlyNegative = filterPatterns(neg, pos, '-', false) || [];
304
+ let onlyPositive = filterPatterns(pos, neg, '', false) || [];
305
+ let intersected = filterPatterns(neg, pos, '-?', true) || [];
306
+ let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
307
+ return subpatterns.join('|');
308
+ }
309
+
310
+ function splitToRanges(min, max) {
311
+ let nines = 1;
312
+ let zeros = 1;
313
+
314
+ let stop = countNines(min, nines);
315
+ let stops = new Set([max]);
316
+
317
+ while (min <= stop && stop <= max) {
318
+ stops.add(stop);
319
+ nines += 1;
320
+ stop = countNines(min, nines);
321
+ }
322
+
323
+ stop = countZeros(max + 1, zeros) - 1;
324
+
325
+ while (min < stop && stop <= max) {
326
+ stops.add(stop);
327
+ zeros += 1;
328
+ stop = countZeros(max + 1, zeros) - 1;
329
+ }
330
+
331
+ stops = [...stops];
332
+ stops.sort(compare);
333
+ return stops;
334
+ }
335
+
336
+ /**
337
+ * Convert a range to a regex pattern
338
+ * @param {Number} `start`
339
+ * @param {Number} `stop`
340
+ * @return {String}
341
+ */
342
+
343
+ function rangeToPattern(start, stop, options) {
344
+ if (start === stop) {
345
+ return { pattern: start, count: [], digits: 0 };
346
+ }
347
+
348
+ let zipped = zip(start, stop);
349
+ let digits = zipped.length;
350
+ let pattern = '';
351
+ let count = 0;
352
+
353
+ for (let i = 0; i < digits; i++) {
354
+ let [startDigit, stopDigit] = zipped[i];
355
+
356
+ if (startDigit === stopDigit) {
357
+ pattern += startDigit;
358
+
359
+ } else if (startDigit !== '0' || stopDigit !== '9') {
360
+ pattern += toCharacterClass(startDigit, stopDigit);
361
+
362
+ } else {
363
+ count++;
364
+ }
365
+ }
366
+
367
+ if (count) {
368
+ pattern += options.shorthand === true ? '\\d' : '[0-9]';
369
+ }
370
+
371
+ return { pattern, count: [count], digits };
372
+ }
373
+
374
+ function splitToPatterns(min, max, tok, options) {
375
+ let ranges = splitToRanges(min, max);
376
+ let tokens = [];
377
+ let start = min;
378
+ let prev;
379
+
380
+ for (let i = 0; i < ranges.length; i++) {
381
+ let max = ranges[i];
382
+ let obj = rangeToPattern(String(start), String(max), options);
383
+ let zeros = '';
384
+
385
+ if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
386
+ if (prev.count.length > 1) {
387
+ prev.count.pop();
388
+ }
389
+
390
+ prev.count.push(obj.count[0]);
391
+ prev.string = prev.pattern + toQuantifier(prev.count);
392
+ start = max + 1;
393
+ continue;
394
+ }
395
+
396
+ if (tok.isPadded) {
397
+ zeros = padZeros(max, tok, options);
398
+ }
399
+
400
+ obj.string = zeros + obj.pattern + toQuantifier(obj.count);
401
+ tokens.push(obj);
402
+ start = max + 1;
403
+ prev = obj;
404
+ }
405
+
406
+ return tokens;
407
+ }
408
+
409
+ function filterPatterns(arr, comparison, prefix, intersection, options) {
410
+ let result = [];
411
+
412
+ for (let ele of arr) {
413
+ let { string } = ele;
414
+
415
+ // only push if _both_ are negative...
416
+ if (!intersection && !contains(comparison, 'string', string)) {
417
+ result.push(prefix + string);
418
+ }
419
+
420
+ // or _both_ are positive
421
+ if (intersection && contains(comparison, 'string', string)) {
422
+ result.push(prefix + string);
423
+ }
424
+ }
425
+ return result;
426
+ }
427
+
428
+ /**
429
+ * Zip strings
430
+ */
431
+
432
+ function zip(a, b) {
433
+ let arr = [];
434
+ for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
435
+ return arr;
436
+ }
437
+
438
+ function compare(a, b) {
439
+ return a > b ? 1 : b > a ? -1 : 0;
440
+ }
441
+
442
+ function contains(arr, key, val) {
443
+ return arr.some(ele => ele[key] === val);
444
+ }
445
+
446
+ function countNines(min, len) {
447
+ return Number(String(min).slice(0, -len) + '9'.repeat(len));
448
+ }
449
+
450
+ function countZeros(integer, zeros) {
451
+ return integer - (integer % Math.pow(10, zeros));
452
+ }
453
+
454
+ function toQuantifier(digits) {
455
+ let [start = 0, stop = ''] = digits;
456
+ if (stop || start > 1) {
457
+ return `{${start + (stop ? ',' + stop : '')}}`;
458
+ }
459
+ return '';
460
+ }
461
+
462
+ function toCharacterClass(a, b, options) {
463
+ return `[${a}${(b - a === 1) ? '' : '-'}${b}]`;
464
+ }
465
+
466
+ function hasPadding(str) {
467
+ return /^-?(0+)\d/.test(str);
468
+ }
469
+
470
+ function padZeros(value, tok, options) {
471
+ if (!tok.isPadded) {
472
+ return value;
473
+ }
474
+
475
+ let diff = Math.abs(tok.maxLen - String(value).length);
476
+ let relax = options.relaxZeros !== false;
477
+
478
+ switch (diff) {
479
+ case 0:
480
+ return '';
481
+ case 1:
482
+ return relax ? '0?' : '0';
483
+ case 2:
484
+ return relax ? '0{0,2}' : '00';
485
+ default: {
486
+ return relax ? `0{0,${diff}}` : `0{${diff}}`;
487
+ }
488
+ }
489
+ }
490
+
491
+ /**
492
+ * Cache
493
+ */
494
+
495
+ toRegexRange.cache = {};
496
+ toRegexRange.clearCache = () => (toRegexRange.cache = {});
497
+
498
+ /**
499
+ * Expose `toRegexRange`
500
+ */
501
+
502
+ toRegexRange_1 = toRegexRange;
503
+ return toRegexRange_1;
504
+ }
505
+
506
+ /*!
507
+ * fill-range <https://github.com/jonschlinkert/fill-range>
508
+ *
509
+ * Copyright (c) 2014-present, Jon Schlinkert.
510
+ * Licensed under the MIT License.
511
+ */
512
+
513
+ var fillRange;
514
+ var hasRequiredFillRange;
515
+
516
+ function requireFillRange () {
517
+ if (hasRequiredFillRange) return fillRange;
518
+ hasRequiredFillRange = 1;
519
+
520
+ const util = require$$0;
521
+ const toRegexRange = requireToRegexRange();
522
+
523
+ const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
524
+
525
+ const transform = toNumber => {
526
+ return value => toNumber === true ? Number(value) : String(value);
527
+ };
528
+
529
+ const isValidValue = value => {
530
+ return typeof value === 'number' || (typeof value === 'string' && value !== '');
531
+ };
532
+
533
+ const isNumber = num => Number.isInteger(+num);
534
+
535
+ const zeros = input => {
536
+ let value = `${input}`;
537
+ let index = -1;
538
+ if (value[0] === '-') value = value.slice(1);
539
+ if (value === '0') return false;
540
+ while (value[++index] === '0');
541
+ return index > 0;
542
+ };
543
+
544
+ const stringify = (start, end, options) => {
545
+ if (typeof start === 'string' || typeof end === 'string') {
546
+ return true;
547
+ }
548
+ return options.stringify === true;
549
+ };
550
+
551
+ const pad = (input, maxLength, toNumber) => {
552
+ if (maxLength > 0) {
553
+ let dash = input[0] === '-' ? '-' : '';
554
+ if (dash) input = input.slice(1);
555
+ input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0'));
556
+ }
557
+ if (toNumber === false) {
558
+ return String(input);
559
+ }
560
+ return input;
561
+ };
562
+
563
+ const toMaxLen = (input, maxLength) => {
564
+ let negative = input[0] === '-' ? '-' : '';
565
+ if (negative) {
566
+ input = input.slice(1);
567
+ maxLength--;
568
+ }
569
+ while (input.length < maxLength) input = '0' + input;
570
+ return negative ? ('-' + input) : input;
571
+ };
572
+
573
+ const toSequence = (parts, options) => {
574
+ parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
575
+ parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
576
+
577
+ let prefix = options.capture ? '' : '?:';
578
+ let positives = '';
579
+ let negatives = '';
580
+ let result;
581
+
582
+ if (parts.positives.length) {
583
+ positives = parts.positives.join('|');
584
+ }
585
+
586
+ if (parts.negatives.length) {
587
+ negatives = `-(${prefix}${parts.negatives.join('|')})`;
588
+ }
589
+
590
+ if (positives && negatives) {
591
+ result = `${positives}|${negatives}`;
592
+ } else {
593
+ result = positives || negatives;
594
+ }
595
+
596
+ if (options.wrap) {
597
+ return `(${prefix}${result})`;
598
+ }
599
+
600
+ return result;
601
+ };
602
+
603
+ const toRange = (a, b, isNumbers, options) => {
604
+ if (isNumbers) {
605
+ return toRegexRange(a, b, { wrap: false, ...options });
606
+ }
607
+
608
+ let start = String.fromCharCode(a);
609
+ if (a === b) return start;
610
+
611
+ let stop = String.fromCharCode(b);
612
+ return `[${start}-${stop}]`;
613
+ };
614
+
615
+ const toRegex = (start, end, options) => {
616
+ if (Array.isArray(start)) {
617
+ let wrap = options.wrap === true;
618
+ let prefix = options.capture ? '' : '?:';
619
+ return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
620
+ }
621
+ return toRegexRange(start, end, options);
622
+ };
623
+
624
+ const rangeError = (...args) => {
625
+ return new RangeError('Invalid range arguments: ' + util.inspect(...args));
626
+ };
627
+
628
+ const invalidRange = (start, end, options) => {
629
+ if (options.strictRanges === true) throw rangeError([start, end]);
630
+ return [];
631
+ };
632
+
633
+ const invalidStep = (step, options) => {
634
+ if (options.strictRanges === true) {
635
+ throw new TypeError(`Expected step "${step}" to be a number`);
636
+ }
637
+ return [];
638
+ };
639
+
640
+ const fillNumbers = (start, end, step = 1, options = {}) => {
641
+ let a = Number(start);
642
+ let b = Number(end);
643
+
644
+ if (!Number.isInteger(a) || !Number.isInteger(b)) {
645
+ if (options.strictRanges === true) throw rangeError([start, end]);
646
+ return [];
647
+ }
648
+
649
+ // fix negative zero
650
+ if (a === 0) a = 0;
651
+ if (b === 0) b = 0;
652
+
653
+ let descending = a > b;
654
+ let startString = String(start);
655
+ let endString = String(end);
656
+ let stepString = String(step);
657
+ step = Math.max(Math.abs(step), 1);
658
+
659
+ let padded = zeros(startString) || zeros(endString) || zeros(stepString);
660
+ let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
661
+ let toNumber = padded === false && stringify(start, end, options) === false;
662
+ let format = options.transform || transform(toNumber);
663
+
664
+ if (options.toRegex && step === 1) {
665
+ return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
666
+ }
667
+
668
+ let parts = { negatives: [], positives: [] };
669
+ let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num));
670
+ let range = [];
671
+ let index = 0;
672
+
673
+ while (descending ? a >= b : a <= b) {
674
+ if (options.toRegex === true && step > 1) {
675
+ push(a);
676
+ } else {
677
+ range.push(pad(format(a, index), maxLen, toNumber));
678
+ }
679
+ a = descending ? a - step : a + step;
680
+ index++;
681
+ }
682
+
683
+ if (options.toRegex === true) {
684
+ return step > 1
685
+ ? toSequence(parts, options)
686
+ : toRegex(range, null, { wrap: false, ...options });
687
+ }
688
+
689
+ return range;
690
+ };
691
+
692
+ const fillLetters = (start, end, step = 1, options = {}) => {
693
+ if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) {
694
+ return invalidRange(start, end, options);
695
+ }
696
+
697
+
698
+ let format = options.transform || (val => String.fromCharCode(val));
699
+ let a = `${start}`.charCodeAt(0);
700
+ let b = `${end}`.charCodeAt(0);
701
+
702
+ let descending = a > b;
703
+ let min = Math.min(a, b);
704
+ let max = Math.max(a, b);
705
+
706
+ if (options.toRegex && step === 1) {
707
+ return toRange(min, max, false, options);
708
+ }
709
+
710
+ let range = [];
711
+ let index = 0;
712
+
713
+ while (descending ? a >= b : a <= b) {
714
+ range.push(format(a, index));
715
+ a = descending ? a - step : a + step;
716
+ index++;
717
+ }
718
+
719
+ if (options.toRegex === true) {
720
+ return toRegex(range, null, { wrap: false, options });
721
+ }
722
+
723
+ return range;
724
+ };
725
+
726
+ const fill = (start, end, step, options = {}) => {
727
+ if (end == null && isValidValue(start)) {
728
+ return [start];
729
+ }
730
+
731
+ if (!isValidValue(start) || !isValidValue(end)) {
732
+ return invalidRange(start, end, options);
733
+ }
734
+
735
+ if (typeof step === 'function') {
736
+ return fill(start, end, 1, { transform: step });
737
+ }
738
+
739
+ if (isObject(step)) {
740
+ return fill(start, end, 0, step);
741
+ }
742
+
743
+ let opts = { ...options };
744
+ if (opts.capture === true) opts.wrap = true;
745
+ step = step || opts.step || 1;
746
+
747
+ if (!isNumber(step)) {
748
+ if (step != null && !isObject(step)) return invalidStep(step, opts);
749
+ return fill(start, end, 1, step);
750
+ }
751
+
752
+ if (isNumber(start) && isNumber(end)) {
753
+ return fillNumbers(start, end, step, opts);
754
+ }
755
+
756
+ return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
757
+ };
758
+
759
+ fillRange = fill;
760
+ return fillRange;
761
+ }
762
+
763
+ var compile_1;
764
+ var hasRequiredCompile;
765
+
766
+ function requireCompile () {
767
+ if (hasRequiredCompile) return compile_1;
768
+ hasRequiredCompile = 1;
769
+
770
+ const fill = requireFillRange();
771
+ const utils = requireUtils$1();
772
+
773
+ const compile = (ast, options = {}) => {
774
+ let walk = (node, parent = {}) => {
775
+ let invalidBlock = utils.isInvalidBrace(parent);
776
+ let invalidNode = node.invalid === true && options.escapeInvalid === true;
777
+ let invalid = invalidBlock === true || invalidNode === true;
778
+ let prefix = options.escapeInvalid === true ? '\\' : '';
779
+ let output = '';
780
+
781
+ if (node.isOpen === true) {
782
+ return prefix + node.value;
783
+ }
784
+ if (node.isClose === true) {
785
+ return prefix + node.value;
786
+ }
787
+
788
+ if (node.type === 'open') {
789
+ return invalid ? (prefix + node.value) : '(';
790
+ }
791
+
792
+ if (node.type === 'close') {
793
+ return invalid ? (prefix + node.value) : ')';
794
+ }
795
+
796
+ if (node.type === 'comma') {
797
+ return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
798
+ }
799
+
800
+ if (node.value) {
801
+ return node.value;
802
+ }
803
+
804
+ if (node.nodes && node.ranges > 0) {
805
+ let args = utils.reduce(node.nodes);
806
+ let range = fill(...args, { ...options, wrap: false, toRegex: true });
807
+
808
+ if (range.length !== 0) {
809
+ return args.length > 1 && range.length > 1 ? `(${range})` : range;
810
+ }
811
+ }
812
+
813
+ if (node.nodes) {
814
+ for (let child of node.nodes) {
815
+ output += walk(child, node);
816
+ }
817
+ }
818
+ return output;
819
+ };
820
+
821
+ return walk(ast);
822
+ };
823
+
824
+ compile_1 = compile;
825
+ return compile_1;
826
+ }
827
+
828
+ var expand_1;
829
+ var hasRequiredExpand;
830
+
831
+ function requireExpand () {
832
+ if (hasRequiredExpand) return expand_1;
833
+ hasRequiredExpand = 1;
834
+
835
+ const fill = requireFillRange();
836
+ const stringify = requireStringify();
837
+ const utils = requireUtils$1();
838
+
839
+ const append = (queue = '', stash = '', enclose = false) => {
840
+ let result = [];
841
+
842
+ queue = [].concat(queue);
843
+ stash = [].concat(stash);
844
+
845
+ if (!stash.length) return queue;
846
+ if (!queue.length) {
847
+ return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
848
+ }
849
+
850
+ for (let item of queue) {
851
+ if (Array.isArray(item)) {
852
+ for (let value of item) {
853
+ result.push(append(value, stash, enclose));
854
+ }
855
+ } else {
856
+ for (let ele of stash) {
857
+ if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
858
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
859
+ }
860
+ }
861
+ }
862
+ return utils.flatten(result);
863
+ };
864
+
865
+ const expand = (ast, options = {}) => {
866
+ let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
867
+
868
+ let walk = (node, parent = {}) => {
869
+ node.queue = [];
870
+
871
+ let p = parent;
872
+ let q = parent.queue;
873
+
874
+ while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
875
+ p = p.parent;
876
+ q = p.queue;
877
+ }
878
+
879
+ if (node.invalid || node.dollar) {
880
+ q.push(append(q.pop(), stringify(node, options)));
881
+ return;
882
+ }
883
+
884
+ if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
885
+ q.push(append(q.pop(), ['{}']));
886
+ return;
887
+ }
888
+
889
+ if (node.nodes && node.ranges > 0) {
890
+ let args = utils.reduce(node.nodes);
891
+
892
+ if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
893
+ throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
894
+ }
895
+
896
+ let range = fill(...args, options);
897
+ if (range.length === 0) {
898
+ range = stringify(node, options);
899
+ }
900
+
901
+ q.push(append(q.pop(), range));
902
+ node.nodes = [];
903
+ return;
904
+ }
905
+
906
+ let enclose = utils.encloseBrace(node);
907
+ let queue = node.queue;
908
+ let block = node;
909
+
910
+ while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
911
+ block = block.parent;
912
+ queue = block.queue;
913
+ }
914
+
915
+ for (let i = 0; i < node.nodes.length; i++) {
916
+ let child = node.nodes[i];
917
+
918
+ if (child.type === 'comma' && node.type === 'brace') {
919
+ if (i === 1) queue.push('');
920
+ queue.push('');
921
+ continue;
922
+ }
923
+
924
+ if (child.type === 'close') {
925
+ q.push(append(q.pop(), queue, enclose));
926
+ continue;
927
+ }
928
+
929
+ if (child.value && child.type !== 'open') {
930
+ queue.push(append(queue.pop(), child.value));
931
+ continue;
932
+ }
933
+
934
+ if (child.nodes) {
935
+ walk(child, node);
936
+ }
937
+ }
938
+
939
+ return queue;
940
+ };
941
+
942
+ return utils.flatten(walk(ast));
943
+ };
944
+
945
+ expand_1 = expand;
946
+ return expand_1;
947
+ }
948
+
949
+ var constants$1;
950
+ var hasRequiredConstants$1;
951
+
952
+ function requireConstants$1 () {
953
+ if (hasRequiredConstants$1) return constants$1;
954
+ hasRequiredConstants$1 = 1;
955
+
956
+ constants$1 = {
957
+ MAX_LENGTH: 1024 * 64,
958
+
959
+ // Digits
960
+ CHAR_0: '0', /* 0 */
961
+ CHAR_9: '9', /* 9 */
962
+
963
+ // Alphabet chars.
964
+ CHAR_UPPERCASE_A: 'A', /* A */
965
+ CHAR_LOWERCASE_A: 'a', /* a */
966
+ CHAR_UPPERCASE_Z: 'Z', /* Z */
967
+ CHAR_LOWERCASE_Z: 'z', /* z */
968
+
969
+ CHAR_LEFT_PARENTHESES: '(', /* ( */
970
+ CHAR_RIGHT_PARENTHESES: ')', /* ) */
971
+
972
+ CHAR_ASTERISK: '*', /* * */
973
+
974
+ // Non-alphabetic chars.
975
+ CHAR_AMPERSAND: '&', /* & */
976
+ CHAR_AT: '@', /* @ */
977
+ CHAR_BACKSLASH: '\\', /* \ */
978
+ CHAR_BACKTICK: '`', /* ` */
979
+ CHAR_CARRIAGE_RETURN: '\r', /* \r */
980
+ CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */
981
+ CHAR_COLON: ':', /* : */
982
+ CHAR_COMMA: ',', /* , */
983
+ CHAR_DOLLAR: '$', /* . */
984
+ CHAR_DOT: '.', /* . */
985
+ CHAR_DOUBLE_QUOTE: '"', /* " */
986
+ CHAR_EQUAL: '=', /* = */
987
+ CHAR_EXCLAMATION_MARK: '!', /* ! */
988
+ CHAR_FORM_FEED: '\f', /* \f */
989
+ CHAR_FORWARD_SLASH: '/', /* / */
990
+ CHAR_HASH: '#', /* # */
991
+ CHAR_HYPHEN_MINUS: '-', /* - */
992
+ CHAR_LEFT_ANGLE_BRACKET: '<', /* < */
993
+ CHAR_LEFT_CURLY_BRACE: '{', /* { */
994
+ CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */
995
+ CHAR_LINE_FEED: '\n', /* \n */
996
+ CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */
997
+ CHAR_PERCENT: '%', /* % */
998
+ CHAR_PLUS: '+', /* + */
999
+ CHAR_QUESTION_MARK: '?', /* ? */
1000
+ CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */
1001
+ CHAR_RIGHT_CURLY_BRACE: '}', /* } */
1002
+ CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */
1003
+ CHAR_SEMICOLON: ';', /* ; */
1004
+ CHAR_SINGLE_QUOTE: '\'', /* ' */
1005
+ CHAR_SPACE: ' ', /* */
1006
+ CHAR_TAB: '\t', /* \t */
1007
+ CHAR_UNDERSCORE: '_', /* _ */
1008
+ CHAR_VERTICAL_LINE: '|', /* | */
1009
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */
1010
+ };
1011
+ return constants$1;
1012
+ }
1013
+
1014
+ var parse_1$1;
1015
+ var hasRequiredParse$1;
1016
+
1017
+ function requireParse$1 () {
1018
+ if (hasRequiredParse$1) return parse_1$1;
1019
+ hasRequiredParse$1 = 1;
1020
+
1021
+ const stringify = requireStringify();
1022
+
1023
+ /**
1024
+ * Constants
1025
+ */
1026
+
1027
+ const {
1028
+ MAX_LENGTH,
1029
+ CHAR_BACKSLASH, /* \ */
1030
+ CHAR_BACKTICK, /* ` */
1031
+ CHAR_COMMA, /* , */
1032
+ CHAR_DOT, /* . */
1033
+ CHAR_LEFT_PARENTHESES, /* ( */
1034
+ CHAR_RIGHT_PARENTHESES, /* ) */
1035
+ CHAR_LEFT_CURLY_BRACE, /* { */
1036
+ CHAR_RIGHT_CURLY_BRACE, /* } */
1037
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
1038
+ CHAR_RIGHT_SQUARE_BRACKET, /* ] */
1039
+ CHAR_DOUBLE_QUOTE, /* " */
1040
+ CHAR_SINGLE_QUOTE, /* ' */
1041
+ CHAR_NO_BREAK_SPACE,
1042
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE
1043
+ } = requireConstants$1();
1044
+
1045
+ /**
1046
+ * parse
1047
+ */
1048
+
1049
+ const parse = (input, options = {}) => {
1050
+ if (typeof input !== 'string') {
1051
+ throw new TypeError('Expected a string');
1052
+ }
1053
+
1054
+ let opts = options || {};
1055
+ let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1056
+ if (input.length > max) {
1057
+ throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
1058
+ }
1059
+
1060
+ let ast = { type: 'root', input, nodes: [] };
1061
+ let stack = [ast];
1062
+ let block = ast;
1063
+ let prev = ast;
1064
+ let brackets = 0;
1065
+ let length = input.length;
1066
+ let index = 0;
1067
+ let depth = 0;
1068
+ let value;
1069
+
1070
+ /**
1071
+ * Helpers
1072
+ */
1073
+
1074
+ const advance = () => input[index++];
1075
+ const push = node => {
1076
+ if (node.type === 'text' && prev.type === 'dot') {
1077
+ prev.type = 'text';
1078
+ }
1079
+
1080
+ if (prev && prev.type === 'text' && node.type === 'text') {
1081
+ prev.value += node.value;
1082
+ return;
1083
+ }
1084
+
1085
+ block.nodes.push(node);
1086
+ node.parent = block;
1087
+ node.prev = prev;
1088
+ prev = node;
1089
+ return node;
1090
+ };
1091
+
1092
+ push({ type: 'bos' });
1093
+
1094
+ while (index < length) {
1095
+ block = stack[stack.length - 1];
1096
+ value = advance();
1097
+
1098
+ /**
1099
+ * Invalid chars
1100
+ */
1101
+
1102
+ if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
1103
+ continue;
1104
+ }
1105
+
1106
+ /**
1107
+ * Escaped chars
1108
+ */
1109
+
1110
+ if (value === CHAR_BACKSLASH) {
1111
+ push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() });
1112
+ continue;
1113
+ }
1114
+
1115
+ /**
1116
+ * Right square bracket (literal): ']'
1117
+ */
1118
+
1119
+ if (value === CHAR_RIGHT_SQUARE_BRACKET) {
1120
+ push({ type: 'text', value: '\\' + value });
1121
+ continue;
1122
+ }
1123
+
1124
+ /**
1125
+ * Left square bracket: '['
1126
+ */
1127
+
1128
+ if (value === CHAR_LEFT_SQUARE_BRACKET) {
1129
+ brackets++;
1130
+ let next;
1131
+
1132
+ while (index < length && (next = advance())) {
1133
+ value += next;
1134
+
1135
+ if (next === CHAR_LEFT_SQUARE_BRACKET) {
1136
+ brackets++;
1137
+ continue;
1138
+ }
1139
+
1140
+ if (next === CHAR_BACKSLASH) {
1141
+ value += advance();
1142
+ continue;
1143
+ }
1144
+
1145
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
1146
+ brackets--;
1147
+
1148
+ if (brackets === 0) {
1149
+ break;
1150
+ }
1151
+ }
1152
+ }
1153
+
1154
+ push({ type: 'text', value });
1155
+ continue;
1156
+ }
1157
+
1158
+ /**
1159
+ * Parentheses
1160
+ */
1161
+
1162
+ if (value === CHAR_LEFT_PARENTHESES) {
1163
+ block = push({ type: 'paren', nodes: [] });
1164
+ stack.push(block);
1165
+ push({ type: 'text', value });
1166
+ continue;
1167
+ }
1168
+
1169
+ if (value === CHAR_RIGHT_PARENTHESES) {
1170
+ if (block.type !== 'paren') {
1171
+ push({ type: 'text', value });
1172
+ continue;
1173
+ }
1174
+ block = stack.pop();
1175
+ push({ type: 'text', value });
1176
+ block = stack[stack.length - 1];
1177
+ continue;
1178
+ }
1179
+
1180
+ /**
1181
+ * Quotes: '|"|`
1182
+ */
1183
+
1184
+ if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
1185
+ let open = value;
1186
+ let next;
1187
+
1188
+ if (options.keepQuotes !== true) {
1189
+ value = '';
1190
+ }
1191
+
1192
+ while (index < length && (next = advance())) {
1193
+ if (next === CHAR_BACKSLASH) {
1194
+ value += next + advance();
1195
+ continue;
1196
+ }
1197
+
1198
+ if (next === open) {
1199
+ if (options.keepQuotes === true) value += next;
1200
+ break;
1201
+ }
1202
+
1203
+ value += next;
1204
+ }
1205
+
1206
+ push({ type: 'text', value });
1207
+ continue;
1208
+ }
1209
+
1210
+ /**
1211
+ * Left curly brace: '{'
1212
+ */
1213
+
1214
+ if (value === CHAR_LEFT_CURLY_BRACE) {
1215
+ depth++;
1216
+
1217
+ let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
1218
+ let brace = {
1219
+ type: 'brace',
1220
+ open: true,
1221
+ close: false,
1222
+ dollar,
1223
+ depth,
1224
+ commas: 0,
1225
+ ranges: 0,
1226
+ nodes: []
1227
+ };
1228
+
1229
+ block = push(brace);
1230
+ stack.push(block);
1231
+ push({ type: 'open', value });
1232
+ continue;
1233
+ }
1234
+
1235
+ /**
1236
+ * Right curly brace: '}'
1237
+ */
1238
+
1239
+ if (value === CHAR_RIGHT_CURLY_BRACE) {
1240
+ if (block.type !== 'brace') {
1241
+ push({ type: 'text', value });
1242
+ continue;
1243
+ }
1244
+
1245
+ let type = 'close';
1246
+ block = stack.pop();
1247
+ block.close = true;
1248
+
1249
+ push({ type, value });
1250
+ depth--;
1251
+
1252
+ block = stack[stack.length - 1];
1253
+ continue;
1254
+ }
1255
+
1256
+ /**
1257
+ * Comma: ','
1258
+ */
1259
+
1260
+ if (value === CHAR_COMMA && depth > 0) {
1261
+ if (block.ranges > 0) {
1262
+ block.ranges = 0;
1263
+ let open = block.nodes.shift();
1264
+ block.nodes = [open, { type: 'text', value: stringify(block) }];
1265
+ }
1266
+
1267
+ push({ type: 'comma', value });
1268
+ block.commas++;
1269
+ continue;
1270
+ }
1271
+
1272
+ /**
1273
+ * Dot: '.'
1274
+ */
1275
+
1276
+ if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
1277
+ let siblings = block.nodes;
1278
+
1279
+ if (depth === 0 || siblings.length === 0) {
1280
+ push({ type: 'text', value });
1281
+ continue;
1282
+ }
1283
+
1284
+ if (prev.type === 'dot') {
1285
+ block.range = [];
1286
+ prev.value += value;
1287
+ prev.type = 'range';
1288
+
1289
+ if (block.nodes.length !== 3 && block.nodes.length !== 5) {
1290
+ block.invalid = true;
1291
+ block.ranges = 0;
1292
+ prev.type = 'text';
1293
+ continue;
1294
+ }
1295
+
1296
+ block.ranges++;
1297
+ block.args = [];
1298
+ continue;
1299
+ }
1300
+
1301
+ if (prev.type === 'range') {
1302
+ siblings.pop();
1303
+
1304
+ let before = siblings[siblings.length - 1];
1305
+ before.value += prev.value + value;
1306
+ prev = before;
1307
+ block.ranges--;
1308
+ continue;
1309
+ }
1310
+
1311
+ push({ type: 'dot', value });
1312
+ continue;
1313
+ }
1314
+
1315
+ /**
1316
+ * Text
1317
+ */
1318
+
1319
+ push({ type: 'text', value });
1320
+ }
1321
+
1322
+ // Mark imbalanced braces and brackets as invalid
1323
+ do {
1324
+ block = stack.pop();
1325
+
1326
+ if (block.type !== 'root') {
1327
+ block.nodes.forEach(node => {
1328
+ if (!node.nodes) {
1329
+ if (node.type === 'open') node.isOpen = true;
1330
+ if (node.type === 'close') node.isClose = true;
1331
+ if (!node.nodes) node.type = 'text';
1332
+ node.invalid = true;
1333
+ }
1334
+ });
1335
+
1336
+ // get the location of the block on parent.nodes (block's siblings)
1337
+ let parent = stack[stack.length - 1];
1338
+ let index = parent.nodes.indexOf(block);
1339
+ // replace the (invalid) block with it's nodes
1340
+ parent.nodes.splice(index, 1, ...block.nodes);
1341
+ }
1342
+ } while (stack.length > 0);
1343
+
1344
+ push({ type: 'eos' });
1345
+ return ast;
1346
+ };
1347
+
1348
+ parse_1$1 = parse;
1349
+ return parse_1$1;
1350
+ }
1351
+
1352
+ var braces_1;
1353
+ var hasRequiredBraces;
1354
+
1355
+ function requireBraces () {
1356
+ if (hasRequiredBraces) return braces_1;
1357
+ hasRequiredBraces = 1;
1358
+
1359
+ const stringify = requireStringify();
1360
+ const compile = requireCompile();
1361
+ const expand = requireExpand();
1362
+ const parse = requireParse$1();
1363
+
1364
+ /**
1365
+ * Expand the given pattern or create a regex-compatible string.
1366
+ *
1367
+ * ```js
1368
+ * const braces = require('braces');
1369
+ * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
1370
+ * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
1371
+ * ```
1372
+ * @param {String} `str`
1373
+ * @param {Object} `options`
1374
+ * @return {String}
1375
+ * @api public
1376
+ */
1377
+
1378
+ const braces = (input, options = {}) => {
1379
+ let output = [];
1380
+
1381
+ if (Array.isArray(input)) {
1382
+ for (let pattern of input) {
1383
+ let result = braces.create(pattern, options);
1384
+ if (Array.isArray(result)) {
1385
+ output.push(...result);
1386
+ } else {
1387
+ output.push(result);
1388
+ }
1389
+ }
1390
+ } else {
1391
+ output = [].concat(braces.create(input, options));
1392
+ }
1393
+
1394
+ if (options && options.expand === true && options.nodupes === true) {
1395
+ output = [...new Set(output)];
1396
+ }
1397
+ return output;
1398
+ };
1399
+
1400
+ /**
1401
+ * Parse the given `str` with the given `options`.
1402
+ *
1403
+ * ```js
1404
+ * // braces.parse(pattern, [, options]);
1405
+ * const ast = braces.parse('a/{b,c}/d');
1406
+ * console.log(ast);
1407
+ * ```
1408
+ * @param {String} pattern Brace pattern to parse
1409
+ * @param {Object} options
1410
+ * @return {Object} Returns an AST
1411
+ * @api public
1412
+ */
1413
+
1414
+ braces.parse = (input, options = {}) => parse(input, options);
1415
+
1416
+ /**
1417
+ * Creates a braces string from an AST, or an AST node.
1418
+ *
1419
+ * ```js
1420
+ * const braces = require('braces');
1421
+ * let ast = braces.parse('foo/{a,b}/bar');
1422
+ * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
1423
+ * ```
1424
+ * @param {String} `input` Brace pattern or AST.
1425
+ * @param {Object} `options`
1426
+ * @return {Array} Returns an array of expanded values.
1427
+ * @api public
1428
+ */
1429
+
1430
+ braces.stringify = (input, options = {}) => {
1431
+ if (typeof input === 'string') {
1432
+ return stringify(braces.parse(input, options), options);
1433
+ }
1434
+ return stringify(input, options);
1435
+ };
1436
+
1437
+ /**
1438
+ * Compiles a brace pattern into a regex-compatible, optimized string.
1439
+ * This method is called by the main [braces](#braces) function by default.
1440
+ *
1441
+ * ```js
1442
+ * const braces = require('braces');
1443
+ * console.log(braces.compile('a/{b,c}/d'));
1444
+ * //=> ['a/(b|c)/d']
1445
+ * ```
1446
+ * @param {String} `input` Brace pattern or AST.
1447
+ * @param {Object} `options`
1448
+ * @return {Array} Returns an array of expanded values.
1449
+ * @api public
1450
+ */
1451
+
1452
+ braces.compile = (input, options = {}) => {
1453
+ if (typeof input === 'string') {
1454
+ input = braces.parse(input, options);
1455
+ }
1456
+ return compile(input, options);
1457
+ };
1458
+
1459
+ /**
1460
+ * Expands a brace pattern into an array. This method is called by the
1461
+ * main [braces](#braces) function when `options.expand` is true. Before
1462
+ * using this method it's recommended that you read the [performance notes](#performance))
1463
+ * and advantages of using [.compile](#compile) instead.
1464
+ *
1465
+ * ```js
1466
+ * const braces = require('braces');
1467
+ * console.log(braces.expand('a/{b,c}/d'));
1468
+ * //=> ['a/b/d', 'a/c/d'];
1469
+ * ```
1470
+ * @param {String} `pattern` Brace pattern
1471
+ * @param {Object} `options`
1472
+ * @return {Array} Returns an array of expanded values.
1473
+ * @api public
1474
+ */
1475
+
1476
+ braces.expand = (input, options = {}) => {
1477
+ if (typeof input === 'string') {
1478
+ input = braces.parse(input, options);
1479
+ }
1480
+
1481
+ let result = expand(input, options);
1482
+
1483
+ // filter out empty strings if specified
1484
+ if (options.noempty === true) {
1485
+ result = result.filter(Boolean);
1486
+ }
1487
+
1488
+ // filter out duplicates if specified
1489
+ if (options.nodupes === true) {
1490
+ result = [...new Set(result)];
1491
+ }
1492
+
1493
+ return result;
1494
+ };
1495
+
1496
+ /**
1497
+ * Processes a brace pattern and returns either an expanded array
1498
+ * (if `options.expand` is true), a highly optimized regex-compatible string.
1499
+ * This method is called by the main [braces](#braces) function.
1500
+ *
1501
+ * ```js
1502
+ * const braces = require('braces');
1503
+ * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
1504
+ * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
1505
+ * ```
1506
+ * @param {String} `pattern` Brace pattern
1507
+ * @param {Object} `options`
1508
+ * @return {Array} Returns an array of expanded values.
1509
+ * @api public
1510
+ */
1511
+
1512
+ braces.create = (input, options = {}) => {
1513
+ if (input === '' || input.length < 3) {
1514
+ return [input];
1515
+ }
1516
+
1517
+ return options.expand !== true
1518
+ ? braces.compile(input, options)
1519
+ : braces.expand(input, options);
1520
+ };
1521
+
1522
+ /**
1523
+ * Expose "braces"
1524
+ */
1525
+
1526
+ braces_1 = braces;
1527
+ return braces_1;
1528
+ }
1529
+
1530
+ var utils = {};
1531
+
1532
+ var constants;
1533
+ var hasRequiredConstants;
1534
+
1535
+ function requireConstants () {
1536
+ if (hasRequiredConstants) return constants;
1537
+ hasRequiredConstants = 1;
1538
+
1539
+ const path = require$$0$1;
1540
+ const WIN_SLASH = '\\\\/';
1541
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1542
+
1543
+ /**
1544
+ * Posix glob regex
1545
+ */
1546
+
1547
+ const DOT_LITERAL = '\\.';
1548
+ const PLUS_LITERAL = '\\+';
1549
+ const QMARK_LITERAL = '\\?';
1550
+ const SLASH_LITERAL = '\\/';
1551
+ const ONE_CHAR = '(?=.)';
1552
+ const QMARK = '[^/]';
1553
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
1554
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
1555
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
1556
+ const NO_DOT = `(?!${DOT_LITERAL})`;
1557
+ const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
1558
+ const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
1559
+ const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
1560
+ const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
1561
+ const STAR = `${QMARK}*?`;
1562
+
1563
+ const POSIX_CHARS = {
1564
+ DOT_LITERAL,
1565
+ PLUS_LITERAL,
1566
+ QMARK_LITERAL,
1567
+ SLASH_LITERAL,
1568
+ ONE_CHAR,
1569
+ QMARK,
1570
+ END_ANCHOR,
1571
+ DOTS_SLASH,
1572
+ NO_DOT,
1573
+ NO_DOTS,
1574
+ NO_DOT_SLASH,
1575
+ NO_DOTS_SLASH,
1576
+ QMARK_NO_DOT,
1577
+ STAR,
1578
+ START_ANCHOR
1579
+ };
1580
+
1581
+ /**
1582
+ * Windows glob regex
1583
+ */
1584
+
1585
+ const WINDOWS_CHARS = {
1586
+ ...POSIX_CHARS,
1587
+
1588
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
1589
+ QMARK: WIN_NO_SLASH,
1590
+ STAR: `${WIN_NO_SLASH}*?`,
1591
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
1592
+ NO_DOT: `(?!${DOT_LITERAL})`,
1593
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
1594
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
1595
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
1596
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
1597
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
1598
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
1599
+ };
1600
+
1601
+ /**
1602
+ * POSIX Bracket Regex
1603
+ */
1604
+
1605
+ const POSIX_REGEX_SOURCE = {
1606
+ alnum: 'a-zA-Z0-9',
1607
+ alpha: 'a-zA-Z',
1608
+ ascii: '\\x00-\\x7F',
1609
+ blank: ' \\t',
1610
+ cntrl: '\\x00-\\x1F\\x7F',
1611
+ digit: '0-9',
1612
+ graph: '\\x21-\\x7E',
1613
+ lower: 'a-z',
1614
+ print: '\\x20-\\x7E ',
1615
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
1616
+ space: ' \\t\\r\\n\\v\\f',
1617
+ upper: 'A-Z',
1618
+ word: 'A-Za-z0-9_',
1619
+ xdigit: 'A-Fa-f0-9'
1620
+ };
1621
+
1622
+ constants = {
1623
+ MAX_LENGTH: 1024 * 64,
1624
+ POSIX_REGEX_SOURCE,
1625
+
1626
+ // regular expressions
1627
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
1628
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
1629
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
1630
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
1631
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
1632
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
1633
+
1634
+ // Replace globs with equivalent patterns to reduce parsing time.
1635
+ REPLACEMENTS: {
1636
+ '***': '*',
1637
+ '**/**': '**',
1638
+ '**/**/**': '**'
1639
+ },
1640
+
1641
+ // Digits
1642
+ CHAR_0: 48, /* 0 */
1643
+ CHAR_9: 57, /* 9 */
1644
+
1645
+ // Alphabet chars.
1646
+ CHAR_UPPERCASE_A: 65, /* A */
1647
+ CHAR_LOWERCASE_A: 97, /* a */
1648
+ CHAR_UPPERCASE_Z: 90, /* Z */
1649
+ CHAR_LOWERCASE_Z: 122, /* z */
1650
+
1651
+ CHAR_LEFT_PARENTHESES: 40, /* ( */
1652
+ CHAR_RIGHT_PARENTHESES: 41, /* ) */
1653
+
1654
+ CHAR_ASTERISK: 42, /* * */
1655
+
1656
+ // Non-alphabetic chars.
1657
+ CHAR_AMPERSAND: 38, /* & */
1658
+ CHAR_AT: 64, /* @ */
1659
+ CHAR_BACKWARD_SLASH: 92, /* \ */
1660
+ CHAR_CARRIAGE_RETURN: 13, /* \r */
1661
+ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
1662
+ CHAR_COLON: 58, /* : */
1663
+ CHAR_COMMA: 44, /* , */
1664
+ CHAR_DOT: 46, /* . */
1665
+ CHAR_DOUBLE_QUOTE: 34, /* " */
1666
+ CHAR_EQUAL: 61, /* = */
1667
+ CHAR_EXCLAMATION_MARK: 33, /* ! */
1668
+ CHAR_FORM_FEED: 12, /* \f */
1669
+ CHAR_FORWARD_SLASH: 47, /* / */
1670
+ CHAR_GRAVE_ACCENT: 96, /* ` */
1671
+ CHAR_HASH: 35, /* # */
1672
+ CHAR_HYPHEN_MINUS: 45, /* - */
1673
+ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
1674
+ CHAR_LEFT_CURLY_BRACE: 123, /* { */
1675
+ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
1676
+ CHAR_LINE_FEED: 10, /* \n */
1677
+ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
1678
+ CHAR_PERCENT: 37, /* % */
1679
+ CHAR_PLUS: 43, /* + */
1680
+ CHAR_QUESTION_MARK: 63, /* ? */
1681
+ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
1682
+ CHAR_RIGHT_CURLY_BRACE: 125, /* } */
1683
+ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
1684
+ CHAR_SEMICOLON: 59, /* ; */
1685
+ CHAR_SINGLE_QUOTE: 39, /* ' */
1686
+ CHAR_SPACE: 32, /* */
1687
+ CHAR_TAB: 9, /* \t */
1688
+ CHAR_UNDERSCORE: 95, /* _ */
1689
+ CHAR_VERTICAL_LINE: 124, /* | */
1690
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
1691
+
1692
+ SEP: path.sep,
1693
+
1694
+ /**
1695
+ * Create EXTGLOB_CHARS
1696
+ */
1697
+
1698
+ extglobChars(chars) {
1699
+ return {
1700
+ '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
1701
+ '?': { type: 'qmark', open: '(?:', close: ')?' },
1702
+ '+': { type: 'plus', open: '(?:', close: ')+' },
1703
+ '*': { type: 'star', open: '(?:', close: ')*' },
1704
+ '@': { type: 'at', open: '(?:', close: ')' }
1705
+ };
1706
+ },
1707
+
1708
+ /**
1709
+ * Create GLOB_CHARS
1710
+ */
1711
+
1712
+ globChars(win32) {
1713
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
1714
+ }
1715
+ };
1716
+ return constants;
1717
+ }
1718
+
1719
+ var hasRequiredUtils;
1720
+
1721
+ function requireUtils () {
1722
+ if (hasRequiredUtils) return utils;
1723
+ hasRequiredUtils = 1;
1724
+ (function (exports) {
1725
+
1726
+ const path = require$$0$1;
1727
+ const win32 = process.platform === 'win32';
1728
+ const {
1729
+ REGEX_BACKSLASH,
1730
+ REGEX_REMOVE_BACKSLASH,
1731
+ REGEX_SPECIAL_CHARS,
1732
+ REGEX_SPECIAL_CHARS_GLOBAL
1733
+ } = requireConstants();
1734
+
1735
+ exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
1736
+ exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
1737
+ exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
1738
+ exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
1739
+ exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
1740
+
1741
+ exports.removeBackslashes = str => {
1742
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
1743
+ return match === '\\' ? '' : match;
1744
+ });
1745
+ };
1746
+
1747
+ exports.supportsLookbehinds = () => {
1748
+ const segs = process.version.slice(1).split('.').map(Number);
1749
+ if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
1750
+ return true;
1751
+ }
1752
+ return false;
1753
+ };
1754
+
1755
+ exports.isWindows = options => {
1756
+ if (options && typeof options.windows === 'boolean') {
1757
+ return options.windows;
1758
+ }
1759
+ return win32 === true || path.sep === '\\';
1760
+ };
1761
+
1762
+ exports.escapeLast = (input, char, lastIdx) => {
1763
+ const idx = input.lastIndexOf(char, lastIdx);
1764
+ if (idx === -1) return input;
1765
+ if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
1766
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
1767
+ };
1768
+
1769
+ exports.removePrefix = (input, state = {}) => {
1770
+ let output = input;
1771
+ if (output.startsWith('./')) {
1772
+ output = output.slice(2);
1773
+ state.prefix = './';
1774
+ }
1775
+ return output;
1776
+ };
1777
+
1778
+ exports.wrapOutput = (input, state = {}, options = {}) => {
1779
+ const prepend = options.contains ? '' : '^';
1780
+ const append = options.contains ? '' : '$';
1781
+
1782
+ let output = `${prepend}(?:${input})${append}`;
1783
+ if (state.negated === true) {
1784
+ output = `(?:^(?!${output}).*$)`;
1785
+ }
1786
+ return output;
1787
+ };
1788
+ } (utils));
1789
+ return utils;
1790
+ }
1791
+
1792
+ var scan_1;
1793
+ var hasRequiredScan;
1794
+
1795
+ function requireScan () {
1796
+ if (hasRequiredScan) return scan_1;
1797
+ hasRequiredScan = 1;
1798
+
1799
+ const utils = requireUtils();
1800
+ const {
1801
+ CHAR_ASTERISK, /* * */
1802
+ CHAR_AT, /* @ */
1803
+ CHAR_BACKWARD_SLASH, /* \ */
1804
+ CHAR_COMMA, /* , */
1805
+ CHAR_DOT, /* . */
1806
+ CHAR_EXCLAMATION_MARK, /* ! */
1807
+ CHAR_FORWARD_SLASH, /* / */
1808
+ CHAR_LEFT_CURLY_BRACE, /* { */
1809
+ CHAR_LEFT_PARENTHESES, /* ( */
1810
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
1811
+ CHAR_PLUS, /* + */
1812
+ CHAR_QUESTION_MARK, /* ? */
1813
+ CHAR_RIGHT_CURLY_BRACE, /* } */
1814
+ CHAR_RIGHT_PARENTHESES, /* ) */
1815
+ CHAR_RIGHT_SQUARE_BRACKET /* ] */
1816
+ } = requireConstants();
1817
+
1818
+ const isPathSeparator = code => {
1819
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
1820
+ };
1821
+
1822
+ const depth = token => {
1823
+ if (token.isPrefix !== true) {
1824
+ token.depth = token.isGlobstar ? Infinity : 1;
1825
+ }
1826
+ };
1827
+
1828
+ /**
1829
+ * Quickly scans a glob pattern and returns an object with a handful of
1830
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
1831
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
1832
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
1833
+ *
1834
+ * ```js
1835
+ * const pm = require('picomatch');
1836
+ * console.log(pm.scan('foo/bar/*.js'));
1837
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
1838
+ * ```
1839
+ * @param {String} `str`
1840
+ * @param {Object} `options`
1841
+ * @return {Object} Returns an object with tokens and regex source string.
1842
+ * @api public
1843
+ */
1844
+
1845
+ const scan = (input, options) => {
1846
+ const opts = options || {};
1847
+
1848
+ const length = input.length - 1;
1849
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
1850
+ const slashes = [];
1851
+ const tokens = [];
1852
+ const parts = [];
1853
+
1854
+ let str = input;
1855
+ let index = -1;
1856
+ let start = 0;
1857
+ let lastIndex = 0;
1858
+ let isBrace = false;
1859
+ let isBracket = false;
1860
+ let isGlob = false;
1861
+ let isExtglob = false;
1862
+ let isGlobstar = false;
1863
+ let braceEscaped = false;
1864
+ let backslashes = false;
1865
+ let negated = false;
1866
+ let negatedExtglob = false;
1867
+ let finished = false;
1868
+ let braces = 0;
1869
+ let prev;
1870
+ let code;
1871
+ let token = { value: '', depth: 0, isGlob: false };
1872
+
1873
+ const eos = () => index >= length;
1874
+ const peek = () => str.charCodeAt(index + 1);
1875
+ const advance = () => {
1876
+ prev = code;
1877
+ return str.charCodeAt(++index);
1878
+ };
1879
+
1880
+ while (index < length) {
1881
+ code = advance();
1882
+ let next;
1883
+
1884
+ if (code === CHAR_BACKWARD_SLASH) {
1885
+ backslashes = token.backslashes = true;
1886
+ code = advance();
1887
+
1888
+ if (code === CHAR_LEFT_CURLY_BRACE) {
1889
+ braceEscaped = true;
1890
+ }
1891
+ continue;
1892
+ }
1893
+
1894
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
1895
+ braces++;
1896
+
1897
+ while (eos() !== true && (code = advance())) {
1898
+ if (code === CHAR_BACKWARD_SLASH) {
1899
+ backslashes = token.backslashes = true;
1900
+ advance();
1901
+ continue;
1902
+ }
1903
+
1904
+ if (code === CHAR_LEFT_CURLY_BRACE) {
1905
+ braces++;
1906
+ continue;
1907
+ }
1908
+
1909
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
1910
+ isBrace = token.isBrace = true;
1911
+ isGlob = token.isGlob = true;
1912
+ finished = true;
1913
+
1914
+ if (scanToEnd === true) {
1915
+ continue;
1916
+ }
1917
+
1918
+ break;
1919
+ }
1920
+
1921
+ if (braceEscaped !== true && code === CHAR_COMMA) {
1922
+ isBrace = token.isBrace = true;
1923
+ isGlob = token.isGlob = true;
1924
+ finished = true;
1925
+
1926
+ if (scanToEnd === true) {
1927
+ continue;
1928
+ }
1929
+
1930
+ break;
1931
+ }
1932
+
1933
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
1934
+ braces--;
1935
+
1936
+ if (braces === 0) {
1937
+ braceEscaped = false;
1938
+ isBrace = token.isBrace = true;
1939
+ finished = true;
1940
+ break;
1941
+ }
1942
+ }
1943
+ }
1944
+
1945
+ if (scanToEnd === true) {
1946
+ continue;
1947
+ }
1948
+
1949
+ break;
1950
+ }
1951
+
1952
+ if (code === CHAR_FORWARD_SLASH) {
1953
+ slashes.push(index);
1954
+ tokens.push(token);
1955
+ token = { value: '', depth: 0, isGlob: false };
1956
+
1957
+ if (finished === true) continue;
1958
+ if (prev === CHAR_DOT && index === (start + 1)) {
1959
+ start += 2;
1960
+ continue;
1961
+ }
1962
+
1963
+ lastIndex = index + 1;
1964
+ continue;
1965
+ }
1966
+
1967
+ if (opts.noext !== true) {
1968
+ const isExtglobChar = code === CHAR_PLUS
1969
+ || code === CHAR_AT
1970
+ || code === CHAR_ASTERISK
1971
+ || code === CHAR_QUESTION_MARK
1972
+ || code === CHAR_EXCLAMATION_MARK;
1973
+
1974
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
1975
+ isGlob = token.isGlob = true;
1976
+ isExtglob = token.isExtglob = true;
1977
+ finished = true;
1978
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
1979
+ negatedExtglob = true;
1980
+ }
1981
+
1982
+ if (scanToEnd === true) {
1983
+ while (eos() !== true && (code = advance())) {
1984
+ if (code === CHAR_BACKWARD_SLASH) {
1985
+ backslashes = token.backslashes = true;
1986
+ code = advance();
1987
+ continue;
1988
+ }
1989
+
1990
+ if (code === CHAR_RIGHT_PARENTHESES) {
1991
+ isGlob = token.isGlob = true;
1992
+ finished = true;
1993
+ break;
1994
+ }
1995
+ }
1996
+ continue;
1997
+ }
1998
+ break;
1999
+ }
2000
+ }
2001
+
2002
+ if (code === CHAR_ASTERISK) {
2003
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
2004
+ isGlob = token.isGlob = true;
2005
+ finished = true;
2006
+
2007
+ if (scanToEnd === true) {
2008
+ continue;
2009
+ }
2010
+ break;
2011
+ }
2012
+
2013
+ if (code === CHAR_QUESTION_MARK) {
2014
+ isGlob = token.isGlob = true;
2015
+ finished = true;
2016
+
2017
+ if (scanToEnd === true) {
2018
+ continue;
2019
+ }
2020
+ break;
2021
+ }
2022
+
2023
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
2024
+ while (eos() !== true && (next = advance())) {
2025
+ if (next === CHAR_BACKWARD_SLASH) {
2026
+ backslashes = token.backslashes = true;
2027
+ advance();
2028
+ continue;
2029
+ }
2030
+
2031
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
2032
+ isBracket = token.isBracket = true;
2033
+ isGlob = token.isGlob = true;
2034
+ finished = true;
2035
+ break;
2036
+ }
2037
+ }
2038
+
2039
+ if (scanToEnd === true) {
2040
+ continue;
2041
+ }
2042
+
2043
+ break;
2044
+ }
2045
+
2046
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
2047
+ negated = token.negated = true;
2048
+ start++;
2049
+ continue;
2050
+ }
2051
+
2052
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
2053
+ isGlob = token.isGlob = true;
2054
+
2055
+ if (scanToEnd === true) {
2056
+ while (eos() !== true && (code = advance())) {
2057
+ if (code === CHAR_LEFT_PARENTHESES) {
2058
+ backslashes = token.backslashes = true;
2059
+ code = advance();
2060
+ continue;
2061
+ }
2062
+
2063
+ if (code === CHAR_RIGHT_PARENTHESES) {
2064
+ finished = true;
2065
+ break;
2066
+ }
2067
+ }
2068
+ continue;
2069
+ }
2070
+ break;
2071
+ }
2072
+
2073
+ if (isGlob === true) {
2074
+ finished = true;
2075
+
2076
+ if (scanToEnd === true) {
2077
+ continue;
2078
+ }
2079
+
2080
+ break;
2081
+ }
2082
+ }
2083
+
2084
+ if (opts.noext === true) {
2085
+ isExtglob = false;
2086
+ isGlob = false;
2087
+ }
2088
+
2089
+ let base = str;
2090
+ let prefix = '';
2091
+ let glob = '';
2092
+
2093
+ if (start > 0) {
2094
+ prefix = str.slice(0, start);
2095
+ str = str.slice(start);
2096
+ lastIndex -= start;
2097
+ }
2098
+
2099
+ if (base && isGlob === true && lastIndex > 0) {
2100
+ base = str.slice(0, lastIndex);
2101
+ glob = str.slice(lastIndex);
2102
+ } else if (isGlob === true) {
2103
+ base = '';
2104
+ glob = str;
2105
+ } else {
2106
+ base = str;
2107
+ }
2108
+
2109
+ if (base && base !== '' && base !== '/' && base !== str) {
2110
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
2111
+ base = base.slice(0, -1);
2112
+ }
2113
+ }
2114
+
2115
+ if (opts.unescape === true) {
2116
+ if (glob) glob = utils.removeBackslashes(glob);
2117
+
2118
+ if (base && backslashes === true) {
2119
+ base = utils.removeBackslashes(base);
2120
+ }
2121
+ }
2122
+
2123
+ const state = {
2124
+ prefix,
2125
+ input,
2126
+ start,
2127
+ base,
2128
+ glob,
2129
+ isBrace,
2130
+ isBracket,
2131
+ isGlob,
2132
+ isExtglob,
2133
+ isGlobstar,
2134
+ negated,
2135
+ negatedExtglob
2136
+ };
2137
+
2138
+ if (opts.tokens === true) {
2139
+ state.maxDepth = 0;
2140
+ if (!isPathSeparator(code)) {
2141
+ tokens.push(token);
2142
+ }
2143
+ state.tokens = tokens;
2144
+ }
2145
+
2146
+ if (opts.parts === true || opts.tokens === true) {
2147
+ let prevIndex;
2148
+
2149
+ for (let idx = 0; idx < slashes.length; idx++) {
2150
+ const n = prevIndex ? prevIndex + 1 : start;
2151
+ const i = slashes[idx];
2152
+ const value = input.slice(n, i);
2153
+ if (opts.tokens) {
2154
+ if (idx === 0 && start !== 0) {
2155
+ tokens[idx].isPrefix = true;
2156
+ tokens[idx].value = prefix;
2157
+ } else {
2158
+ tokens[idx].value = value;
2159
+ }
2160
+ depth(tokens[idx]);
2161
+ state.maxDepth += tokens[idx].depth;
2162
+ }
2163
+ if (idx !== 0 || value !== '') {
2164
+ parts.push(value);
2165
+ }
2166
+ prevIndex = i;
2167
+ }
2168
+
2169
+ if (prevIndex && prevIndex + 1 < input.length) {
2170
+ const value = input.slice(prevIndex + 1);
2171
+ parts.push(value);
2172
+
2173
+ if (opts.tokens) {
2174
+ tokens[tokens.length - 1].value = value;
2175
+ depth(tokens[tokens.length - 1]);
2176
+ state.maxDepth += tokens[tokens.length - 1].depth;
2177
+ }
2178
+ }
2179
+
2180
+ state.slashes = slashes;
2181
+ state.parts = parts;
2182
+ }
2183
+
2184
+ return state;
2185
+ };
2186
+
2187
+ scan_1 = scan;
2188
+ return scan_1;
2189
+ }
2190
+
2191
+ var parse_1;
2192
+ var hasRequiredParse;
2193
+
2194
+ function requireParse () {
2195
+ if (hasRequiredParse) return parse_1;
2196
+ hasRequiredParse = 1;
2197
+
2198
+ const constants = requireConstants();
2199
+ const utils = requireUtils();
2200
+
2201
+ /**
2202
+ * Constants
2203
+ */
2204
+
2205
+ const {
2206
+ MAX_LENGTH,
2207
+ POSIX_REGEX_SOURCE,
2208
+ REGEX_NON_SPECIAL_CHARS,
2209
+ REGEX_SPECIAL_CHARS_BACKREF,
2210
+ REPLACEMENTS
2211
+ } = constants;
2212
+
2213
+ /**
2214
+ * Helpers
2215
+ */
2216
+
2217
+ const expandRange = (args, options) => {
2218
+ if (typeof options.expandRange === 'function') {
2219
+ return options.expandRange(...args, options);
2220
+ }
2221
+
2222
+ args.sort();
2223
+ const value = `[${args.join('-')}]`;
2224
+
2225
+ try {
2226
+ /* eslint-disable-next-line no-new */
2227
+ new RegExp(value);
2228
+ } catch (ex) {
2229
+ return args.map(v => utils.escapeRegex(v)).join('..');
2230
+ }
2231
+
2232
+ return value;
2233
+ };
2234
+
2235
+ /**
2236
+ * Create the message for a syntax error
2237
+ */
2238
+
2239
+ const syntaxError = (type, char) => {
2240
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
2241
+ };
2242
+
2243
+ /**
2244
+ * Parse the given input string.
2245
+ * @param {String} input
2246
+ * @param {Object} options
2247
+ * @return {Object}
2248
+ */
2249
+
2250
+ const parse = (input, options) => {
2251
+ if (typeof input !== 'string') {
2252
+ throw new TypeError('Expected a string');
2253
+ }
2254
+
2255
+ input = REPLACEMENTS[input] || input;
2256
+
2257
+ const opts = { ...options };
2258
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
2259
+
2260
+ let len = input.length;
2261
+ if (len > max) {
2262
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
2263
+ }
2264
+
2265
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
2266
+ const tokens = [bos];
2267
+
2268
+ const capture = opts.capture ? '' : '?:';
2269
+ const win32 = utils.isWindows(options);
2270
+
2271
+ // create constants based on platform, for windows or posix
2272
+ const PLATFORM_CHARS = constants.globChars(win32);
2273
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
2274
+
2275
+ const {
2276
+ DOT_LITERAL,
2277
+ PLUS_LITERAL,
2278
+ SLASH_LITERAL,
2279
+ ONE_CHAR,
2280
+ DOTS_SLASH,
2281
+ NO_DOT,
2282
+ NO_DOT_SLASH,
2283
+ NO_DOTS_SLASH,
2284
+ QMARK,
2285
+ QMARK_NO_DOT,
2286
+ STAR,
2287
+ START_ANCHOR
2288
+ } = PLATFORM_CHARS;
2289
+
2290
+ const globstar = opts => {
2291
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
2292
+ };
2293
+
2294
+ const nodot = opts.dot ? '' : NO_DOT;
2295
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
2296
+ let star = opts.bash === true ? globstar(opts) : STAR;
2297
+
2298
+ if (opts.capture) {
2299
+ star = `(${star})`;
2300
+ }
2301
+
2302
+ // minimatch options support
2303
+ if (typeof opts.noext === 'boolean') {
2304
+ opts.noextglob = opts.noext;
2305
+ }
2306
+
2307
+ const state = {
2308
+ input,
2309
+ index: -1,
2310
+ start: 0,
2311
+ dot: opts.dot === true,
2312
+ consumed: '',
2313
+ output: '',
2314
+ prefix: '',
2315
+ backtrack: false,
2316
+ negated: false,
2317
+ brackets: 0,
2318
+ braces: 0,
2319
+ parens: 0,
2320
+ quotes: 0,
2321
+ globstar: false,
2322
+ tokens
2323
+ };
2324
+
2325
+ input = utils.removePrefix(input, state);
2326
+ len = input.length;
2327
+
2328
+ const extglobs = [];
2329
+ const braces = [];
2330
+ const stack = [];
2331
+ let prev = bos;
2332
+ let value;
2333
+
2334
+ /**
2335
+ * Tokenizing helpers
2336
+ */
2337
+
2338
+ const eos = () => state.index === len - 1;
2339
+ const peek = state.peek = (n = 1) => input[state.index + n];
2340
+ const advance = state.advance = () => input[++state.index] || '';
2341
+ const remaining = () => input.slice(state.index + 1);
2342
+ const consume = (value = '', num = 0) => {
2343
+ state.consumed += value;
2344
+ state.index += num;
2345
+ };
2346
+
2347
+ const append = token => {
2348
+ state.output += token.output != null ? token.output : token.value;
2349
+ consume(token.value);
2350
+ };
2351
+
2352
+ const negate = () => {
2353
+ let count = 1;
2354
+
2355
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
2356
+ advance();
2357
+ state.start++;
2358
+ count++;
2359
+ }
2360
+
2361
+ if (count % 2 === 0) {
2362
+ return false;
2363
+ }
2364
+
2365
+ state.negated = true;
2366
+ state.start++;
2367
+ return true;
2368
+ };
2369
+
2370
+ const increment = type => {
2371
+ state[type]++;
2372
+ stack.push(type);
2373
+ };
2374
+
2375
+ const decrement = type => {
2376
+ state[type]--;
2377
+ stack.pop();
2378
+ };
2379
+
2380
+ /**
2381
+ * Push tokens onto the tokens array. This helper speeds up
2382
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
2383
+ * and 2) helping us avoid creating extra tokens when consecutive
2384
+ * characters are plain text. This improves performance and simplifies
2385
+ * lookbehinds.
2386
+ */
2387
+
2388
+ const push = tok => {
2389
+ if (prev.type === 'globstar') {
2390
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
2391
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
2392
+
2393
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
2394
+ state.output = state.output.slice(0, -prev.output.length);
2395
+ prev.type = 'star';
2396
+ prev.value = '*';
2397
+ prev.output = star;
2398
+ state.output += prev.output;
2399
+ }
2400
+ }
2401
+
2402
+ if (extglobs.length && tok.type !== 'paren') {
2403
+ extglobs[extglobs.length - 1].inner += tok.value;
2404
+ }
2405
+
2406
+ if (tok.value || tok.output) append(tok);
2407
+ if (prev && prev.type === 'text' && tok.type === 'text') {
2408
+ prev.value += tok.value;
2409
+ prev.output = (prev.output || '') + tok.value;
2410
+ return;
2411
+ }
2412
+
2413
+ tok.prev = prev;
2414
+ tokens.push(tok);
2415
+ prev = tok;
2416
+ };
2417
+
2418
+ const extglobOpen = (type, value) => {
2419
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
2420
+
2421
+ token.prev = prev;
2422
+ token.parens = state.parens;
2423
+ token.output = state.output;
2424
+ const output = (opts.capture ? '(' : '') + token.open;
2425
+
2426
+ increment('parens');
2427
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
2428
+ push({ type: 'paren', extglob: true, value: advance(), output });
2429
+ extglobs.push(token);
2430
+ };
2431
+
2432
+ const extglobClose = token => {
2433
+ let output = token.close + (opts.capture ? ')' : '');
2434
+ let rest;
2435
+
2436
+ if (token.type === 'negate') {
2437
+ let extglobStar = star;
2438
+
2439
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
2440
+ extglobStar = globstar(opts);
2441
+ }
2442
+
2443
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
2444
+ output = token.close = `)$))${extglobStar}`;
2445
+ }
2446
+
2447
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
2448
+ // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
2449
+ // In this case, we need to parse the string and use it in the output of the original pattern.
2450
+ // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
2451
+ //
2452
+ // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
2453
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
2454
+
2455
+ output = token.close = `)${expression})${extglobStar})`;
2456
+ }
2457
+
2458
+ if (token.prev.type === 'bos') {
2459
+ state.negatedExtglob = true;
2460
+ }
2461
+ }
2462
+
2463
+ push({ type: 'paren', extglob: true, value, output });
2464
+ decrement('parens');
2465
+ };
2466
+
2467
+ /**
2468
+ * Fast paths
2469
+ */
2470
+
2471
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
2472
+ let backslashes = false;
2473
+
2474
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
2475
+ if (first === '\\') {
2476
+ backslashes = true;
2477
+ return m;
2478
+ }
2479
+
2480
+ if (first === '?') {
2481
+ if (esc) {
2482
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
2483
+ }
2484
+ if (index === 0) {
2485
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
2486
+ }
2487
+ return QMARK.repeat(chars.length);
2488
+ }
2489
+
2490
+ if (first === '.') {
2491
+ return DOT_LITERAL.repeat(chars.length);
2492
+ }
2493
+
2494
+ if (first === '*') {
2495
+ if (esc) {
2496
+ return esc + first + (rest ? star : '');
2497
+ }
2498
+ return star;
2499
+ }
2500
+ return esc ? m : `\\${m}`;
2501
+ });
2502
+
2503
+ if (backslashes === true) {
2504
+ if (opts.unescape === true) {
2505
+ output = output.replace(/\\/g, '');
2506
+ } else {
2507
+ output = output.replace(/\\+/g, m => {
2508
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
2509
+ });
2510
+ }
2511
+ }
2512
+
2513
+ if (output === input && opts.contains === true) {
2514
+ state.output = input;
2515
+ return state;
2516
+ }
2517
+
2518
+ state.output = utils.wrapOutput(output, state, options);
2519
+ return state;
2520
+ }
2521
+
2522
+ /**
2523
+ * Tokenize input until we reach end-of-string
2524
+ */
2525
+
2526
+ while (!eos()) {
2527
+ value = advance();
2528
+
2529
+ if (value === '\u0000') {
2530
+ continue;
2531
+ }
2532
+
2533
+ /**
2534
+ * Escaped characters
2535
+ */
2536
+
2537
+ if (value === '\\') {
2538
+ const next = peek();
2539
+
2540
+ if (next === '/' && opts.bash !== true) {
2541
+ continue;
2542
+ }
2543
+
2544
+ if (next === '.' || next === ';') {
2545
+ continue;
2546
+ }
2547
+
2548
+ if (!next) {
2549
+ value += '\\';
2550
+ push({ type: 'text', value });
2551
+ continue;
2552
+ }
2553
+
2554
+ // collapse slashes to reduce potential for exploits
2555
+ const match = /^\\+/.exec(remaining());
2556
+ let slashes = 0;
2557
+
2558
+ if (match && match[0].length > 2) {
2559
+ slashes = match[0].length;
2560
+ state.index += slashes;
2561
+ if (slashes % 2 !== 0) {
2562
+ value += '\\';
2563
+ }
2564
+ }
2565
+
2566
+ if (opts.unescape === true) {
2567
+ value = advance();
2568
+ } else {
2569
+ value += advance();
2570
+ }
2571
+
2572
+ if (state.brackets === 0) {
2573
+ push({ type: 'text', value });
2574
+ continue;
2575
+ }
2576
+ }
2577
+
2578
+ /**
2579
+ * If we're inside a regex character class, continue
2580
+ * until we reach the closing bracket.
2581
+ */
2582
+
2583
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
2584
+ if (opts.posix !== false && value === ':') {
2585
+ const inner = prev.value.slice(1);
2586
+ if (inner.includes('[')) {
2587
+ prev.posix = true;
2588
+
2589
+ if (inner.includes(':')) {
2590
+ const idx = prev.value.lastIndexOf('[');
2591
+ const pre = prev.value.slice(0, idx);
2592
+ const rest = prev.value.slice(idx + 2);
2593
+ const posix = POSIX_REGEX_SOURCE[rest];
2594
+ if (posix) {
2595
+ prev.value = pre + posix;
2596
+ state.backtrack = true;
2597
+ advance();
2598
+
2599
+ if (!bos.output && tokens.indexOf(prev) === 1) {
2600
+ bos.output = ONE_CHAR;
2601
+ }
2602
+ continue;
2603
+ }
2604
+ }
2605
+ }
2606
+ }
2607
+
2608
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
2609
+ value = `\\${value}`;
2610
+ }
2611
+
2612
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
2613
+ value = `\\${value}`;
2614
+ }
2615
+
2616
+ if (opts.posix === true && value === '!' && prev.value === '[') {
2617
+ value = '^';
2618
+ }
2619
+
2620
+ prev.value += value;
2621
+ append({ value });
2622
+ continue;
2623
+ }
2624
+
2625
+ /**
2626
+ * If we're inside a quoted string, continue
2627
+ * until we reach the closing double quote.
2628
+ */
2629
+
2630
+ if (state.quotes === 1 && value !== '"') {
2631
+ value = utils.escapeRegex(value);
2632
+ prev.value += value;
2633
+ append({ value });
2634
+ continue;
2635
+ }
2636
+
2637
+ /**
2638
+ * Double quotes
2639
+ */
2640
+
2641
+ if (value === '"') {
2642
+ state.quotes = state.quotes === 1 ? 0 : 1;
2643
+ if (opts.keepQuotes === true) {
2644
+ push({ type: 'text', value });
2645
+ }
2646
+ continue;
2647
+ }
2648
+
2649
+ /**
2650
+ * Parentheses
2651
+ */
2652
+
2653
+ if (value === '(') {
2654
+ increment('parens');
2655
+ push({ type: 'paren', value });
2656
+ continue;
2657
+ }
2658
+
2659
+ if (value === ')') {
2660
+ if (state.parens === 0 && opts.strictBrackets === true) {
2661
+ throw new SyntaxError(syntaxError('opening', '('));
2662
+ }
2663
+
2664
+ const extglob = extglobs[extglobs.length - 1];
2665
+ if (extglob && state.parens === extglob.parens + 1) {
2666
+ extglobClose(extglobs.pop());
2667
+ continue;
2668
+ }
2669
+
2670
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
2671
+ decrement('parens');
2672
+ continue;
2673
+ }
2674
+
2675
+ /**
2676
+ * Square brackets
2677
+ */
2678
+
2679
+ if (value === '[') {
2680
+ if (opts.nobracket === true || !remaining().includes(']')) {
2681
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
2682
+ throw new SyntaxError(syntaxError('closing', ']'));
2683
+ }
2684
+
2685
+ value = `\\${value}`;
2686
+ } else {
2687
+ increment('brackets');
2688
+ }
2689
+
2690
+ push({ type: 'bracket', value });
2691
+ continue;
2692
+ }
2693
+
2694
+ if (value === ']') {
2695
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
2696
+ push({ type: 'text', value, output: `\\${value}` });
2697
+ continue;
2698
+ }
2699
+
2700
+ if (state.brackets === 0) {
2701
+ if (opts.strictBrackets === true) {
2702
+ throw new SyntaxError(syntaxError('opening', '['));
2703
+ }
2704
+
2705
+ push({ type: 'text', value, output: `\\${value}` });
2706
+ continue;
2707
+ }
2708
+
2709
+ decrement('brackets');
2710
+
2711
+ const prevValue = prev.value.slice(1);
2712
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
2713
+ value = `/${value}`;
2714
+ }
2715
+
2716
+ prev.value += value;
2717
+ append({ value });
2718
+
2719
+ // when literal brackets are explicitly disabled
2720
+ // assume we should match with a regex character class
2721
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
2722
+ continue;
2723
+ }
2724
+
2725
+ const escaped = utils.escapeRegex(prev.value);
2726
+ state.output = state.output.slice(0, -prev.value.length);
2727
+
2728
+ // when literal brackets are explicitly enabled
2729
+ // assume we should escape the brackets to match literal characters
2730
+ if (opts.literalBrackets === true) {
2731
+ state.output += escaped;
2732
+ prev.value = escaped;
2733
+ continue;
2734
+ }
2735
+
2736
+ // when the user specifies nothing, try to match both
2737
+ prev.value = `(${capture}${escaped}|${prev.value})`;
2738
+ state.output += prev.value;
2739
+ continue;
2740
+ }
2741
+
2742
+ /**
2743
+ * Braces
2744
+ */
2745
+
2746
+ if (value === '{' && opts.nobrace !== true) {
2747
+ increment('braces');
2748
+
2749
+ const open = {
2750
+ type: 'brace',
2751
+ value,
2752
+ output: '(',
2753
+ outputIndex: state.output.length,
2754
+ tokensIndex: state.tokens.length
2755
+ };
2756
+
2757
+ braces.push(open);
2758
+ push(open);
2759
+ continue;
2760
+ }
2761
+
2762
+ if (value === '}') {
2763
+ const brace = braces[braces.length - 1];
2764
+
2765
+ if (opts.nobrace === true || !brace) {
2766
+ push({ type: 'text', value, output: value });
2767
+ continue;
2768
+ }
2769
+
2770
+ let output = ')';
2771
+
2772
+ if (brace.dots === true) {
2773
+ const arr = tokens.slice();
2774
+ const range = [];
2775
+
2776
+ for (let i = arr.length - 1; i >= 0; i--) {
2777
+ tokens.pop();
2778
+ if (arr[i].type === 'brace') {
2779
+ break;
2780
+ }
2781
+ if (arr[i].type !== 'dots') {
2782
+ range.unshift(arr[i].value);
2783
+ }
2784
+ }
2785
+
2786
+ output = expandRange(range, opts);
2787
+ state.backtrack = true;
2788
+ }
2789
+
2790
+ if (brace.comma !== true && brace.dots !== true) {
2791
+ const out = state.output.slice(0, brace.outputIndex);
2792
+ const toks = state.tokens.slice(brace.tokensIndex);
2793
+ brace.value = brace.output = '\\{';
2794
+ value = output = '\\}';
2795
+ state.output = out;
2796
+ for (const t of toks) {
2797
+ state.output += (t.output || t.value);
2798
+ }
2799
+ }
2800
+
2801
+ push({ type: 'brace', value, output });
2802
+ decrement('braces');
2803
+ braces.pop();
2804
+ continue;
2805
+ }
2806
+
2807
+ /**
2808
+ * Pipes
2809
+ */
2810
+
2811
+ if (value === '|') {
2812
+ if (extglobs.length > 0) {
2813
+ extglobs[extglobs.length - 1].conditions++;
2814
+ }
2815
+ push({ type: 'text', value });
2816
+ continue;
2817
+ }
2818
+
2819
+ /**
2820
+ * Commas
2821
+ */
2822
+
2823
+ if (value === ',') {
2824
+ let output = value;
2825
+
2826
+ const brace = braces[braces.length - 1];
2827
+ if (brace && stack[stack.length - 1] === 'braces') {
2828
+ brace.comma = true;
2829
+ output = '|';
2830
+ }
2831
+
2832
+ push({ type: 'comma', value, output });
2833
+ continue;
2834
+ }
2835
+
2836
+ /**
2837
+ * Slashes
2838
+ */
2839
+
2840
+ if (value === '/') {
2841
+ // if the beginning of the glob is "./", advance the start
2842
+ // to the current index, and don't add the "./" characters
2843
+ // to the state. This greatly simplifies lookbehinds when
2844
+ // checking for BOS characters like "!" and "." (not "./")
2845
+ if (prev.type === 'dot' && state.index === state.start + 1) {
2846
+ state.start = state.index + 1;
2847
+ state.consumed = '';
2848
+ state.output = '';
2849
+ tokens.pop();
2850
+ prev = bos; // reset "prev" to the first token
2851
+ continue;
2852
+ }
2853
+
2854
+ push({ type: 'slash', value, output: SLASH_LITERAL });
2855
+ continue;
2856
+ }
2857
+
2858
+ /**
2859
+ * Dots
2860
+ */
2861
+
2862
+ if (value === '.') {
2863
+ if (state.braces > 0 && prev.type === 'dot') {
2864
+ if (prev.value === '.') prev.output = DOT_LITERAL;
2865
+ const brace = braces[braces.length - 1];
2866
+ prev.type = 'dots';
2867
+ prev.output += value;
2868
+ prev.value += value;
2869
+ brace.dots = true;
2870
+ continue;
2871
+ }
2872
+
2873
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
2874
+ push({ type: 'text', value, output: DOT_LITERAL });
2875
+ continue;
2876
+ }
2877
+
2878
+ push({ type: 'dot', value, output: DOT_LITERAL });
2879
+ continue;
2880
+ }
2881
+
2882
+ /**
2883
+ * Question marks
2884
+ */
2885
+
2886
+ if (value === '?') {
2887
+ const isGroup = prev && prev.value === '(';
2888
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
2889
+ extglobOpen('qmark', value);
2890
+ continue;
2891
+ }
2892
+
2893
+ if (prev && prev.type === 'paren') {
2894
+ const next = peek();
2895
+ let output = value;
2896
+
2897
+ if (next === '<' && !utils.supportsLookbehinds()) {
2898
+ throw new Error('Node.js v10 or higher is required for regex lookbehinds');
2899
+ }
2900
+
2901
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
2902
+ output = `\\${value}`;
2903
+ }
2904
+
2905
+ push({ type: 'text', value, output });
2906
+ continue;
2907
+ }
2908
+
2909
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
2910
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
2911
+ continue;
2912
+ }
2913
+
2914
+ push({ type: 'qmark', value, output: QMARK });
2915
+ continue;
2916
+ }
2917
+
2918
+ /**
2919
+ * Exclamation
2920
+ */
2921
+
2922
+ if (value === '!') {
2923
+ if (opts.noextglob !== true && peek() === '(') {
2924
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
2925
+ extglobOpen('negate', value);
2926
+ continue;
2927
+ }
2928
+ }
2929
+
2930
+ if (opts.nonegate !== true && state.index === 0) {
2931
+ negate();
2932
+ continue;
2933
+ }
2934
+ }
2935
+
2936
+ /**
2937
+ * Plus
2938
+ */
2939
+
2940
+ if (value === '+') {
2941
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
2942
+ extglobOpen('plus', value);
2943
+ continue;
2944
+ }
2945
+
2946
+ if ((prev && prev.value === '(') || opts.regex === false) {
2947
+ push({ type: 'plus', value, output: PLUS_LITERAL });
2948
+ continue;
2949
+ }
2950
+
2951
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
2952
+ push({ type: 'plus', value });
2953
+ continue;
2954
+ }
2955
+
2956
+ push({ type: 'plus', value: PLUS_LITERAL });
2957
+ continue;
2958
+ }
2959
+
2960
+ /**
2961
+ * Plain text
2962
+ */
2963
+
2964
+ if (value === '@') {
2965
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
2966
+ push({ type: 'at', extglob: true, value, output: '' });
2967
+ continue;
2968
+ }
2969
+
2970
+ push({ type: 'text', value });
2971
+ continue;
2972
+ }
2973
+
2974
+ /**
2975
+ * Plain text
2976
+ */
2977
+
2978
+ if (value !== '*') {
2979
+ if (value === '$' || value === '^') {
2980
+ value = `\\${value}`;
2981
+ }
2982
+
2983
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
2984
+ if (match) {
2985
+ value += match[0];
2986
+ state.index += match[0].length;
2987
+ }
2988
+
2989
+ push({ type: 'text', value });
2990
+ continue;
2991
+ }
2992
+
2993
+ /**
2994
+ * Stars
2995
+ */
2996
+
2997
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
2998
+ prev.type = 'star';
2999
+ prev.star = true;
3000
+ prev.value += value;
3001
+ prev.output = star;
3002
+ state.backtrack = true;
3003
+ state.globstar = true;
3004
+ consume(value);
3005
+ continue;
3006
+ }
3007
+
3008
+ let rest = remaining();
3009
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
3010
+ extglobOpen('star', value);
3011
+ continue;
3012
+ }
3013
+
3014
+ if (prev.type === 'star') {
3015
+ if (opts.noglobstar === true) {
3016
+ consume(value);
3017
+ continue;
3018
+ }
3019
+
3020
+ const prior = prev.prev;
3021
+ const before = prior.prev;
3022
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
3023
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
3024
+
3025
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
3026
+ push({ type: 'star', value, output: '' });
3027
+ continue;
3028
+ }
3029
+
3030
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
3031
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
3032
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
3033
+ push({ type: 'star', value, output: '' });
3034
+ continue;
3035
+ }
3036
+
3037
+ // strip consecutive `/**/`
3038
+ while (rest.slice(0, 3) === '/**') {
3039
+ const after = input[state.index + 4];
3040
+ if (after && after !== '/') {
3041
+ break;
3042
+ }
3043
+ rest = rest.slice(3);
3044
+ consume('/**', 3);
3045
+ }
3046
+
3047
+ if (prior.type === 'bos' && eos()) {
3048
+ prev.type = 'globstar';
3049
+ prev.value += value;
3050
+ prev.output = globstar(opts);
3051
+ state.output = prev.output;
3052
+ state.globstar = true;
3053
+ consume(value);
3054
+ continue;
3055
+ }
3056
+
3057
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
3058
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
3059
+ prior.output = `(?:${prior.output}`;
3060
+
3061
+ prev.type = 'globstar';
3062
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
3063
+ prev.value += value;
3064
+ state.globstar = true;
3065
+ state.output += prior.output + prev.output;
3066
+ consume(value);
3067
+ continue;
3068
+ }
3069
+
3070
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
3071
+ const end = rest[1] !== void 0 ? '|$' : '';
3072
+
3073
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
3074
+ prior.output = `(?:${prior.output}`;
3075
+
3076
+ prev.type = 'globstar';
3077
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
3078
+ prev.value += value;
3079
+
3080
+ state.output += prior.output + prev.output;
3081
+ state.globstar = true;
3082
+
3083
+ consume(value + advance());
3084
+
3085
+ push({ type: 'slash', value: '/', output: '' });
3086
+ continue;
3087
+ }
3088
+
3089
+ if (prior.type === 'bos' && rest[0] === '/') {
3090
+ prev.type = 'globstar';
3091
+ prev.value += value;
3092
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
3093
+ state.output = prev.output;
3094
+ state.globstar = true;
3095
+ consume(value + advance());
3096
+ push({ type: 'slash', value: '/', output: '' });
3097
+ continue;
3098
+ }
3099
+
3100
+ // remove single star from output
3101
+ state.output = state.output.slice(0, -prev.output.length);
3102
+
3103
+ // reset previous token to globstar
3104
+ prev.type = 'globstar';
3105
+ prev.output = globstar(opts);
3106
+ prev.value += value;
3107
+
3108
+ // reset output with globstar
3109
+ state.output += prev.output;
3110
+ state.globstar = true;
3111
+ consume(value);
3112
+ continue;
3113
+ }
3114
+
3115
+ const token = { type: 'star', value, output: star };
3116
+
3117
+ if (opts.bash === true) {
3118
+ token.output = '.*?';
3119
+ if (prev.type === 'bos' || prev.type === 'slash') {
3120
+ token.output = nodot + token.output;
3121
+ }
3122
+ push(token);
3123
+ continue;
3124
+ }
3125
+
3126
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
3127
+ token.output = value;
3128
+ push(token);
3129
+ continue;
3130
+ }
3131
+
3132
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
3133
+ if (prev.type === 'dot') {
3134
+ state.output += NO_DOT_SLASH;
3135
+ prev.output += NO_DOT_SLASH;
3136
+
3137
+ } else if (opts.dot === true) {
3138
+ state.output += NO_DOTS_SLASH;
3139
+ prev.output += NO_DOTS_SLASH;
3140
+
3141
+ } else {
3142
+ state.output += nodot;
3143
+ prev.output += nodot;
3144
+ }
3145
+
3146
+ if (peek() !== '*') {
3147
+ state.output += ONE_CHAR;
3148
+ prev.output += ONE_CHAR;
3149
+ }
3150
+ }
3151
+
3152
+ push(token);
3153
+ }
3154
+
3155
+ while (state.brackets > 0) {
3156
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
3157
+ state.output = utils.escapeLast(state.output, '[');
3158
+ decrement('brackets');
3159
+ }
3160
+
3161
+ while (state.parens > 0) {
3162
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
3163
+ state.output = utils.escapeLast(state.output, '(');
3164
+ decrement('parens');
3165
+ }
3166
+
3167
+ while (state.braces > 0) {
3168
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
3169
+ state.output = utils.escapeLast(state.output, '{');
3170
+ decrement('braces');
3171
+ }
3172
+
3173
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
3174
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
3175
+ }
3176
+
3177
+ // rebuild the output if we had to backtrack at any point
3178
+ if (state.backtrack === true) {
3179
+ state.output = '';
3180
+
3181
+ for (const token of state.tokens) {
3182
+ state.output += token.output != null ? token.output : token.value;
3183
+
3184
+ if (token.suffix) {
3185
+ state.output += token.suffix;
3186
+ }
3187
+ }
3188
+ }
3189
+
3190
+ return state;
3191
+ };
3192
+
3193
+ /**
3194
+ * Fast paths for creating regular expressions for common glob patterns.
3195
+ * This can significantly speed up processing and has very little downside
3196
+ * impact when none of the fast paths match.
3197
+ */
3198
+
3199
+ parse.fastpaths = (input, options) => {
3200
+ const opts = { ...options };
3201
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
3202
+ const len = input.length;
3203
+ if (len > max) {
3204
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
3205
+ }
3206
+
3207
+ input = REPLACEMENTS[input] || input;
3208
+ const win32 = utils.isWindows(options);
3209
+
3210
+ // create constants based on platform, for windows or posix
3211
+ const {
3212
+ DOT_LITERAL,
3213
+ SLASH_LITERAL,
3214
+ ONE_CHAR,
3215
+ DOTS_SLASH,
3216
+ NO_DOT,
3217
+ NO_DOTS,
3218
+ NO_DOTS_SLASH,
3219
+ STAR,
3220
+ START_ANCHOR
3221
+ } = constants.globChars(win32);
3222
+
3223
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
3224
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
3225
+ const capture = opts.capture ? '' : '?:';
3226
+ const state = { negated: false, prefix: '' };
3227
+ let star = opts.bash === true ? '.*?' : STAR;
3228
+
3229
+ if (opts.capture) {
3230
+ star = `(${star})`;
3231
+ }
3232
+
3233
+ const globstar = opts => {
3234
+ if (opts.noglobstar === true) return star;
3235
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
3236
+ };
3237
+
3238
+ const create = str => {
3239
+ switch (str) {
3240
+ case '*':
3241
+ return `${nodot}${ONE_CHAR}${star}`;
3242
+
3243
+ case '.*':
3244
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
3245
+
3246
+ case '*.*':
3247
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
3248
+
3249
+ case '*/*':
3250
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
3251
+
3252
+ case '**':
3253
+ return nodot + globstar(opts);
3254
+
3255
+ case '**/*':
3256
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
3257
+
3258
+ case '**/*.*':
3259
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
3260
+
3261
+ case '**/.*':
3262
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
3263
+
3264
+ default: {
3265
+ const match = /^(.*?)\.(\w+)$/.exec(str);
3266
+ if (!match) return;
3267
+
3268
+ const source = create(match[1]);
3269
+ if (!source) return;
3270
+
3271
+ return source + DOT_LITERAL + match[2];
3272
+ }
3273
+ }
3274
+ };
3275
+
3276
+ const output = utils.removePrefix(input, state);
3277
+ let source = create(output);
3278
+
3279
+ if (source && opts.strictSlashes !== true) {
3280
+ source += `${SLASH_LITERAL}?`;
3281
+ }
3282
+
3283
+ return source;
3284
+ };
3285
+
3286
+ parse_1 = parse;
3287
+ return parse_1;
3288
+ }
3289
+
3290
+ var picomatch_1;
3291
+ var hasRequiredPicomatch$1;
3292
+
3293
+ function requirePicomatch$1 () {
3294
+ if (hasRequiredPicomatch$1) return picomatch_1;
3295
+ hasRequiredPicomatch$1 = 1;
3296
+
3297
+ const path = require$$0$1;
3298
+ const scan = requireScan();
3299
+ const parse = requireParse();
3300
+ const utils = requireUtils();
3301
+ const constants = requireConstants();
3302
+ const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
3303
+
3304
+ /**
3305
+ * Creates a matcher function from one or more glob patterns. The
3306
+ * returned function takes a string to match as its first argument,
3307
+ * and returns true if the string is a match. The returned matcher
3308
+ * function also takes a boolean as the second argument that, when true,
3309
+ * returns an object with additional information.
3310
+ *
3311
+ * ```js
3312
+ * const picomatch = require('picomatch');
3313
+ * // picomatch(glob[, options]);
3314
+ *
3315
+ * const isMatch = picomatch('*.!(*a)');
3316
+ * console.log(isMatch('a.a')); //=> false
3317
+ * console.log(isMatch('a.b')); //=> true
3318
+ * ```
3319
+ * @name picomatch
3320
+ * @param {String|Array} `globs` One or more glob patterns.
3321
+ * @param {Object=} `options`
3322
+ * @return {Function=} Returns a matcher function.
3323
+ * @api public
3324
+ */
3325
+
3326
+ const picomatch = (glob, options, returnState = false) => {
3327
+ if (Array.isArray(glob)) {
3328
+ const fns = glob.map(input => picomatch(input, options, returnState));
3329
+ const arrayMatcher = str => {
3330
+ for (const isMatch of fns) {
3331
+ const state = isMatch(str);
3332
+ if (state) return state;
3333
+ }
3334
+ return false;
3335
+ };
3336
+ return arrayMatcher;
3337
+ }
3338
+
3339
+ const isState = isObject(glob) && glob.tokens && glob.input;
3340
+
3341
+ if (glob === '' || (typeof glob !== 'string' && !isState)) {
3342
+ throw new TypeError('Expected pattern to be a non-empty string');
3343
+ }
3344
+
3345
+ const opts = options || {};
3346
+ const posix = utils.isWindows(options);
3347
+ const regex = isState
3348
+ ? picomatch.compileRe(glob, options)
3349
+ : picomatch.makeRe(glob, options, false, true);
3350
+
3351
+ const state = regex.state;
3352
+ delete regex.state;
3353
+
3354
+ let isIgnored = () => false;
3355
+ if (opts.ignore) {
3356
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
3357
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
3358
+ }
3359
+
3360
+ const matcher = (input, returnObject = false) => {
3361
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
3362
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
3363
+
3364
+ if (typeof opts.onResult === 'function') {
3365
+ opts.onResult(result);
3366
+ }
3367
+
3368
+ if (isMatch === false) {
3369
+ result.isMatch = false;
3370
+ return returnObject ? result : false;
3371
+ }
3372
+
3373
+ if (isIgnored(input)) {
3374
+ if (typeof opts.onIgnore === 'function') {
3375
+ opts.onIgnore(result);
3376
+ }
3377
+ result.isMatch = false;
3378
+ return returnObject ? result : false;
3379
+ }
3380
+
3381
+ if (typeof opts.onMatch === 'function') {
3382
+ opts.onMatch(result);
3383
+ }
3384
+ return returnObject ? result : true;
3385
+ };
3386
+
3387
+ if (returnState) {
3388
+ matcher.state = state;
3389
+ }
3390
+
3391
+ return matcher;
3392
+ };
3393
+
3394
+ /**
3395
+ * Test `input` with the given `regex`. This is used by the main
3396
+ * `picomatch()` function to test the input string.
3397
+ *
3398
+ * ```js
3399
+ * const picomatch = require('picomatch');
3400
+ * // picomatch.test(input, regex[, options]);
3401
+ *
3402
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
3403
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
3404
+ * ```
3405
+ * @param {String} `input` String to test.
3406
+ * @param {RegExp} `regex`
3407
+ * @return {Object} Returns an object with matching info.
3408
+ * @api public
3409
+ */
3410
+
3411
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
3412
+ if (typeof input !== 'string') {
3413
+ throw new TypeError('Expected input to be a string');
3414
+ }
3415
+
3416
+ if (input === '') {
3417
+ return { isMatch: false, output: '' };
3418
+ }
3419
+
3420
+ const opts = options || {};
3421
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
3422
+ let match = input === glob;
3423
+ let output = (match && format) ? format(input) : input;
3424
+
3425
+ if (match === false) {
3426
+ output = format ? format(input) : input;
3427
+ match = output === glob;
3428
+ }
3429
+
3430
+ if (match === false || opts.capture === true) {
3431
+ if (opts.matchBase === true || opts.basename === true) {
3432
+ match = picomatch.matchBase(input, regex, options, posix);
3433
+ } else {
3434
+ match = regex.exec(output);
3435
+ }
3436
+ }
3437
+
3438
+ return { isMatch: Boolean(match), match, output };
3439
+ };
3440
+
3441
+ /**
3442
+ * Match the basename of a filepath.
3443
+ *
3444
+ * ```js
3445
+ * const picomatch = require('picomatch');
3446
+ * // picomatch.matchBase(input, glob[, options]);
3447
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
3448
+ * ```
3449
+ * @param {String} `input` String to test.
3450
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
3451
+ * @return {Boolean}
3452
+ * @api public
3453
+ */
3454
+
3455
+ picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
3456
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
3457
+ return regex.test(path.basename(input));
3458
+ };
3459
+
3460
+ /**
3461
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
3462
+ *
3463
+ * ```js
3464
+ * const picomatch = require('picomatch');
3465
+ * // picomatch.isMatch(string, patterns[, options]);
3466
+ *
3467
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
3468
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
3469
+ * ```
3470
+ * @param {String|Array} str The string to test.
3471
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
3472
+ * @param {Object} [options] See available [options](#options).
3473
+ * @return {Boolean} Returns true if any patterns match `str`
3474
+ * @api public
3475
+ */
3476
+
3477
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
3478
+
3479
+ /**
3480
+ * Parse a glob pattern to create the source string for a regular
3481
+ * expression.
3482
+ *
3483
+ * ```js
3484
+ * const picomatch = require('picomatch');
3485
+ * const result = picomatch.parse(pattern[, options]);
3486
+ * ```
3487
+ * @param {String} `pattern`
3488
+ * @param {Object} `options`
3489
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
3490
+ * @api public
3491
+ */
3492
+
3493
+ picomatch.parse = (pattern, options) => {
3494
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
3495
+ return parse(pattern, { ...options, fastpaths: false });
3496
+ };
3497
+
3498
+ /**
3499
+ * Scan a glob pattern to separate the pattern into segments.
3500
+ *
3501
+ * ```js
3502
+ * const picomatch = require('picomatch');
3503
+ * // picomatch.scan(input[, options]);
3504
+ *
3505
+ * const result = picomatch.scan('!./foo/*.js');
3506
+ * console.log(result);
3507
+ * { prefix: '!./',
3508
+ * input: '!./foo/*.js',
3509
+ * start: 3,
3510
+ * base: 'foo',
3511
+ * glob: '*.js',
3512
+ * isBrace: false,
3513
+ * isBracket: false,
3514
+ * isGlob: true,
3515
+ * isExtglob: false,
3516
+ * isGlobstar: false,
3517
+ * negated: true }
3518
+ * ```
3519
+ * @param {String} `input` Glob pattern to scan.
3520
+ * @param {Object} `options`
3521
+ * @return {Object} Returns an object with
3522
+ * @api public
3523
+ */
3524
+
3525
+ picomatch.scan = (input, options) => scan(input, options);
3526
+
3527
+ /**
3528
+ * Compile a regular expression from the `state` object returned by the
3529
+ * [parse()](#parse) method.
3530
+ *
3531
+ * @param {Object} `state`
3532
+ * @param {Object} `options`
3533
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
3534
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
3535
+ * @return {RegExp}
3536
+ * @api public
3537
+ */
3538
+
3539
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
3540
+ if (returnOutput === true) {
3541
+ return state.output;
3542
+ }
3543
+
3544
+ const opts = options || {};
3545
+ const prepend = opts.contains ? '' : '^';
3546
+ const append = opts.contains ? '' : '$';
3547
+
3548
+ let source = `${prepend}(?:${state.output})${append}`;
3549
+ if (state && state.negated === true) {
3550
+ source = `^(?!${source}).*$`;
3551
+ }
3552
+
3553
+ const regex = picomatch.toRegex(source, options);
3554
+ if (returnState === true) {
3555
+ regex.state = state;
3556
+ }
3557
+
3558
+ return regex;
3559
+ };
3560
+
3561
+ /**
3562
+ * Create a regular expression from a parsed glob pattern.
3563
+ *
3564
+ * ```js
3565
+ * const picomatch = require('picomatch');
3566
+ * const state = picomatch.parse('*.js');
3567
+ * // picomatch.compileRe(state[, options]);
3568
+ *
3569
+ * console.log(picomatch.compileRe(state));
3570
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
3571
+ * ```
3572
+ * @param {String} `state` The object returned from the `.parse` method.
3573
+ * @param {Object} `options`
3574
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
3575
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
3576
+ * @return {RegExp} Returns a regex created from the given pattern.
3577
+ * @api public
3578
+ */
3579
+
3580
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
3581
+ if (!input || typeof input !== 'string') {
3582
+ throw new TypeError('Expected a non-empty string');
3583
+ }
3584
+
3585
+ let parsed = { negated: false, fastpaths: true };
3586
+
3587
+ if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
3588
+ parsed.output = parse.fastpaths(input, options);
3589
+ }
3590
+
3591
+ if (!parsed.output) {
3592
+ parsed = parse(input, options);
3593
+ }
3594
+
3595
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
3596
+ };
3597
+
3598
+ /**
3599
+ * Create a regular expression from the given regex source string.
3600
+ *
3601
+ * ```js
3602
+ * const picomatch = require('picomatch');
3603
+ * // picomatch.toRegex(source[, options]);
3604
+ *
3605
+ * const { output } = picomatch.parse('*.js');
3606
+ * console.log(picomatch.toRegex(output));
3607
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
3608
+ * ```
3609
+ * @param {String} `source` Regular expression source string.
3610
+ * @param {Object} `options`
3611
+ * @return {RegExp}
3612
+ * @api public
3613
+ */
3614
+
3615
+ picomatch.toRegex = (source, options) => {
3616
+ try {
3617
+ const opts = options || {};
3618
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
3619
+ } catch (err) {
3620
+ if (options && options.debug === true) throw err;
3621
+ return /$^/;
3622
+ }
3623
+ };
3624
+
3625
+ /**
3626
+ * Picomatch constants.
3627
+ * @return {Object}
3628
+ */
3629
+
3630
+ picomatch.constants = constants;
3631
+
3632
+ /**
3633
+ * Expose "picomatch"
3634
+ */
3635
+
3636
+ picomatch_1 = picomatch;
3637
+ return picomatch_1;
3638
+ }
3639
+
3640
+ var picomatch;
3641
+ var hasRequiredPicomatch;
3642
+
3643
+ function requirePicomatch () {
3644
+ if (hasRequiredPicomatch) return picomatch;
3645
+ hasRequiredPicomatch = 1;
3646
+
3647
+ picomatch = requirePicomatch$1();
3648
+ return picomatch;
3649
+ }
3650
+
3651
+ var micromatch_1;
3652
+ var hasRequiredMicromatch;
3653
+
3654
+ function requireMicromatch () {
3655
+ if (hasRequiredMicromatch) return micromatch_1;
3656
+ hasRequiredMicromatch = 1;
3657
+
3658
+ const util = require$$0;
3659
+ const braces = requireBraces();
3660
+ const picomatch = requirePicomatch();
3661
+ const utils = requireUtils();
3662
+ const isEmptyString = val => val === '' || val === './';
3663
+
3664
+ /**
3665
+ * Returns an array of strings that match one or more glob patterns.
3666
+ *
3667
+ * ```js
3668
+ * const mm = require('micromatch');
3669
+ * // mm(list, patterns[, options]);
3670
+ *
3671
+ * console.log(mm(['a.js', 'a.txt'], ['*.js']));
3672
+ * //=> [ 'a.js' ]
3673
+ * ```
3674
+ * @param {String|Array<string>} `list` List of strings to match.
3675
+ * @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
3676
+ * @param {Object} `options` See available [options](#options)
3677
+ * @return {Array} Returns an array of matches
3678
+ * @summary false
3679
+ * @api public
3680
+ */
3681
+
3682
+ const micromatch = (list, patterns, options) => {
3683
+ patterns = [].concat(patterns);
3684
+ list = [].concat(list);
3685
+
3686
+ let omit = new Set();
3687
+ let keep = new Set();
3688
+ let items = new Set();
3689
+ let negatives = 0;
3690
+
3691
+ let onResult = state => {
3692
+ items.add(state.output);
3693
+ if (options && options.onResult) {
3694
+ options.onResult(state);
3695
+ }
3696
+ };
3697
+
3698
+ for (let i = 0; i < patterns.length; i++) {
3699
+ let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
3700
+ let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
3701
+ if (negated) negatives++;
3702
+
3703
+ for (let item of list) {
3704
+ let matched = isMatch(item, true);
3705
+
3706
+ let match = negated ? !matched.isMatch : matched.isMatch;
3707
+ if (!match) continue;
3708
+
3709
+ if (negated) {
3710
+ omit.add(matched.output);
3711
+ } else {
3712
+ omit.delete(matched.output);
3713
+ keep.add(matched.output);
3714
+ }
3715
+ }
3716
+ }
3717
+
3718
+ let result = negatives === patterns.length ? [...items] : [...keep];
3719
+ let matches = result.filter(item => !omit.has(item));
3720
+
3721
+ if (options && matches.length === 0) {
3722
+ if (options.failglob === true) {
3723
+ throw new Error(`No matches found for "${patterns.join(', ')}"`);
3724
+ }
3725
+
3726
+ if (options.nonull === true || options.nullglob === true) {
3727
+ return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
3728
+ }
3729
+ }
3730
+
3731
+ return matches;
3732
+ };
3733
+
3734
+ /**
3735
+ * Backwards compatibility
3736
+ */
3737
+
3738
+ micromatch.match = micromatch;
3739
+
3740
+ /**
3741
+ * Returns a matcher function from the given glob `pattern` and `options`.
3742
+ * The returned function takes a string to match as its only argument and returns
3743
+ * true if the string is a match.
3744
+ *
3745
+ * ```js
3746
+ * const mm = require('micromatch');
3747
+ * // mm.matcher(pattern[, options]);
3748
+ *
3749
+ * const isMatch = mm.matcher('*.!(*a)');
3750
+ * console.log(isMatch('a.a')); //=> false
3751
+ * console.log(isMatch('a.b')); //=> true
3752
+ * ```
3753
+ * @param {String} `pattern` Glob pattern
3754
+ * @param {Object} `options`
3755
+ * @return {Function} Returns a matcher function.
3756
+ * @api public
3757
+ */
3758
+
3759
+ micromatch.matcher = (pattern, options) => picomatch(pattern, options);
3760
+
3761
+ /**
3762
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
3763
+ *
3764
+ * ```js
3765
+ * const mm = require('micromatch');
3766
+ * // mm.isMatch(string, patterns[, options]);
3767
+ *
3768
+ * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
3769
+ * console.log(mm.isMatch('a.a', 'b.*')); //=> false
3770
+ * ```
3771
+ * @param {String} `str` The string to test.
3772
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3773
+ * @param {Object} `[options]` See available [options](#options).
3774
+ * @return {Boolean} Returns true if any patterns match `str`
3775
+ * @api public
3776
+ */
3777
+
3778
+ micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
3779
+
3780
+ /**
3781
+ * Backwards compatibility
3782
+ */
3783
+
3784
+ micromatch.any = micromatch.isMatch;
3785
+
3786
+ /**
3787
+ * Returns a list of strings that _**do not match any**_ of the given `patterns`.
3788
+ *
3789
+ * ```js
3790
+ * const mm = require('micromatch');
3791
+ * // mm.not(list, patterns[, options]);
3792
+ *
3793
+ * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
3794
+ * //=> ['b.b', 'c.c']
3795
+ * ```
3796
+ * @param {Array} `list` Array of strings to match.
3797
+ * @param {String|Array} `patterns` One or more glob pattern to use for matching.
3798
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3799
+ * @return {Array} Returns an array of strings that **do not match** the given patterns.
3800
+ * @api public
3801
+ */
3802
+
3803
+ micromatch.not = (list, patterns, options = {}) => {
3804
+ patterns = [].concat(patterns).map(String);
3805
+ let result = new Set();
3806
+ let items = [];
3807
+
3808
+ let onResult = state => {
3809
+ if (options.onResult) options.onResult(state);
3810
+ items.push(state.output);
3811
+ };
3812
+
3813
+ let matches = new Set(micromatch(list, patterns, { ...options, onResult }));
3814
+
3815
+ for (let item of items) {
3816
+ if (!matches.has(item)) {
3817
+ result.add(item);
3818
+ }
3819
+ }
3820
+ return [...result];
3821
+ };
3822
+
3823
+ /**
3824
+ * Returns true if the given `string` contains the given pattern. Similar
3825
+ * to [.isMatch](#isMatch) but the pattern can match any part of the string.
3826
+ *
3827
+ * ```js
3828
+ * var mm = require('micromatch');
3829
+ * // mm.contains(string, pattern[, options]);
3830
+ *
3831
+ * console.log(mm.contains('aa/bb/cc', '*b'));
3832
+ * //=> true
3833
+ * console.log(mm.contains('aa/bb/cc', '*d'));
3834
+ * //=> false
3835
+ * ```
3836
+ * @param {String} `str` The string to match.
3837
+ * @param {String|Array} `patterns` Glob pattern to use for matching.
3838
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3839
+ * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
3840
+ * @api public
3841
+ */
3842
+
3843
+ micromatch.contains = (str, pattern, options) => {
3844
+ if (typeof str !== 'string') {
3845
+ throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
3846
+ }
3847
+
3848
+ if (Array.isArray(pattern)) {
3849
+ return pattern.some(p => micromatch.contains(str, p, options));
3850
+ }
3851
+
3852
+ if (typeof pattern === 'string') {
3853
+ if (isEmptyString(str) || isEmptyString(pattern)) {
3854
+ return false;
3855
+ }
3856
+
3857
+ if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) {
3858
+ return true;
3859
+ }
3860
+ }
3861
+
3862
+ return micromatch.isMatch(str, pattern, { ...options, contains: true });
3863
+ };
3864
+
3865
+ /**
3866
+ * Filter the keys of the given object with the given `glob` pattern
3867
+ * and `options`. Does not attempt to match nested keys. If you need this feature,
3868
+ * use [glob-object][] instead.
3869
+ *
3870
+ * ```js
3871
+ * const mm = require('micromatch');
3872
+ * // mm.matchKeys(object, patterns[, options]);
3873
+ *
3874
+ * const obj = { aa: 'a', ab: 'b', ac: 'c' };
3875
+ * console.log(mm.matchKeys(obj, '*b'));
3876
+ * //=> { ab: 'b' }
3877
+ * ```
3878
+ * @param {Object} `object` The object with keys to filter.
3879
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3880
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3881
+ * @return {Object} Returns an object with only keys that match the given patterns.
3882
+ * @api public
3883
+ */
3884
+
3885
+ micromatch.matchKeys = (obj, patterns, options) => {
3886
+ if (!utils.isObject(obj)) {
3887
+ throw new TypeError('Expected the first argument to be an object');
3888
+ }
3889
+ let keys = micromatch(Object.keys(obj), patterns, options);
3890
+ let res = {};
3891
+ for (let key of keys) res[key] = obj[key];
3892
+ return res;
3893
+ };
3894
+
3895
+ /**
3896
+ * Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
3897
+ *
3898
+ * ```js
3899
+ * const mm = require('micromatch');
3900
+ * // mm.some(list, patterns[, options]);
3901
+ *
3902
+ * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
3903
+ * // true
3904
+ * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
3905
+ * // false
3906
+ * ```
3907
+ * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
3908
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3909
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3910
+ * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
3911
+ * @api public
3912
+ */
3913
+
3914
+ micromatch.some = (list, patterns, options) => {
3915
+ let items = [].concat(list);
3916
+
3917
+ for (let pattern of [].concat(patterns)) {
3918
+ let isMatch = picomatch(String(pattern), options);
3919
+ if (items.some(item => isMatch(item))) {
3920
+ return true;
3921
+ }
3922
+ }
3923
+ return false;
3924
+ };
3925
+
3926
+ /**
3927
+ * Returns true if every string in the given `list` matches
3928
+ * any of the given glob `patterns`.
3929
+ *
3930
+ * ```js
3931
+ * const mm = require('micromatch');
3932
+ * // mm.every(list, patterns[, options]);
3933
+ *
3934
+ * console.log(mm.every('foo.js', ['foo.js']));
3935
+ * // true
3936
+ * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
3937
+ * // true
3938
+ * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
3939
+ * // false
3940
+ * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
3941
+ * // false
3942
+ * ```
3943
+ * @param {String|Array} `list` The string or array of strings to test.
3944
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3945
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3946
+ * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
3947
+ * @api public
3948
+ */
3949
+
3950
+ micromatch.every = (list, patterns, options) => {
3951
+ let items = [].concat(list);
3952
+
3953
+ for (let pattern of [].concat(patterns)) {
3954
+ let isMatch = picomatch(String(pattern), options);
3955
+ if (!items.every(item => isMatch(item))) {
3956
+ return false;
3957
+ }
3958
+ }
3959
+ return true;
3960
+ };
3961
+
3962
+ /**
3963
+ * Returns true if **all** of the given `patterns` match
3964
+ * the specified string.
3965
+ *
3966
+ * ```js
3967
+ * const mm = require('micromatch');
3968
+ * // mm.all(string, patterns[, options]);
3969
+ *
3970
+ * console.log(mm.all('foo.js', ['foo.js']));
3971
+ * // true
3972
+ *
3973
+ * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
3974
+ * // false
3975
+ *
3976
+ * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
3977
+ * // true
3978
+ *
3979
+ * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
3980
+ * // true
3981
+ * ```
3982
+ * @param {String|Array} `str` The string to test.
3983
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3984
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3985
+ * @return {Boolean} Returns true if any patterns match `str`
3986
+ * @api public
3987
+ */
3988
+
3989
+ micromatch.all = (str, patterns, options) => {
3990
+ if (typeof str !== 'string') {
3991
+ throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
3992
+ }
3993
+
3994
+ return [].concat(patterns).every(p => picomatch(p, options)(str));
3995
+ };
3996
+
3997
+ /**
3998
+ * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
3999
+ *
4000
+ * ```js
4001
+ * const mm = require('micromatch');
4002
+ * // mm.capture(pattern, string[, options]);
4003
+ *
4004
+ * console.log(mm.capture('test/*.js', 'test/foo.js'));
4005
+ * //=> ['foo']
4006
+ * console.log(mm.capture('test/*.js', 'foo/bar.css'));
4007
+ * //=> null
4008
+ * ```
4009
+ * @param {String} `glob` Glob pattern to use for matching.
4010
+ * @param {String} `input` String to match
4011
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
4012
+ * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
4013
+ * @api public
4014
+ */
4015
+
4016
+ micromatch.capture = (glob, input, options) => {
4017
+ let posix = utils.isWindows(options);
4018
+ let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
4019
+ let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
4020
+
4021
+ if (match) {
4022
+ return match.slice(1).map(v => v === void 0 ? '' : v);
4023
+ }
4024
+ };
4025
+
4026
+ /**
4027
+ * Create a regular expression from the given glob `pattern`.
4028
+ *
4029
+ * ```js
4030
+ * const mm = require('micromatch');
4031
+ * // mm.makeRe(pattern[, options]);
4032
+ *
4033
+ * console.log(mm.makeRe('*.js'));
4034
+ * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
4035
+ * ```
4036
+ * @param {String} `pattern` A glob pattern to convert to regex.
4037
+ * @param {Object} `options`
4038
+ * @return {RegExp} Returns a regex created from the given pattern.
4039
+ * @api public
4040
+ */
4041
+
4042
+ micromatch.makeRe = (...args) => picomatch.makeRe(...args);
4043
+
4044
+ /**
4045
+ * Scan a glob pattern to separate the pattern into segments. Used
4046
+ * by the [split](#split) method.
4047
+ *
4048
+ * ```js
4049
+ * const mm = require('micromatch');
4050
+ * const state = mm.scan(pattern[, options]);
4051
+ * ```
4052
+ * @param {String} `pattern`
4053
+ * @param {Object} `options`
4054
+ * @return {Object} Returns an object with
4055
+ * @api public
4056
+ */
4057
+
4058
+ micromatch.scan = (...args) => picomatch.scan(...args);
4059
+
4060
+ /**
4061
+ * Parse a glob pattern to create the source string for a regular
4062
+ * expression.
4063
+ *
4064
+ * ```js
4065
+ * const mm = require('micromatch');
4066
+ * const state = mm.parse(pattern[, options]);
4067
+ * ```
4068
+ * @param {String} `glob`
4069
+ * @param {Object} `options`
4070
+ * @return {Object} Returns an object with useful properties and output to be used as regex source string.
4071
+ * @api public
4072
+ */
4073
+
4074
+ micromatch.parse = (patterns, options) => {
4075
+ let res = [];
4076
+ for (let pattern of [].concat(patterns || [])) {
4077
+ for (let str of braces(String(pattern), options)) {
4078
+ res.push(picomatch.parse(str, options));
4079
+ }
4080
+ }
4081
+ return res;
4082
+ };
4083
+
4084
+ /**
4085
+ * Process the given brace `pattern`.
4086
+ *
4087
+ * ```js
4088
+ * const { braces } = require('micromatch');
4089
+ * console.log(braces('foo/{a,b,c}/bar'));
4090
+ * //=> [ 'foo/(a|b|c)/bar' ]
4091
+ *
4092
+ * console.log(braces('foo/{a,b,c}/bar', { expand: true }));
4093
+ * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
4094
+ * ```
4095
+ * @param {String} `pattern` String with brace pattern to process.
4096
+ * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
4097
+ * @return {Array}
4098
+ * @api public
4099
+ */
4100
+
4101
+ micromatch.braces = (pattern, options) => {
4102
+ if (typeof pattern !== 'string') throw new TypeError('Expected a string');
4103
+ if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
4104
+ return [pattern];
4105
+ }
4106
+ return braces(pattern, options);
4107
+ };
4108
+
4109
+ /**
4110
+ * Expand braces
4111
+ */
4112
+
4113
+ micromatch.braceExpand = (pattern, options) => {
4114
+ if (typeof pattern !== 'string') throw new TypeError('Expected a string');
4115
+ return micromatch.braces(pattern, { ...options, expand: true });
4116
+ };
4117
+
4118
+ /**
4119
+ * Expose micromatch
4120
+ */
4121
+
4122
+ micromatch_1 = micromatch;
4123
+ return micromatch_1;
4124
+ }
4125
+
4126
+ var micromatchExports = requireMicromatch();
4127
+
20
4128
  const intersection = (a, b) => new Set([...a].filter((i) => b.has(i)));
21
4129
  function getExports({
22
4130
  entrypoints: entrypoints$1,
@@ -40,7 +4148,7 @@ function getExports({
40
4148
  const [, resolvedEntrypoints] = entrypoints.resolveEntrypoints(entrypoints$1);
41
4149
  if (entries) {
42
4150
  Object.entries(resolvedEntrypoints).forEach(([key]) => {
43
- if (!entries.some((e) => micromatch.isMatch(key, e, { matchBase: true }))) {
4151
+ if (!entries.some((e) => micromatchExports.isMatch(key, e, { matchBase: true }))) {
44
4152
  delete resolvedEntrypoints[key];
45
4153
  }
46
4154
  });
@@ -346,13 +4454,13 @@ const getCompilerOptionsByFilePath = (tsconfigPath, filePath) => {
346
4454
  tsconfig.include,
347
4455
  tsconfig.exclude
348
4456
  ].map(resolvePaths);
349
- if (exclude.length > 0 && exclude.some((i) => micromatch.isMatch(filePath, i)))
4457
+ if (exclude.length > 0 && exclude.some((i) => micromatchExports.isMatch(filePath, i)))
350
4458
  return;
351
4459
  if (tsconfig.files?.length === 0 && tsconfig.include?.length === 0)
352
4460
  return;
353
4461
  let isInclude = false;
354
4462
  isInclude || (isInclude = files.length > 0 && files.includes(filePath));
355
- isInclude || (isInclude = include.length > 0 && include.some((i) => micromatch.isMatch(filePath, i)));
4463
+ isInclude || (isInclude = include.length > 0 && include.some((i) => micromatchExports.isMatch(filePath, i)));
356
4464
  if (isInclude) {
357
4465
  return tsconfig.compilerOptions ?? {};
358
4466
  } else {
@@ -429,6 +4537,7 @@ const generateConfigs = ({
429
4537
  })
430
4538
  ).catch(() => void 0),
431
4539
  esbuild(),
4540
+ commonjs(),
432
4541
  progress({
433
4542
  onEvent: (event, message) => execa.sendMessage(
434
4543
  {