snyk 1.958.0 → 1.959.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cli/213.index.js +3969 -0
  2. package/dist/cli/213.index.js.map +1 -0
  3. package/dist/cli/{919.index.js → 726.index.js} +61 -4
  4. package/dist/cli/726.index.js.map +1 -0
  5. package/dist/cli/784.index.js +30 -4
  6. package/dist/cli/784.index.js.map +1 -1
  7. package/dist/cli/{595.index.js → 790.index.js} +2908 -4930
  8. package/dist/cli/790.index.js.map +1 -0
  9. package/dist/cli/895.index.js +29 -3
  10. package/dist/cli/895.index.js.map +1 -1
  11. package/dist/cli/905.index.js +50 -0
  12. package/dist/cli/905.index.js.map +1 -1
  13. package/dist/cli/917.index.js +362 -110
  14. package/dist/cli/917.index.js.map +1 -1
  15. package/dist/cli/{778.index.js → 989.index.js} +4 -55
  16. package/dist/cli/989.index.js.map +1 -0
  17. package/dist/cli/commands/test/iac/local-execution/types.d.ts +5 -2
  18. package/dist/cli/commands/test/iac/output.d.ts +4 -2
  19. package/dist/cli/index.js +14 -11
  20. package/dist/cli/index.js.map +1 -1
  21. package/dist/lib/formatters/iac-output/v2/index.d.ts +1 -1
  22. package/dist/lib/formatters/iac-output/v2/share-results.d.ts +3 -1
  23. package/dist/lib/formatters/iac-output/v2/utils.d.ts +1 -0
  24. package/dist/lib/iac/file-utils.d.ts +4 -0
  25. package/dist/lib/iac/test/v2/setup/local-cache/policy-engine/constants/index.d.ts +1 -1
  26. package/dist/lib/iac/test/v2/setup/local-cache/policy-engine/download.d.ts +11 -0
  27. package/dist/lib/iac/test/v2/setup/local-cache/policy-engine/lookup-local.d.ts +1 -1
  28. package/dist/lib/iac/test/v2/setup/local-cache/rules-bundle/constants.d.ts +1 -0
  29. package/dist/lib/iac/test/v2/setup/local-cache/rules-bundle/download.d.ts +10 -0
  30. package/dist/lib/iac/test/v2/setup/local-cache/rules-bundle/index.d.ts +2 -0
  31. package/dist/lib/iac/test/v2/setup/local-cache/rules-bundle/lookup-local.d.ts +6 -0
  32. package/dist/lib/iac/test/v2/setup/local-cache/utils.d.ts +7 -0
  33. package/dist/lib/iac/test/v2/types.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/dist/cli/595.index.js.map +0 -1
  36. package/dist/cli/724.index.js +0 -1997
  37. package/dist/cli/724.index.js.map +0 -1
  38. package/dist/cli/778.index.js.map +0 -1
  39. package/dist/cli/919.index.js.map +0 -1
  40. package/dist/lib/iac/test/v2/setup/local-cache/rules.d.ts +0 -11
@@ -0,0 +1,3969 @@
1
+ exports.id = 213;
2
+ exports.ids = [213];
3
+ exports.modules = {
4
+
5
+ /***/ 5623:
6
+ /***/ ((module) => {
7
+
8
+ "use strict";
9
+
10
+ module.exports = balanced;
11
+ function balanced(a, b, str) {
12
+ if (a instanceof RegExp) a = maybeMatch(a, str);
13
+ if (b instanceof RegExp) b = maybeMatch(b, str);
14
+
15
+ var r = range(a, b, str);
16
+
17
+ return r && {
18
+ start: r[0],
19
+ end: r[1],
20
+ pre: str.slice(0, r[0]),
21
+ body: str.slice(r[0] + a.length, r[1]),
22
+ post: str.slice(r[1] + b.length)
23
+ };
24
+ }
25
+
26
+ function maybeMatch(reg, str) {
27
+ var m = str.match(reg);
28
+ return m ? m[0] : null;
29
+ }
30
+
31
+ balanced.range = range;
32
+ function range(a, b, str) {
33
+ var begs, beg, left, right, result;
34
+ var ai = str.indexOf(a);
35
+ var bi = str.indexOf(b, ai + 1);
36
+ var i = ai;
37
+
38
+ if (ai >= 0 && bi > 0) {
39
+ if(a===b) {
40
+ return [ai, bi];
41
+ }
42
+ begs = [];
43
+ left = str.length;
44
+
45
+ while (i >= 0 && !result) {
46
+ if (i == ai) {
47
+ begs.push(i);
48
+ ai = str.indexOf(a, i + 1);
49
+ } else if (begs.length == 1) {
50
+ result = [ begs.pop(), bi ];
51
+ } else {
52
+ beg = begs.pop();
53
+ if (beg < left) {
54
+ left = beg;
55
+ right = bi;
56
+ }
57
+
58
+ bi = str.indexOf(b, i + 1);
59
+ }
60
+
61
+ i = ai < bi && ai >= 0 ? ai : bi;
62
+ }
63
+
64
+ if (begs.length) {
65
+ result = [ left, right ];
66
+ }
67
+ }
68
+
69
+ return result;
70
+ }
71
+
72
+
73
+ /***/ }),
74
+
75
+ /***/ 3644:
76
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
77
+
78
+ var concatMap = __webpack_require__(11048);
79
+ var balanced = __webpack_require__(5623);
80
+
81
+ module.exports = expandTop;
82
+
83
+ var escSlash = '\0SLASH'+Math.random()+'\0';
84
+ var escOpen = '\0OPEN'+Math.random()+'\0';
85
+ var escClose = '\0CLOSE'+Math.random()+'\0';
86
+ var escComma = '\0COMMA'+Math.random()+'\0';
87
+ var escPeriod = '\0PERIOD'+Math.random()+'\0';
88
+
89
+ function numeric(str) {
90
+ return parseInt(str, 10) == str
91
+ ? parseInt(str, 10)
92
+ : str.charCodeAt(0);
93
+ }
94
+
95
+ function escapeBraces(str) {
96
+ return str.split('\\\\').join(escSlash)
97
+ .split('\\{').join(escOpen)
98
+ .split('\\}').join(escClose)
99
+ .split('\\,').join(escComma)
100
+ .split('\\.').join(escPeriod);
101
+ }
102
+
103
+ function unescapeBraces(str) {
104
+ return str.split(escSlash).join('\\')
105
+ .split(escOpen).join('{')
106
+ .split(escClose).join('}')
107
+ .split(escComma).join(',')
108
+ .split(escPeriod).join('.');
109
+ }
110
+
111
+
112
+ // Basically just str.split(","), but handling cases
113
+ // where we have nested braced sections, which should be
114
+ // treated as individual members, like {a,{b,c},d}
115
+ function parseCommaParts(str) {
116
+ if (!str)
117
+ return [''];
118
+
119
+ var parts = [];
120
+ var m = balanced('{', '}', str);
121
+
122
+ if (!m)
123
+ return str.split(',');
124
+
125
+ var pre = m.pre;
126
+ var body = m.body;
127
+ var post = m.post;
128
+ var p = pre.split(',');
129
+
130
+ p[p.length-1] += '{' + body + '}';
131
+ var postParts = parseCommaParts(post);
132
+ if (post.length) {
133
+ p[p.length-1] += postParts.shift();
134
+ p.push.apply(p, postParts);
135
+ }
136
+
137
+ parts.push.apply(parts, p);
138
+
139
+ return parts;
140
+ }
141
+
142
+ function expandTop(str) {
143
+ if (!str)
144
+ return [];
145
+
146
+ // I don't know why Bash 4.3 does this, but it does.
147
+ // Anything starting with {} will have the first two bytes preserved
148
+ // but *only* at the top level, so {},a}b will not expand to anything,
149
+ // but a{},b}c will be expanded to [a}c,abc].
150
+ // One could argue that this is a bug in Bash, but since the goal of
151
+ // this module is to match Bash's rules, we escape a leading {}
152
+ if (str.substr(0, 2) === '{}') {
153
+ str = '\\{\\}' + str.substr(2);
154
+ }
155
+
156
+ return expand(escapeBraces(str), true).map(unescapeBraces);
157
+ }
158
+
159
+ function identity(e) {
160
+ return e;
161
+ }
162
+
163
+ function embrace(str) {
164
+ return '{' + str + '}';
165
+ }
166
+ function isPadded(el) {
167
+ return /^-?0\d/.test(el);
168
+ }
169
+
170
+ function lte(i, y) {
171
+ return i <= y;
172
+ }
173
+ function gte(i, y) {
174
+ return i >= y;
175
+ }
176
+
177
+ function expand(str, isTop) {
178
+ var expansions = [];
179
+
180
+ var m = balanced('{', '}', str);
181
+ if (!m || /\$$/.test(m.pre)) return [str];
182
+
183
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
184
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
185
+ var isSequence = isNumericSequence || isAlphaSequence;
186
+ var isOptions = m.body.indexOf(',') >= 0;
187
+ if (!isSequence && !isOptions) {
188
+ // {a},b}
189
+ if (m.post.match(/,.*\}/)) {
190
+ str = m.pre + '{' + m.body + escClose + m.post;
191
+ return expand(str);
192
+ }
193
+ return [str];
194
+ }
195
+
196
+ var n;
197
+ if (isSequence) {
198
+ n = m.body.split(/\.\./);
199
+ } else {
200
+ n = parseCommaParts(m.body);
201
+ if (n.length === 1) {
202
+ // x{{a,b}}y ==> x{a}y x{b}y
203
+ n = expand(n[0], false).map(embrace);
204
+ if (n.length === 1) {
205
+ var post = m.post.length
206
+ ? expand(m.post, false)
207
+ : [''];
208
+ return post.map(function(p) {
209
+ return m.pre + n[0] + p;
210
+ });
211
+ }
212
+ }
213
+ }
214
+
215
+ // at this point, n is the parts, and we know it's not a comma set
216
+ // with a single entry.
217
+
218
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
219
+ var pre = m.pre;
220
+ var post = m.post.length
221
+ ? expand(m.post, false)
222
+ : [''];
223
+
224
+ var N;
225
+
226
+ if (isSequence) {
227
+ var x = numeric(n[0]);
228
+ var y = numeric(n[1]);
229
+ var width = Math.max(n[0].length, n[1].length)
230
+ var incr = n.length == 3
231
+ ? Math.abs(numeric(n[2]))
232
+ : 1;
233
+ var test = lte;
234
+ var reverse = y < x;
235
+ if (reverse) {
236
+ incr *= -1;
237
+ test = gte;
238
+ }
239
+ var pad = n.some(isPadded);
240
+
241
+ N = [];
242
+
243
+ for (var i = x; test(i, y); i += incr) {
244
+ var c;
245
+ if (isAlphaSequence) {
246
+ c = String.fromCharCode(i);
247
+ if (c === '\\')
248
+ c = '';
249
+ } else {
250
+ c = String(i);
251
+ if (pad) {
252
+ var need = width - c.length;
253
+ if (need > 0) {
254
+ var z = new Array(need + 1).join('0');
255
+ if (i < 0)
256
+ c = '-' + z + c.slice(1);
257
+ else
258
+ c = z + c;
259
+ }
260
+ }
261
+ }
262
+ N.push(c);
263
+ }
264
+ } else {
265
+ N = concatMap(n, function(el) { return expand(el, false) });
266
+ }
267
+
268
+ for (var j = 0; j < N.length; j++) {
269
+ for (var k = 0; k < post.length; k++) {
270
+ var expansion = pre + N[j] + post[k];
271
+ if (!isTop || isSequence || expansion)
272
+ expansions.push(expansion);
273
+ }
274
+ }
275
+
276
+ return expansions;
277
+ }
278
+
279
+
280
+
281
+ /***/ }),
282
+
283
+ /***/ 11048:
284
+ /***/ ((module) => {
285
+
286
+ module.exports = function (xs, fn) {
287
+ var res = [];
288
+ for (var i = 0; i < xs.length; i++) {
289
+ var x = fn(xs[i], i);
290
+ if (isArray(x)) res.push.apply(res, x);
291
+ else res.push(x);
292
+ }
293
+ return res;
294
+ };
295
+
296
+ var isArray = Array.isArray || function (xs) {
297
+ return Object.prototype.toString.call(xs) === '[object Array]';
298
+ };
299
+
300
+
301
+ /***/ }),
302
+
303
+ /***/ 37334:
304
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
305
+
306
+ module.exports = realpath
307
+ realpath.realpath = realpath
308
+ realpath.sync = realpathSync
309
+ realpath.realpathSync = realpathSync
310
+ realpath.monkeypatch = monkeypatch
311
+ realpath.unmonkeypatch = unmonkeypatch
312
+
313
+ var fs = __webpack_require__(35747)
314
+ var origRealpath = fs.realpath
315
+ var origRealpathSync = fs.realpathSync
316
+
317
+ var version = process.version
318
+ var ok = /^v[0-5]\./.test(version)
319
+ var old = __webpack_require__(47059)
320
+
321
+ function newError (er) {
322
+ return er && er.syscall === 'realpath' && (
323
+ er.code === 'ELOOP' ||
324
+ er.code === 'ENOMEM' ||
325
+ er.code === 'ENAMETOOLONG'
326
+ )
327
+ }
328
+
329
+ function realpath (p, cache, cb) {
330
+ if (ok) {
331
+ return origRealpath(p, cache, cb)
332
+ }
333
+
334
+ if (typeof cache === 'function') {
335
+ cb = cache
336
+ cache = null
337
+ }
338
+ origRealpath(p, cache, function (er, result) {
339
+ if (newError(er)) {
340
+ old.realpath(p, cache, cb)
341
+ } else {
342
+ cb(er, result)
343
+ }
344
+ })
345
+ }
346
+
347
+ function realpathSync (p, cache) {
348
+ if (ok) {
349
+ return origRealpathSync(p, cache)
350
+ }
351
+
352
+ try {
353
+ return origRealpathSync(p, cache)
354
+ } catch (er) {
355
+ if (newError(er)) {
356
+ return old.realpathSync(p, cache)
357
+ } else {
358
+ throw er
359
+ }
360
+ }
361
+ }
362
+
363
+ function monkeypatch () {
364
+ fs.realpath = realpath
365
+ fs.realpathSync = realpathSync
366
+ }
367
+
368
+ function unmonkeypatch () {
369
+ fs.realpath = origRealpath
370
+ fs.realpathSync = origRealpathSync
371
+ }
372
+
373
+
374
+ /***/ }),
375
+
376
+ /***/ 47059:
377
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
378
+
379
+ // Copyright Joyent, Inc. and other Node contributors.
380
+ //
381
+ // Permission is hereby granted, free of charge, to any person obtaining a
382
+ // copy of this software and associated documentation files (the
383
+ // "Software"), to deal in the Software without restriction, including
384
+ // without limitation the rights to use, copy, modify, merge, publish,
385
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
386
+ // persons to whom the Software is furnished to do so, subject to the
387
+ // following conditions:
388
+ //
389
+ // The above copyright notice and this permission notice shall be included
390
+ // in all copies or substantial portions of the Software.
391
+ //
392
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
393
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
394
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
395
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
396
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
397
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
398
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
399
+
400
+ var pathModule = __webpack_require__(85622);
401
+ var isWindows = process.platform === 'win32';
402
+ var fs = __webpack_require__(35747);
403
+
404
+ // JavaScript implementation of realpath, ported from node pre-v6
405
+
406
+ var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
407
+
408
+ function rethrow() {
409
+ // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
410
+ // is fairly slow to generate.
411
+ var callback;
412
+ if (DEBUG) {
413
+ var backtrace = new Error;
414
+ callback = debugCallback;
415
+ } else
416
+ callback = missingCallback;
417
+
418
+ return callback;
419
+
420
+ function debugCallback(err) {
421
+ if (err) {
422
+ backtrace.message = err.message;
423
+ err = backtrace;
424
+ missingCallback(err);
425
+ }
426
+ }
427
+
428
+ function missingCallback(err) {
429
+ if (err) {
430
+ if (process.throwDeprecation)
431
+ throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
432
+ else if (!process.noDeprecation) {
433
+ var msg = 'fs: missing callback ' + (err.stack || err.message);
434
+ if (process.traceDeprecation)
435
+ console.trace(msg);
436
+ else
437
+ console.error(msg);
438
+ }
439
+ }
440
+ }
441
+ }
442
+
443
+ function maybeCallback(cb) {
444
+ return typeof cb === 'function' ? cb : rethrow();
445
+ }
446
+
447
+ var normalize = pathModule.normalize;
448
+
449
+ // Regexp that finds the next partion of a (partial) path
450
+ // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
451
+ if (isWindows) {
452
+ var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
453
+ } else {
454
+ var nextPartRe = /(.*?)(?:[\/]+|$)/g;
455
+ }
456
+
457
+ // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
458
+ if (isWindows) {
459
+ var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
460
+ } else {
461
+ var splitRootRe = /^[\/]*/;
462
+ }
463
+
464
+ exports.realpathSync = function realpathSync(p, cache) {
465
+ // make p is absolute
466
+ p = pathModule.resolve(p);
467
+
468
+ if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
469
+ return cache[p];
470
+ }
471
+
472
+ var original = p,
473
+ seenLinks = {},
474
+ knownHard = {};
475
+
476
+ // current character position in p
477
+ var pos;
478
+ // the partial path so far, including a trailing slash if any
479
+ var current;
480
+ // the partial path without a trailing slash (except when pointing at a root)
481
+ var base;
482
+ // the partial path scanned in the previous round, with slash
483
+ var previous;
484
+
485
+ start();
486
+
487
+ function start() {
488
+ // Skip over roots
489
+ var m = splitRootRe.exec(p);
490
+ pos = m[0].length;
491
+ current = m[0];
492
+ base = m[0];
493
+ previous = '';
494
+
495
+ // On windows, check that the root exists. On unix there is no need.
496
+ if (isWindows && !knownHard[base]) {
497
+ fs.lstatSync(base);
498
+ knownHard[base] = true;
499
+ }
500
+ }
501
+
502
+ // walk down the path, swapping out linked pathparts for their real
503
+ // values
504
+ // NB: p.length changes.
505
+ while (pos < p.length) {
506
+ // find the next part
507
+ nextPartRe.lastIndex = pos;
508
+ var result = nextPartRe.exec(p);
509
+ previous = current;
510
+ current += result[0];
511
+ base = previous + result[1];
512
+ pos = nextPartRe.lastIndex;
513
+
514
+ // continue if not a symlink
515
+ if (knownHard[base] || (cache && cache[base] === base)) {
516
+ continue;
517
+ }
518
+
519
+ var resolvedLink;
520
+ if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
521
+ // some known symbolic link. no need to stat again.
522
+ resolvedLink = cache[base];
523
+ } else {
524
+ var stat = fs.lstatSync(base);
525
+ if (!stat.isSymbolicLink()) {
526
+ knownHard[base] = true;
527
+ if (cache) cache[base] = base;
528
+ continue;
529
+ }
530
+
531
+ // read the link if it wasn't read before
532
+ // dev/ino always return 0 on windows, so skip the check.
533
+ var linkTarget = null;
534
+ if (!isWindows) {
535
+ var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
536
+ if (seenLinks.hasOwnProperty(id)) {
537
+ linkTarget = seenLinks[id];
538
+ }
539
+ }
540
+ if (linkTarget === null) {
541
+ fs.statSync(base);
542
+ linkTarget = fs.readlinkSync(base);
543
+ }
544
+ resolvedLink = pathModule.resolve(previous, linkTarget);
545
+ // track this, if given a cache.
546
+ if (cache) cache[base] = resolvedLink;
547
+ if (!isWindows) seenLinks[id] = linkTarget;
548
+ }
549
+
550
+ // resolve the link, then start over
551
+ p = pathModule.resolve(resolvedLink, p.slice(pos));
552
+ start();
553
+ }
554
+
555
+ if (cache) cache[original] = p;
556
+
557
+ return p;
558
+ };
559
+
560
+
561
+ exports.realpath = function realpath(p, cache, cb) {
562
+ if (typeof cb !== 'function') {
563
+ cb = maybeCallback(cache);
564
+ cache = null;
565
+ }
566
+
567
+ // make p is absolute
568
+ p = pathModule.resolve(p);
569
+
570
+ if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
571
+ return process.nextTick(cb.bind(null, null, cache[p]));
572
+ }
573
+
574
+ var original = p,
575
+ seenLinks = {},
576
+ knownHard = {};
577
+
578
+ // current character position in p
579
+ var pos;
580
+ // the partial path so far, including a trailing slash if any
581
+ var current;
582
+ // the partial path without a trailing slash (except when pointing at a root)
583
+ var base;
584
+ // the partial path scanned in the previous round, with slash
585
+ var previous;
586
+
587
+ start();
588
+
589
+ function start() {
590
+ // Skip over roots
591
+ var m = splitRootRe.exec(p);
592
+ pos = m[0].length;
593
+ current = m[0];
594
+ base = m[0];
595
+ previous = '';
596
+
597
+ // On windows, check that the root exists. On unix there is no need.
598
+ if (isWindows && !knownHard[base]) {
599
+ fs.lstat(base, function(err) {
600
+ if (err) return cb(err);
601
+ knownHard[base] = true;
602
+ LOOP();
603
+ });
604
+ } else {
605
+ process.nextTick(LOOP);
606
+ }
607
+ }
608
+
609
+ // walk down the path, swapping out linked pathparts for their real
610
+ // values
611
+ function LOOP() {
612
+ // stop if scanned past end of path
613
+ if (pos >= p.length) {
614
+ if (cache) cache[original] = p;
615
+ return cb(null, p);
616
+ }
617
+
618
+ // find the next part
619
+ nextPartRe.lastIndex = pos;
620
+ var result = nextPartRe.exec(p);
621
+ previous = current;
622
+ current += result[0];
623
+ base = previous + result[1];
624
+ pos = nextPartRe.lastIndex;
625
+
626
+ // continue if not a symlink
627
+ if (knownHard[base] || (cache && cache[base] === base)) {
628
+ return process.nextTick(LOOP);
629
+ }
630
+
631
+ if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
632
+ // known symbolic link. no need to stat again.
633
+ return gotResolvedLink(cache[base]);
634
+ }
635
+
636
+ return fs.lstat(base, gotStat);
637
+ }
638
+
639
+ function gotStat(err, stat) {
640
+ if (err) return cb(err);
641
+
642
+ // if not a symlink, skip to the next path part
643
+ if (!stat.isSymbolicLink()) {
644
+ knownHard[base] = true;
645
+ if (cache) cache[base] = base;
646
+ return process.nextTick(LOOP);
647
+ }
648
+
649
+ // stat & read the link if not read before
650
+ // call gotTarget as soon as the link target is known
651
+ // dev/ino always return 0 on windows, so skip the check.
652
+ if (!isWindows) {
653
+ var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
654
+ if (seenLinks.hasOwnProperty(id)) {
655
+ return gotTarget(null, seenLinks[id], base);
656
+ }
657
+ }
658
+ fs.stat(base, function(err) {
659
+ if (err) return cb(err);
660
+
661
+ fs.readlink(base, function(err, target) {
662
+ if (!isWindows) seenLinks[id] = target;
663
+ gotTarget(err, target);
664
+ });
665
+ });
666
+ }
667
+
668
+ function gotTarget(err, target, base) {
669
+ if (err) return cb(err);
670
+
671
+ var resolvedLink = pathModule.resolve(previous, target);
672
+ if (cache) cache[base] = resolvedLink;
673
+ gotResolvedLink(resolvedLink);
674
+ }
675
+
676
+ function gotResolvedLink(resolvedLink) {
677
+ // resolve the link, then start over
678
+ p = pathModule.resolve(resolvedLink, p.slice(pos));
679
+ start();
680
+ }
681
+ };
682
+
683
+
684
+ /***/ }),
685
+
686
+ /***/ 66772:
687
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
688
+
689
+ exports.setopts = setopts
690
+ exports.ownProp = ownProp
691
+ exports.makeAbs = makeAbs
692
+ exports.finish = finish
693
+ exports.mark = mark
694
+ exports.isIgnored = isIgnored
695
+ exports.childrenIgnored = childrenIgnored
696
+
697
+ function ownProp (obj, field) {
698
+ return Object.prototype.hasOwnProperty.call(obj, field)
699
+ }
700
+
701
+ var path = __webpack_require__(85622)
702
+ var minimatch = __webpack_require__(91171)
703
+ var isAbsolute = __webpack_require__(64095)
704
+ var Minimatch = minimatch.Minimatch
705
+
706
+ function alphasort (a, b) {
707
+ return a.localeCompare(b, 'en')
708
+ }
709
+
710
+ function setupIgnores (self, options) {
711
+ self.ignore = options.ignore || []
712
+
713
+ if (!Array.isArray(self.ignore))
714
+ self.ignore = [self.ignore]
715
+
716
+ if (self.ignore.length) {
717
+ self.ignore = self.ignore.map(ignoreMap)
718
+ }
719
+ }
720
+
721
+ // ignore patterns are always in dot:true mode.
722
+ function ignoreMap (pattern) {
723
+ var gmatcher = null
724
+ if (pattern.slice(-3) === '/**') {
725
+ var gpattern = pattern.replace(/(\/\*\*)+$/, '')
726
+ gmatcher = new Minimatch(gpattern, { dot: true })
727
+ }
728
+
729
+ return {
730
+ matcher: new Minimatch(pattern, { dot: true }),
731
+ gmatcher: gmatcher
732
+ }
733
+ }
734
+
735
+ function setopts (self, pattern, options) {
736
+ if (!options)
737
+ options = {}
738
+
739
+ // base-matching: just use globstar for that.
740
+ if (options.matchBase && -1 === pattern.indexOf("/")) {
741
+ if (options.noglobstar) {
742
+ throw new Error("base matching requires globstar")
743
+ }
744
+ pattern = "**/" + pattern
745
+ }
746
+
747
+ self.silent = !!options.silent
748
+ self.pattern = pattern
749
+ self.strict = options.strict !== false
750
+ self.realpath = !!options.realpath
751
+ self.realpathCache = options.realpathCache || Object.create(null)
752
+ self.follow = !!options.follow
753
+ self.dot = !!options.dot
754
+ self.mark = !!options.mark
755
+ self.nodir = !!options.nodir
756
+ if (self.nodir)
757
+ self.mark = true
758
+ self.sync = !!options.sync
759
+ self.nounique = !!options.nounique
760
+ self.nonull = !!options.nonull
761
+ self.nosort = !!options.nosort
762
+ self.nocase = !!options.nocase
763
+ self.stat = !!options.stat
764
+ self.noprocess = !!options.noprocess
765
+ self.absolute = !!options.absolute
766
+
767
+ self.maxLength = options.maxLength || Infinity
768
+ self.cache = options.cache || Object.create(null)
769
+ self.statCache = options.statCache || Object.create(null)
770
+ self.symlinks = options.symlinks || Object.create(null)
771
+
772
+ setupIgnores(self, options)
773
+
774
+ self.changedCwd = false
775
+ var cwd = process.cwd()
776
+ if (!ownProp(options, "cwd"))
777
+ self.cwd = cwd
778
+ else {
779
+ self.cwd = path.resolve(options.cwd)
780
+ self.changedCwd = self.cwd !== cwd
781
+ }
782
+
783
+ self.root = options.root || path.resolve(self.cwd, "/")
784
+ self.root = path.resolve(self.root)
785
+ if (process.platform === "win32")
786
+ self.root = self.root.replace(/\\/g, "/")
787
+
788
+ // TODO: is an absolute `cwd` supposed to be resolved against `root`?
789
+ // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
790
+ self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
791
+ if (process.platform === "win32")
792
+ self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
793
+ self.nomount = !!options.nomount
794
+
795
+ // disable comments and negation in Minimatch.
796
+ // Note that they are not supported in Glob itself anyway.
797
+ options.nonegate = true
798
+ options.nocomment = true
799
+
800
+ self.minimatch = new Minimatch(pattern, options)
801
+ self.options = self.minimatch.options
802
+ }
803
+
804
+ function finish (self) {
805
+ var nou = self.nounique
806
+ var all = nou ? [] : Object.create(null)
807
+
808
+ for (var i = 0, l = self.matches.length; i < l; i ++) {
809
+ var matches = self.matches[i]
810
+ if (!matches || Object.keys(matches).length === 0) {
811
+ if (self.nonull) {
812
+ // do like the shell, and spit out the literal glob
813
+ var literal = self.minimatch.globSet[i]
814
+ if (nou)
815
+ all.push(literal)
816
+ else
817
+ all[literal] = true
818
+ }
819
+ } else {
820
+ // had matches
821
+ var m = Object.keys(matches)
822
+ if (nou)
823
+ all.push.apply(all, m)
824
+ else
825
+ m.forEach(function (m) {
826
+ all[m] = true
827
+ })
828
+ }
829
+ }
830
+
831
+ if (!nou)
832
+ all = Object.keys(all)
833
+
834
+ if (!self.nosort)
835
+ all = all.sort(alphasort)
836
+
837
+ // at *some* point we statted all of these
838
+ if (self.mark) {
839
+ for (var i = 0; i < all.length; i++) {
840
+ all[i] = self._mark(all[i])
841
+ }
842
+ if (self.nodir) {
843
+ all = all.filter(function (e) {
844
+ var notDir = !(/\/$/.test(e))
845
+ var c = self.cache[e] || self.cache[makeAbs(self, e)]
846
+ if (notDir && c)
847
+ notDir = c !== 'DIR' && !Array.isArray(c)
848
+ return notDir
849
+ })
850
+ }
851
+ }
852
+
853
+ if (self.ignore.length)
854
+ all = all.filter(function(m) {
855
+ return !isIgnored(self, m)
856
+ })
857
+
858
+ self.found = all
859
+ }
860
+
861
+ function mark (self, p) {
862
+ var abs = makeAbs(self, p)
863
+ var c = self.cache[abs]
864
+ var m = p
865
+ if (c) {
866
+ var isDir = c === 'DIR' || Array.isArray(c)
867
+ var slash = p.slice(-1) === '/'
868
+
869
+ if (isDir && !slash)
870
+ m += '/'
871
+ else if (!isDir && slash)
872
+ m = m.slice(0, -1)
873
+
874
+ if (m !== p) {
875
+ var mabs = makeAbs(self, m)
876
+ self.statCache[mabs] = self.statCache[abs]
877
+ self.cache[mabs] = self.cache[abs]
878
+ }
879
+ }
880
+
881
+ return m
882
+ }
883
+
884
+ // lotta situps...
885
+ function makeAbs (self, f) {
886
+ var abs = f
887
+ if (f.charAt(0) === '/') {
888
+ abs = path.join(self.root, f)
889
+ } else if (isAbsolute(f) || f === '') {
890
+ abs = f
891
+ } else if (self.changedCwd) {
892
+ abs = path.resolve(self.cwd, f)
893
+ } else {
894
+ abs = path.resolve(f)
895
+ }
896
+
897
+ if (process.platform === 'win32')
898
+ abs = abs.replace(/\\/g, '/')
899
+
900
+ return abs
901
+ }
902
+
903
+
904
+ // Return true, if pattern ends with globstar '**', for the accompanying parent directory.
905
+ // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
906
+ function isIgnored (self, path) {
907
+ if (!self.ignore.length)
908
+ return false
909
+
910
+ return self.ignore.some(function(item) {
911
+ return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
912
+ })
913
+ }
914
+
915
+ function childrenIgnored (self, path) {
916
+ if (!self.ignore.length)
917
+ return false
918
+
919
+ return self.ignore.some(function(item) {
920
+ return !!(item.gmatcher && item.gmatcher.match(path))
921
+ })
922
+ }
923
+
924
+
925
+ /***/ }),
926
+
927
+ /***/ 12884:
928
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
929
+
930
+ // Approach:
931
+ //
932
+ // 1. Get the minimatch set
933
+ // 2. For each pattern in the set, PROCESS(pattern, false)
934
+ // 3. Store matches per-set, then uniq them
935
+ //
936
+ // PROCESS(pattern, inGlobStar)
937
+ // Get the first [n] items from pattern that are all strings
938
+ // Join these together. This is PREFIX.
939
+ // If there is no more remaining, then stat(PREFIX) and
940
+ // add to matches if it succeeds. END.
941
+ //
942
+ // If inGlobStar and PREFIX is symlink and points to dir
943
+ // set ENTRIES = []
944
+ // else readdir(PREFIX) as ENTRIES
945
+ // If fail, END
946
+ //
947
+ // with ENTRIES
948
+ // If pattern[n] is GLOBSTAR
949
+ // // handle the case where the globstar match is empty
950
+ // // by pruning it out, and testing the resulting pattern
951
+ // PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
952
+ // // handle other cases.
953
+ // for ENTRY in ENTRIES (not dotfiles)
954
+ // // attach globstar + tail onto the entry
955
+ // // Mark that this entry is a globstar match
956
+ // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
957
+ //
958
+ // else // not globstar
959
+ // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
960
+ // Test ENTRY against pattern[n]
961
+ // If fails, continue
962
+ // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
963
+ //
964
+ // Caveat:
965
+ // Cache all stats and readdirs results to minimize syscall. Since all
966
+ // we ever care about is existence and directory-ness, we can just keep
967
+ // `true` for files, and [children,...] for directories, or `false` for
968
+ // things that don't exist.
969
+
970
+ module.exports = glob
971
+
972
+ var fs = __webpack_require__(35747)
973
+ var rp = __webpack_require__(37334)
974
+ var minimatch = __webpack_require__(91171)
975
+ var Minimatch = minimatch.Minimatch
976
+ var inherits = __webpack_require__(94378)
977
+ var EE = __webpack_require__(28614).EventEmitter
978
+ var path = __webpack_require__(85622)
979
+ var assert = __webpack_require__(42357)
980
+ var isAbsolute = __webpack_require__(64095)
981
+ var globSync = __webpack_require__(14751)
982
+ var common = __webpack_require__(66772)
983
+ var setopts = common.setopts
984
+ var ownProp = common.ownProp
985
+ var inflight = __webpack_require__(67844)
986
+ var util = __webpack_require__(31669)
987
+ var childrenIgnored = common.childrenIgnored
988
+ var isIgnored = common.isIgnored
989
+
990
+ var once = __webpack_require__(30778)
991
+
992
+ function glob (pattern, options, cb) {
993
+ if (typeof options === 'function') cb = options, options = {}
994
+ if (!options) options = {}
995
+
996
+ if (options.sync) {
997
+ if (cb)
998
+ throw new TypeError('callback provided to sync glob')
999
+ return globSync(pattern, options)
1000
+ }
1001
+
1002
+ return new Glob(pattern, options, cb)
1003
+ }
1004
+
1005
+ glob.sync = globSync
1006
+ var GlobSync = glob.GlobSync = globSync.GlobSync
1007
+
1008
+ // old api surface
1009
+ glob.glob = glob
1010
+
1011
+ function extend (origin, add) {
1012
+ if (add === null || typeof add !== 'object') {
1013
+ return origin
1014
+ }
1015
+
1016
+ var keys = Object.keys(add)
1017
+ var i = keys.length
1018
+ while (i--) {
1019
+ origin[keys[i]] = add[keys[i]]
1020
+ }
1021
+ return origin
1022
+ }
1023
+
1024
+ glob.hasMagic = function (pattern, options_) {
1025
+ var options = extend({}, options_)
1026
+ options.noprocess = true
1027
+
1028
+ var g = new Glob(pattern, options)
1029
+ var set = g.minimatch.set
1030
+
1031
+ if (!pattern)
1032
+ return false
1033
+
1034
+ if (set.length > 1)
1035
+ return true
1036
+
1037
+ for (var j = 0; j < set[0].length; j++) {
1038
+ if (typeof set[0][j] !== 'string')
1039
+ return true
1040
+ }
1041
+
1042
+ return false
1043
+ }
1044
+
1045
+ glob.Glob = Glob
1046
+ inherits(Glob, EE)
1047
+ function Glob (pattern, options, cb) {
1048
+ if (typeof options === 'function') {
1049
+ cb = options
1050
+ options = null
1051
+ }
1052
+
1053
+ if (options && options.sync) {
1054
+ if (cb)
1055
+ throw new TypeError('callback provided to sync glob')
1056
+ return new GlobSync(pattern, options)
1057
+ }
1058
+
1059
+ if (!(this instanceof Glob))
1060
+ return new Glob(pattern, options, cb)
1061
+
1062
+ setopts(this, pattern, options)
1063
+ this._didRealPath = false
1064
+
1065
+ // process each pattern in the minimatch set
1066
+ var n = this.minimatch.set.length
1067
+
1068
+ // The matches are stored as {<filename>: true,...} so that
1069
+ // duplicates are automagically pruned.
1070
+ // Later, we do an Object.keys() on these.
1071
+ // Keep them as a list so we can fill in when nonull is set.
1072
+ this.matches = new Array(n)
1073
+
1074
+ if (typeof cb === 'function') {
1075
+ cb = once(cb)
1076
+ this.on('error', cb)
1077
+ this.on('end', function (matches) {
1078
+ cb(null, matches)
1079
+ })
1080
+ }
1081
+
1082
+ var self = this
1083
+ this._processing = 0
1084
+
1085
+ this._emitQueue = []
1086
+ this._processQueue = []
1087
+ this.paused = false
1088
+
1089
+ if (this.noprocess)
1090
+ return this
1091
+
1092
+ if (n === 0)
1093
+ return done()
1094
+
1095
+ var sync = true
1096
+ for (var i = 0; i < n; i ++) {
1097
+ this._process(this.minimatch.set[i], i, false, done)
1098
+ }
1099
+ sync = false
1100
+
1101
+ function done () {
1102
+ --self._processing
1103
+ if (self._processing <= 0) {
1104
+ if (sync) {
1105
+ process.nextTick(function () {
1106
+ self._finish()
1107
+ })
1108
+ } else {
1109
+ self._finish()
1110
+ }
1111
+ }
1112
+ }
1113
+ }
1114
+
1115
+ Glob.prototype._finish = function () {
1116
+ assert(this instanceof Glob)
1117
+ if (this.aborted)
1118
+ return
1119
+
1120
+ if (this.realpath && !this._didRealpath)
1121
+ return this._realpath()
1122
+
1123
+ common.finish(this)
1124
+ this.emit('end', this.found)
1125
+ }
1126
+
1127
+ Glob.prototype._realpath = function () {
1128
+ if (this._didRealpath)
1129
+ return
1130
+
1131
+ this._didRealpath = true
1132
+
1133
+ var n = this.matches.length
1134
+ if (n === 0)
1135
+ return this._finish()
1136
+
1137
+ var self = this
1138
+ for (var i = 0; i < this.matches.length; i++)
1139
+ this._realpathSet(i, next)
1140
+
1141
+ function next () {
1142
+ if (--n === 0)
1143
+ self._finish()
1144
+ }
1145
+ }
1146
+
1147
+ Glob.prototype._realpathSet = function (index, cb) {
1148
+ var matchset = this.matches[index]
1149
+ if (!matchset)
1150
+ return cb()
1151
+
1152
+ var found = Object.keys(matchset)
1153
+ var self = this
1154
+ var n = found.length
1155
+
1156
+ if (n === 0)
1157
+ return cb()
1158
+
1159
+ var set = this.matches[index] = Object.create(null)
1160
+ found.forEach(function (p, i) {
1161
+ // If there's a problem with the stat, then it means that
1162
+ // one or more of the links in the realpath couldn't be
1163
+ // resolved. just return the abs value in that case.
1164
+ p = self._makeAbs(p)
1165
+ rp.realpath(p, self.realpathCache, function (er, real) {
1166
+ if (!er)
1167
+ set[real] = true
1168
+ else if (er.syscall === 'stat')
1169
+ set[p] = true
1170
+ else
1171
+ self.emit('error', er) // srsly wtf right here
1172
+
1173
+ if (--n === 0) {
1174
+ self.matches[index] = set
1175
+ cb()
1176
+ }
1177
+ })
1178
+ })
1179
+ }
1180
+
1181
+ Glob.prototype._mark = function (p) {
1182
+ return common.mark(this, p)
1183
+ }
1184
+
1185
+ Glob.prototype._makeAbs = function (f) {
1186
+ return common.makeAbs(this, f)
1187
+ }
1188
+
1189
+ Glob.prototype.abort = function () {
1190
+ this.aborted = true
1191
+ this.emit('abort')
1192
+ }
1193
+
1194
+ Glob.prototype.pause = function () {
1195
+ if (!this.paused) {
1196
+ this.paused = true
1197
+ this.emit('pause')
1198
+ }
1199
+ }
1200
+
1201
+ Glob.prototype.resume = function () {
1202
+ if (this.paused) {
1203
+ this.emit('resume')
1204
+ this.paused = false
1205
+ if (this._emitQueue.length) {
1206
+ var eq = this._emitQueue.slice(0)
1207
+ this._emitQueue.length = 0
1208
+ for (var i = 0; i < eq.length; i ++) {
1209
+ var e = eq[i]
1210
+ this._emitMatch(e[0], e[1])
1211
+ }
1212
+ }
1213
+ if (this._processQueue.length) {
1214
+ var pq = this._processQueue.slice(0)
1215
+ this._processQueue.length = 0
1216
+ for (var i = 0; i < pq.length; i ++) {
1217
+ var p = pq[i]
1218
+ this._processing--
1219
+ this._process(p[0], p[1], p[2], p[3])
1220
+ }
1221
+ }
1222
+ }
1223
+ }
1224
+
1225
+ Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
1226
+ assert(this instanceof Glob)
1227
+ assert(typeof cb === 'function')
1228
+
1229
+ if (this.aborted)
1230
+ return
1231
+
1232
+ this._processing++
1233
+ if (this.paused) {
1234
+ this._processQueue.push([pattern, index, inGlobStar, cb])
1235
+ return
1236
+ }
1237
+
1238
+ //console.error('PROCESS %d', this._processing, pattern)
1239
+
1240
+ // Get the first [n] parts of pattern that are all strings.
1241
+ var n = 0
1242
+ while (typeof pattern[n] === 'string') {
1243
+ n ++
1244
+ }
1245
+ // now n is the index of the first one that is *not* a string.
1246
+
1247
+ // see if there's anything else
1248
+ var prefix
1249
+ switch (n) {
1250
+ // if not, then this is rather simple
1251
+ case pattern.length:
1252
+ this._processSimple(pattern.join('/'), index, cb)
1253
+ return
1254
+
1255
+ case 0:
1256
+ // pattern *starts* with some non-trivial item.
1257
+ // going to readdir(cwd), but not include the prefix in matches.
1258
+ prefix = null
1259
+ break
1260
+
1261
+ default:
1262
+ // pattern has some string bits in the front.
1263
+ // whatever it starts with, whether that's 'absolute' like /foo/bar,
1264
+ // or 'relative' like '../baz'
1265
+ prefix = pattern.slice(0, n).join('/')
1266
+ break
1267
+ }
1268
+
1269
+ var remain = pattern.slice(n)
1270
+
1271
+ // get the list of entries.
1272
+ var read
1273
+ if (prefix === null)
1274
+ read = '.'
1275
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
1276
+ if (!prefix || !isAbsolute(prefix))
1277
+ prefix = '/' + prefix
1278
+ read = prefix
1279
+ } else
1280
+ read = prefix
1281
+
1282
+ var abs = this._makeAbs(read)
1283
+
1284
+ //if ignored, skip _processing
1285
+ if (childrenIgnored(this, read))
1286
+ return cb()
1287
+
1288
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
1289
+ if (isGlobStar)
1290
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
1291
+ else
1292
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
1293
+ }
1294
+
1295
+ Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
1296
+ var self = this
1297
+ this._readdir(abs, inGlobStar, function (er, entries) {
1298
+ return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
1299
+ })
1300
+ }
1301
+
1302
+ Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
1303
+
1304
+ // if the abs isn't a dir, then nothing can match!
1305
+ if (!entries)
1306
+ return cb()
1307
+
1308
+ // It will only match dot entries if it starts with a dot, or if
1309
+ // dot is set. Stuff like @(.foo|.bar) isn't allowed.
1310
+ var pn = remain[0]
1311
+ var negate = !!this.minimatch.negate
1312
+ var rawGlob = pn._glob
1313
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
1314
+
1315
+ var matchedEntries = []
1316
+ for (var i = 0; i < entries.length; i++) {
1317
+ var e = entries[i]
1318
+ if (e.charAt(0) !== '.' || dotOk) {
1319
+ var m
1320
+ if (negate && !prefix) {
1321
+ m = !e.match(pn)
1322
+ } else {
1323
+ m = e.match(pn)
1324
+ }
1325
+ if (m)
1326
+ matchedEntries.push(e)
1327
+ }
1328
+ }
1329
+
1330
+ //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
1331
+
1332
+ var len = matchedEntries.length
1333
+ // If there are no matched entries, then nothing matches.
1334
+ if (len === 0)
1335
+ return cb()
1336
+
1337
+ // if this is the last remaining pattern bit, then no need for
1338
+ // an additional stat *unless* the user has specified mark or
1339
+ // stat explicitly. We know they exist, since readdir returned
1340
+ // them.
1341
+
1342
+ if (remain.length === 1 && !this.mark && !this.stat) {
1343
+ if (!this.matches[index])
1344
+ this.matches[index] = Object.create(null)
1345
+
1346
+ for (var i = 0; i < len; i ++) {
1347
+ var e = matchedEntries[i]
1348
+ if (prefix) {
1349
+ if (prefix !== '/')
1350
+ e = prefix + '/' + e
1351
+ else
1352
+ e = prefix + e
1353
+ }
1354
+
1355
+ if (e.charAt(0) === '/' && !this.nomount) {
1356
+ e = path.join(this.root, e)
1357
+ }
1358
+ this._emitMatch(index, e)
1359
+ }
1360
+ // This was the last one, and no stats were needed
1361
+ return cb()
1362
+ }
1363
+
1364
+ // now test all matched entries as stand-ins for that part
1365
+ // of the pattern.
1366
+ remain.shift()
1367
+ for (var i = 0; i < len; i ++) {
1368
+ var e = matchedEntries[i]
1369
+ var newPattern
1370
+ if (prefix) {
1371
+ if (prefix !== '/')
1372
+ e = prefix + '/' + e
1373
+ else
1374
+ e = prefix + e
1375
+ }
1376
+ this._process([e].concat(remain), index, inGlobStar, cb)
1377
+ }
1378
+ cb()
1379
+ }
1380
+
1381
+ Glob.prototype._emitMatch = function (index, e) {
1382
+ if (this.aborted)
1383
+ return
1384
+
1385
+ if (isIgnored(this, e))
1386
+ return
1387
+
1388
+ if (this.paused) {
1389
+ this._emitQueue.push([index, e])
1390
+ return
1391
+ }
1392
+
1393
+ var abs = isAbsolute(e) ? e : this._makeAbs(e)
1394
+
1395
+ if (this.mark)
1396
+ e = this._mark(e)
1397
+
1398
+ if (this.absolute)
1399
+ e = abs
1400
+
1401
+ if (this.matches[index][e])
1402
+ return
1403
+
1404
+ if (this.nodir) {
1405
+ var c = this.cache[abs]
1406
+ if (c === 'DIR' || Array.isArray(c))
1407
+ return
1408
+ }
1409
+
1410
+ this.matches[index][e] = true
1411
+
1412
+ var st = this.statCache[abs]
1413
+ if (st)
1414
+ this.emit('stat', e, st)
1415
+
1416
+ this.emit('match', e)
1417
+ }
1418
+
1419
+ Glob.prototype._readdirInGlobStar = function (abs, cb) {
1420
+ if (this.aborted)
1421
+ return
1422
+
1423
+ // follow all symlinked directories forever
1424
+ // just proceed as if this is a non-globstar situation
1425
+ if (this.follow)
1426
+ return this._readdir(abs, false, cb)
1427
+
1428
+ var lstatkey = 'lstat\0' + abs
1429
+ var self = this
1430
+ var lstatcb = inflight(lstatkey, lstatcb_)
1431
+
1432
+ if (lstatcb)
1433
+ fs.lstat(abs, lstatcb)
1434
+
1435
+ function lstatcb_ (er, lstat) {
1436
+ if (er && er.code === 'ENOENT')
1437
+ return cb()
1438
+
1439
+ var isSym = lstat && lstat.isSymbolicLink()
1440
+ self.symlinks[abs] = isSym
1441
+
1442
+ // If it's not a symlink or a dir, then it's definitely a regular file.
1443
+ // don't bother doing a readdir in that case.
1444
+ if (!isSym && lstat && !lstat.isDirectory()) {
1445
+ self.cache[abs] = 'FILE'
1446
+ cb()
1447
+ } else
1448
+ self._readdir(abs, false, cb)
1449
+ }
1450
+ }
1451
+
1452
+ Glob.prototype._readdir = function (abs, inGlobStar, cb) {
1453
+ if (this.aborted)
1454
+ return
1455
+
1456
+ cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
1457
+ if (!cb)
1458
+ return
1459
+
1460
+ //console.error('RD %j %j', +inGlobStar, abs)
1461
+ if (inGlobStar && !ownProp(this.symlinks, abs))
1462
+ return this._readdirInGlobStar(abs, cb)
1463
+
1464
+ if (ownProp(this.cache, abs)) {
1465
+ var c = this.cache[abs]
1466
+ if (!c || c === 'FILE')
1467
+ return cb()
1468
+
1469
+ if (Array.isArray(c))
1470
+ return cb(null, c)
1471
+ }
1472
+
1473
+ var self = this
1474
+ fs.readdir(abs, readdirCb(this, abs, cb))
1475
+ }
1476
+
1477
+ function readdirCb (self, abs, cb) {
1478
+ return function (er, entries) {
1479
+ if (er)
1480
+ self._readdirError(abs, er, cb)
1481
+ else
1482
+ self._readdirEntries(abs, entries, cb)
1483
+ }
1484
+ }
1485
+
1486
+ Glob.prototype._readdirEntries = function (abs, entries, cb) {
1487
+ if (this.aborted)
1488
+ return
1489
+
1490
+ // if we haven't asked to stat everything, then just
1491
+ // assume that everything in there exists, so we can avoid
1492
+ // having to stat it a second time.
1493
+ if (!this.mark && !this.stat) {
1494
+ for (var i = 0; i < entries.length; i ++) {
1495
+ var e = entries[i]
1496
+ if (abs === '/')
1497
+ e = abs + e
1498
+ else
1499
+ e = abs + '/' + e
1500
+ this.cache[e] = true
1501
+ }
1502
+ }
1503
+
1504
+ this.cache[abs] = entries
1505
+ return cb(null, entries)
1506
+ }
1507
+
1508
+ Glob.prototype._readdirError = function (f, er, cb) {
1509
+ if (this.aborted)
1510
+ return
1511
+
1512
+ // handle errors, and cache the information
1513
+ switch (er.code) {
1514
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
1515
+ case 'ENOTDIR': // totally normal. means it *does* exist.
1516
+ var abs = this._makeAbs(f)
1517
+ this.cache[abs] = 'FILE'
1518
+ if (abs === this.cwdAbs) {
1519
+ var error = new Error(er.code + ' invalid cwd ' + this.cwd)
1520
+ error.path = this.cwd
1521
+ error.code = er.code
1522
+ this.emit('error', error)
1523
+ this.abort()
1524
+ }
1525
+ break
1526
+
1527
+ case 'ENOENT': // not terribly unusual
1528
+ case 'ELOOP':
1529
+ case 'ENAMETOOLONG':
1530
+ case 'UNKNOWN':
1531
+ this.cache[this._makeAbs(f)] = false
1532
+ break
1533
+
1534
+ default: // some unusual error. Treat as failure.
1535
+ this.cache[this._makeAbs(f)] = false
1536
+ if (this.strict) {
1537
+ this.emit('error', er)
1538
+ // If the error is handled, then we abort
1539
+ // if not, we threw out of here
1540
+ this.abort()
1541
+ }
1542
+ if (!this.silent)
1543
+ console.error('glob error', er)
1544
+ break
1545
+ }
1546
+
1547
+ return cb()
1548
+ }
1549
+
1550
+ Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
1551
+ var self = this
1552
+ this._readdir(abs, inGlobStar, function (er, entries) {
1553
+ self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
1554
+ })
1555
+ }
1556
+
1557
+
1558
+ Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
1559
+ //console.error('pgs2', prefix, remain[0], entries)
1560
+
1561
+ // no entries means not a dir, so it can never have matches
1562
+ // foo.txt/** doesn't match foo.txt
1563
+ if (!entries)
1564
+ return cb()
1565
+
1566
+ // test without the globstar, and with every child both below
1567
+ // and replacing the globstar.
1568
+ var remainWithoutGlobStar = remain.slice(1)
1569
+ var gspref = prefix ? [ prefix ] : []
1570
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
1571
+
1572
+ // the noGlobStar pattern exits the inGlobStar state
1573
+ this._process(noGlobStar, index, false, cb)
1574
+
1575
+ var isSym = this.symlinks[abs]
1576
+ var len = entries.length
1577
+
1578
+ // If it's a symlink, and we're in a globstar, then stop
1579
+ if (isSym && inGlobStar)
1580
+ return cb()
1581
+
1582
+ for (var i = 0; i < len; i++) {
1583
+ var e = entries[i]
1584
+ if (e.charAt(0) === '.' && !this.dot)
1585
+ continue
1586
+
1587
+ // these two cases enter the inGlobStar state
1588
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
1589
+ this._process(instead, index, true, cb)
1590
+
1591
+ var below = gspref.concat(entries[i], remain)
1592
+ this._process(below, index, true, cb)
1593
+ }
1594
+
1595
+ cb()
1596
+ }
1597
+
1598
+ Glob.prototype._processSimple = function (prefix, index, cb) {
1599
+ // XXX review this. Shouldn't it be doing the mounting etc
1600
+ // before doing stat? kinda weird?
1601
+ var self = this
1602
+ this._stat(prefix, function (er, exists) {
1603
+ self._processSimple2(prefix, index, er, exists, cb)
1604
+ })
1605
+ }
1606
+ Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
1607
+
1608
+ //console.error('ps2', prefix, exists)
1609
+
1610
+ if (!this.matches[index])
1611
+ this.matches[index] = Object.create(null)
1612
+
1613
+ // If it doesn't exist, then just mark the lack of results
1614
+ if (!exists)
1615
+ return cb()
1616
+
1617
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
1618
+ var trail = /[\/\\]$/.test(prefix)
1619
+ if (prefix.charAt(0) === '/') {
1620
+ prefix = path.join(this.root, prefix)
1621
+ } else {
1622
+ prefix = path.resolve(this.root, prefix)
1623
+ if (trail)
1624
+ prefix += '/'
1625
+ }
1626
+ }
1627
+
1628
+ if (process.platform === 'win32')
1629
+ prefix = prefix.replace(/\\/g, '/')
1630
+
1631
+ // Mark this as a match
1632
+ this._emitMatch(index, prefix)
1633
+ cb()
1634
+ }
1635
+
1636
+ // Returns either 'DIR', 'FILE', or false
1637
+ Glob.prototype._stat = function (f, cb) {
1638
+ var abs = this._makeAbs(f)
1639
+ var needDir = f.slice(-1) === '/'
1640
+
1641
+ if (f.length > this.maxLength)
1642
+ return cb()
1643
+
1644
+ if (!this.stat && ownProp(this.cache, abs)) {
1645
+ var c = this.cache[abs]
1646
+
1647
+ if (Array.isArray(c))
1648
+ c = 'DIR'
1649
+
1650
+ // It exists, but maybe not how we need it
1651
+ if (!needDir || c === 'DIR')
1652
+ return cb(null, c)
1653
+
1654
+ if (needDir && c === 'FILE')
1655
+ return cb()
1656
+
1657
+ // otherwise we have to stat, because maybe c=true
1658
+ // if we know it exists, but not what it is.
1659
+ }
1660
+
1661
+ var exists
1662
+ var stat = this.statCache[abs]
1663
+ if (stat !== undefined) {
1664
+ if (stat === false)
1665
+ return cb(null, stat)
1666
+ else {
1667
+ var type = stat.isDirectory() ? 'DIR' : 'FILE'
1668
+ if (needDir && type === 'FILE')
1669
+ return cb()
1670
+ else
1671
+ return cb(null, type, stat)
1672
+ }
1673
+ }
1674
+
1675
+ var self = this
1676
+ var statcb = inflight('stat\0' + abs, lstatcb_)
1677
+ if (statcb)
1678
+ fs.lstat(abs, statcb)
1679
+
1680
+ function lstatcb_ (er, lstat) {
1681
+ if (lstat && lstat.isSymbolicLink()) {
1682
+ // If it's a symlink, then treat it as the target, unless
1683
+ // the target does not exist, then treat it as a file.
1684
+ return fs.stat(abs, function (er, stat) {
1685
+ if (er)
1686
+ self._stat2(f, abs, null, lstat, cb)
1687
+ else
1688
+ self._stat2(f, abs, er, stat, cb)
1689
+ })
1690
+ } else {
1691
+ self._stat2(f, abs, er, lstat, cb)
1692
+ }
1693
+ }
1694
+ }
1695
+
1696
+ Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
1697
+ if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
1698
+ this.statCache[abs] = false
1699
+ return cb()
1700
+ }
1701
+
1702
+ var needDir = f.slice(-1) === '/'
1703
+ this.statCache[abs] = stat
1704
+
1705
+ if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
1706
+ return cb(null, false, stat)
1707
+
1708
+ var c = true
1709
+ if (stat)
1710
+ c = stat.isDirectory() ? 'DIR' : 'FILE'
1711
+ this.cache[abs] = this.cache[abs] || c
1712
+
1713
+ if (needDir && c === 'FILE')
1714
+ return cb()
1715
+
1716
+ return cb(null, c, stat)
1717
+ }
1718
+
1719
+
1720
+ /***/ }),
1721
+
1722
+ /***/ 14751:
1723
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1724
+
1725
+ module.exports = globSync
1726
+ globSync.GlobSync = GlobSync
1727
+
1728
+ var fs = __webpack_require__(35747)
1729
+ var rp = __webpack_require__(37334)
1730
+ var minimatch = __webpack_require__(91171)
1731
+ var Minimatch = minimatch.Minimatch
1732
+ var Glob = __webpack_require__(12884).Glob
1733
+ var util = __webpack_require__(31669)
1734
+ var path = __webpack_require__(85622)
1735
+ var assert = __webpack_require__(42357)
1736
+ var isAbsolute = __webpack_require__(64095)
1737
+ var common = __webpack_require__(66772)
1738
+ var setopts = common.setopts
1739
+ var ownProp = common.ownProp
1740
+ var childrenIgnored = common.childrenIgnored
1741
+ var isIgnored = common.isIgnored
1742
+
1743
+ function globSync (pattern, options) {
1744
+ if (typeof options === 'function' || arguments.length === 3)
1745
+ throw new TypeError('callback provided to sync glob\n'+
1746
+ 'See: https://github.com/isaacs/node-glob/issues/167')
1747
+
1748
+ return new GlobSync(pattern, options).found
1749
+ }
1750
+
1751
+ function GlobSync (pattern, options) {
1752
+ if (!pattern)
1753
+ throw new Error('must provide pattern')
1754
+
1755
+ if (typeof options === 'function' || arguments.length === 3)
1756
+ throw new TypeError('callback provided to sync glob\n'+
1757
+ 'See: https://github.com/isaacs/node-glob/issues/167')
1758
+
1759
+ if (!(this instanceof GlobSync))
1760
+ return new GlobSync(pattern, options)
1761
+
1762
+ setopts(this, pattern, options)
1763
+
1764
+ if (this.noprocess)
1765
+ return this
1766
+
1767
+ var n = this.minimatch.set.length
1768
+ this.matches = new Array(n)
1769
+ for (var i = 0; i < n; i ++) {
1770
+ this._process(this.minimatch.set[i], i, false)
1771
+ }
1772
+ this._finish()
1773
+ }
1774
+
1775
+ GlobSync.prototype._finish = function () {
1776
+ assert(this instanceof GlobSync)
1777
+ if (this.realpath) {
1778
+ var self = this
1779
+ this.matches.forEach(function (matchset, index) {
1780
+ var set = self.matches[index] = Object.create(null)
1781
+ for (var p in matchset) {
1782
+ try {
1783
+ p = self._makeAbs(p)
1784
+ var real = rp.realpathSync(p, self.realpathCache)
1785
+ set[real] = true
1786
+ } catch (er) {
1787
+ if (er.syscall === 'stat')
1788
+ set[self._makeAbs(p)] = true
1789
+ else
1790
+ throw er
1791
+ }
1792
+ }
1793
+ })
1794
+ }
1795
+ common.finish(this)
1796
+ }
1797
+
1798
+
1799
+ GlobSync.prototype._process = function (pattern, index, inGlobStar) {
1800
+ assert(this instanceof GlobSync)
1801
+
1802
+ // Get the first [n] parts of pattern that are all strings.
1803
+ var n = 0
1804
+ while (typeof pattern[n] === 'string') {
1805
+ n ++
1806
+ }
1807
+ // now n is the index of the first one that is *not* a string.
1808
+
1809
+ // See if there's anything else
1810
+ var prefix
1811
+ switch (n) {
1812
+ // if not, then this is rather simple
1813
+ case pattern.length:
1814
+ this._processSimple(pattern.join('/'), index)
1815
+ return
1816
+
1817
+ case 0:
1818
+ // pattern *starts* with some non-trivial item.
1819
+ // going to readdir(cwd), but not include the prefix in matches.
1820
+ prefix = null
1821
+ break
1822
+
1823
+ default:
1824
+ // pattern has some string bits in the front.
1825
+ // whatever it starts with, whether that's 'absolute' like /foo/bar,
1826
+ // or 'relative' like '../baz'
1827
+ prefix = pattern.slice(0, n).join('/')
1828
+ break
1829
+ }
1830
+
1831
+ var remain = pattern.slice(n)
1832
+
1833
+ // get the list of entries.
1834
+ var read
1835
+ if (prefix === null)
1836
+ read = '.'
1837
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
1838
+ if (!prefix || !isAbsolute(prefix))
1839
+ prefix = '/' + prefix
1840
+ read = prefix
1841
+ } else
1842
+ read = prefix
1843
+
1844
+ var abs = this._makeAbs(read)
1845
+
1846
+ //if ignored, skip processing
1847
+ if (childrenIgnored(this, read))
1848
+ return
1849
+
1850
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
1851
+ if (isGlobStar)
1852
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
1853
+ else
1854
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
1855
+ }
1856
+
1857
+
1858
+ GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
1859
+ var entries = this._readdir(abs, inGlobStar)
1860
+
1861
+ // if the abs isn't a dir, then nothing can match!
1862
+ if (!entries)
1863
+ return
1864
+
1865
+ // It will only match dot entries if it starts with a dot, or if
1866
+ // dot is set. Stuff like @(.foo|.bar) isn't allowed.
1867
+ var pn = remain[0]
1868
+ var negate = !!this.minimatch.negate
1869
+ var rawGlob = pn._glob
1870
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
1871
+
1872
+ var matchedEntries = []
1873
+ for (var i = 0; i < entries.length; i++) {
1874
+ var e = entries[i]
1875
+ if (e.charAt(0) !== '.' || dotOk) {
1876
+ var m
1877
+ if (negate && !prefix) {
1878
+ m = !e.match(pn)
1879
+ } else {
1880
+ m = e.match(pn)
1881
+ }
1882
+ if (m)
1883
+ matchedEntries.push(e)
1884
+ }
1885
+ }
1886
+
1887
+ var len = matchedEntries.length
1888
+ // If there are no matched entries, then nothing matches.
1889
+ if (len === 0)
1890
+ return
1891
+
1892
+ // if this is the last remaining pattern bit, then no need for
1893
+ // an additional stat *unless* the user has specified mark or
1894
+ // stat explicitly. We know they exist, since readdir returned
1895
+ // them.
1896
+
1897
+ if (remain.length === 1 && !this.mark && !this.stat) {
1898
+ if (!this.matches[index])
1899
+ this.matches[index] = Object.create(null)
1900
+
1901
+ for (var i = 0; i < len; i ++) {
1902
+ var e = matchedEntries[i]
1903
+ if (prefix) {
1904
+ if (prefix.slice(-1) !== '/')
1905
+ e = prefix + '/' + e
1906
+ else
1907
+ e = prefix + e
1908
+ }
1909
+
1910
+ if (e.charAt(0) === '/' && !this.nomount) {
1911
+ e = path.join(this.root, e)
1912
+ }
1913
+ this._emitMatch(index, e)
1914
+ }
1915
+ // This was the last one, and no stats were needed
1916
+ return
1917
+ }
1918
+
1919
+ // now test all matched entries as stand-ins for that part
1920
+ // of the pattern.
1921
+ remain.shift()
1922
+ for (var i = 0; i < len; i ++) {
1923
+ var e = matchedEntries[i]
1924
+ var newPattern
1925
+ if (prefix)
1926
+ newPattern = [prefix, e]
1927
+ else
1928
+ newPattern = [e]
1929
+ this._process(newPattern.concat(remain), index, inGlobStar)
1930
+ }
1931
+ }
1932
+
1933
+
1934
+ GlobSync.prototype._emitMatch = function (index, e) {
1935
+ if (isIgnored(this, e))
1936
+ return
1937
+
1938
+ var abs = this._makeAbs(e)
1939
+
1940
+ if (this.mark)
1941
+ e = this._mark(e)
1942
+
1943
+ if (this.absolute) {
1944
+ e = abs
1945
+ }
1946
+
1947
+ if (this.matches[index][e])
1948
+ return
1949
+
1950
+ if (this.nodir) {
1951
+ var c = this.cache[abs]
1952
+ if (c === 'DIR' || Array.isArray(c))
1953
+ return
1954
+ }
1955
+
1956
+ this.matches[index][e] = true
1957
+
1958
+ if (this.stat)
1959
+ this._stat(e)
1960
+ }
1961
+
1962
+
1963
+ GlobSync.prototype._readdirInGlobStar = function (abs) {
1964
+ // follow all symlinked directories forever
1965
+ // just proceed as if this is a non-globstar situation
1966
+ if (this.follow)
1967
+ return this._readdir(abs, false)
1968
+
1969
+ var entries
1970
+ var lstat
1971
+ var stat
1972
+ try {
1973
+ lstat = fs.lstatSync(abs)
1974
+ } catch (er) {
1975
+ if (er.code === 'ENOENT') {
1976
+ // lstat failed, doesn't exist
1977
+ return null
1978
+ }
1979
+ }
1980
+
1981
+ var isSym = lstat && lstat.isSymbolicLink()
1982
+ this.symlinks[abs] = isSym
1983
+
1984
+ // If it's not a symlink or a dir, then it's definitely a regular file.
1985
+ // don't bother doing a readdir in that case.
1986
+ if (!isSym && lstat && !lstat.isDirectory())
1987
+ this.cache[abs] = 'FILE'
1988
+ else
1989
+ entries = this._readdir(abs, false)
1990
+
1991
+ return entries
1992
+ }
1993
+
1994
+ GlobSync.prototype._readdir = function (abs, inGlobStar) {
1995
+ var entries
1996
+
1997
+ if (inGlobStar && !ownProp(this.symlinks, abs))
1998
+ return this._readdirInGlobStar(abs)
1999
+
2000
+ if (ownProp(this.cache, abs)) {
2001
+ var c = this.cache[abs]
2002
+ if (!c || c === 'FILE')
2003
+ return null
2004
+
2005
+ if (Array.isArray(c))
2006
+ return c
2007
+ }
2008
+
2009
+ try {
2010
+ return this._readdirEntries(abs, fs.readdirSync(abs))
2011
+ } catch (er) {
2012
+ this._readdirError(abs, er)
2013
+ return null
2014
+ }
2015
+ }
2016
+
2017
+ GlobSync.prototype._readdirEntries = function (abs, entries) {
2018
+ // if we haven't asked to stat everything, then just
2019
+ // assume that everything in there exists, so we can avoid
2020
+ // having to stat it a second time.
2021
+ if (!this.mark && !this.stat) {
2022
+ for (var i = 0; i < entries.length; i ++) {
2023
+ var e = entries[i]
2024
+ if (abs === '/')
2025
+ e = abs + e
2026
+ else
2027
+ e = abs + '/' + e
2028
+ this.cache[e] = true
2029
+ }
2030
+ }
2031
+
2032
+ this.cache[abs] = entries
2033
+
2034
+ // mark and cache dir-ness
2035
+ return entries
2036
+ }
2037
+
2038
+ GlobSync.prototype._readdirError = function (f, er) {
2039
+ // handle errors, and cache the information
2040
+ switch (er.code) {
2041
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
2042
+ case 'ENOTDIR': // totally normal. means it *does* exist.
2043
+ var abs = this._makeAbs(f)
2044
+ this.cache[abs] = 'FILE'
2045
+ if (abs === this.cwdAbs) {
2046
+ var error = new Error(er.code + ' invalid cwd ' + this.cwd)
2047
+ error.path = this.cwd
2048
+ error.code = er.code
2049
+ throw error
2050
+ }
2051
+ break
2052
+
2053
+ case 'ENOENT': // not terribly unusual
2054
+ case 'ELOOP':
2055
+ case 'ENAMETOOLONG':
2056
+ case 'UNKNOWN':
2057
+ this.cache[this._makeAbs(f)] = false
2058
+ break
2059
+
2060
+ default: // some unusual error. Treat as failure.
2061
+ this.cache[this._makeAbs(f)] = false
2062
+ if (this.strict)
2063
+ throw er
2064
+ if (!this.silent)
2065
+ console.error('glob error', er)
2066
+ break
2067
+ }
2068
+ }
2069
+
2070
+ GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
2071
+
2072
+ var entries = this._readdir(abs, inGlobStar)
2073
+
2074
+ // no entries means not a dir, so it can never have matches
2075
+ // foo.txt/** doesn't match foo.txt
2076
+ if (!entries)
2077
+ return
2078
+
2079
+ // test without the globstar, and with every child both below
2080
+ // and replacing the globstar.
2081
+ var remainWithoutGlobStar = remain.slice(1)
2082
+ var gspref = prefix ? [ prefix ] : []
2083
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
2084
+
2085
+ // the noGlobStar pattern exits the inGlobStar state
2086
+ this._process(noGlobStar, index, false)
2087
+
2088
+ var len = entries.length
2089
+ var isSym = this.symlinks[abs]
2090
+
2091
+ // If it's a symlink, and we're in a globstar, then stop
2092
+ if (isSym && inGlobStar)
2093
+ return
2094
+
2095
+ for (var i = 0; i < len; i++) {
2096
+ var e = entries[i]
2097
+ if (e.charAt(0) === '.' && !this.dot)
2098
+ continue
2099
+
2100
+ // these two cases enter the inGlobStar state
2101
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
2102
+ this._process(instead, index, true)
2103
+
2104
+ var below = gspref.concat(entries[i], remain)
2105
+ this._process(below, index, true)
2106
+ }
2107
+ }
2108
+
2109
+ GlobSync.prototype._processSimple = function (prefix, index) {
2110
+ // XXX review this. Shouldn't it be doing the mounting etc
2111
+ // before doing stat? kinda weird?
2112
+ var exists = this._stat(prefix)
2113
+
2114
+ if (!this.matches[index])
2115
+ this.matches[index] = Object.create(null)
2116
+
2117
+ // If it doesn't exist, then just mark the lack of results
2118
+ if (!exists)
2119
+ return
2120
+
2121
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
2122
+ var trail = /[\/\\]$/.test(prefix)
2123
+ if (prefix.charAt(0) === '/') {
2124
+ prefix = path.join(this.root, prefix)
2125
+ } else {
2126
+ prefix = path.resolve(this.root, prefix)
2127
+ if (trail)
2128
+ prefix += '/'
2129
+ }
2130
+ }
2131
+
2132
+ if (process.platform === 'win32')
2133
+ prefix = prefix.replace(/\\/g, '/')
2134
+
2135
+ // Mark this as a match
2136
+ this._emitMatch(index, prefix)
2137
+ }
2138
+
2139
+ // Returns either 'DIR', 'FILE', or false
2140
+ GlobSync.prototype._stat = function (f) {
2141
+ var abs = this._makeAbs(f)
2142
+ var needDir = f.slice(-1) === '/'
2143
+
2144
+ if (f.length > this.maxLength)
2145
+ return false
2146
+
2147
+ if (!this.stat && ownProp(this.cache, abs)) {
2148
+ var c = this.cache[abs]
2149
+
2150
+ if (Array.isArray(c))
2151
+ c = 'DIR'
2152
+
2153
+ // It exists, but maybe not how we need it
2154
+ if (!needDir || c === 'DIR')
2155
+ return c
2156
+
2157
+ if (needDir && c === 'FILE')
2158
+ return false
2159
+
2160
+ // otherwise we have to stat, because maybe c=true
2161
+ // if we know it exists, but not what it is.
2162
+ }
2163
+
2164
+ var exists
2165
+ var stat = this.statCache[abs]
2166
+ if (!stat) {
2167
+ var lstat
2168
+ try {
2169
+ lstat = fs.lstatSync(abs)
2170
+ } catch (er) {
2171
+ if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
2172
+ this.statCache[abs] = false
2173
+ return false
2174
+ }
2175
+ }
2176
+
2177
+ if (lstat && lstat.isSymbolicLink()) {
2178
+ try {
2179
+ stat = fs.statSync(abs)
2180
+ } catch (er) {
2181
+ stat = lstat
2182
+ }
2183
+ } else {
2184
+ stat = lstat
2185
+ }
2186
+ }
2187
+
2188
+ this.statCache[abs] = stat
2189
+
2190
+ var c = true
2191
+ if (stat)
2192
+ c = stat.isDirectory() ? 'DIR' : 'FILE'
2193
+
2194
+ this.cache[abs] = this.cache[abs] || c
2195
+
2196
+ if (needDir && c === 'FILE')
2197
+ return false
2198
+
2199
+ return c
2200
+ }
2201
+
2202
+ GlobSync.prototype._mark = function (p) {
2203
+ return common.mark(this, p)
2204
+ }
2205
+
2206
+ GlobSync.prototype._makeAbs = function (f) {
2207
+ return common.makeAbs(this, f)
2208
+ }
2209
+
2210
+
2211
+ /***/ }),
2212
+
2213
+ /***/ 67844:
2214
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2215
+
2216
+ var wrappy = __webpack_require__(52479)
2217
+ var reqs = Object.create(null)
2218
+ var once = __webpack_require__(30778)
2219
+
2220
+ module.exports = wrappy(inflight)
2221
+
2222
+ function inflight (key, cb) {
2223
+ if (reqs[key]) {
2224
+ reqs[key].push(cb)
2225
+ return null
2226
+ } else {
2227
+ reqs[key] = [cb]
2228
+ return makeres(key)
2229
+ }
2230
+ }
2231
+
2232
+ function makeres (key) {
2233
+ return once(function RES () {
2234
+ var cbs = reqs[key]
2235
+ var len = cbs.length
2236
+ var args = slice(arguments)
2237
+
2238
+ // XXX It's somewhat ambiguous whether a new callback added in this
2239
+ // pass should be queued for later execution if something in the
2240
+ // list of callbacks throws, or if it should just be discarded.
2241
+ // However, it's such an edge case that it hardly matters, and either
2242
+ // choice is likely as surprising as the other.
2243
+ // As it happens, we do go ahead and schedule it for later execution.
2244
+ try {
2245
+ for (var i = 0; i < len; i++) {
2246
+ cbs[i].apply(null, args)
2247
+ }
2248
+ } finally {
2249
+ if (cbs.length > len) {
2250
+ // added more in the interim.
2251
+ // de-zalgo, just in case, but don't call again.
2252
+ cbs.splice(0, len)
2253
+ process.nextTick(function () {
2254
+ RES.apply(null, args)
2255
+ })
2256
+ } else {
2257
+ delete reqs[key]
2258
+ }
2259
+ }
2260
+ })
2261
+ }
2262
+
2263
+ function slice (args) {
2264
+ var length = args.length
2265
+ var array = []
2266
+
2267
+ for (var i = 0; i < length; i++) array[i] = args[i]
2268
+ return array
2269
+ }
2270
+
2271
+
2272
+ /***/ }),
2273
+
2274
+ /***/ 5800:
2275
+ /***/ ((module) => {
2276
+
2277
+ /**
2278
+ * lodash (Custom Build) <https://lodash.com/>
2279
+ * Build: `lodash modularize exports="npm" -o ./`
2280
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
2281
+ * Released under MIT license <https://lodash.com/license>
2282
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2283
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2284
+ */
2285
+
2286
+ /** Used as references for various `Number` constants. */
2287
+ var MAX_SAFE_INTEGER = 9007199254740991;
2288
+
2289
+ /** `Object#toString` result references. */
2290
+ var argsTag = '[object Arguments]',
2291
+ funcTag = '[object Function]',
2292
+ genTag = '[object GeneratorFunction]';
2293
+
2294
+ /** Detect free variable `global` from Node.js. */
2295
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
2296
+
2297
+ /** Detect free variable `self`. */
2298
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
2299
+
2300
+ /** Used as a reference to the global object. */
2301
+ var root = freeGlobal || freeSelf || Function('return this')();
2302
+
2303
+ /**
2304
+ * Appends the elements of `values` to `array`.
2305
+ *
2306
+ * @private
2307
+ * @param {Array} array The array to modify.
2308
+ * @param {Array} values The values to append.
2309
+ * @returns {Array} Returns `array`.
2310
+ */
2311
+ function arrayPush(array, values) {
2312
+ var index = -1,
2313
+ length = values.length,
2314
+ offset = array.length;
2315
+
2316
+ while (++index < length) {
2317
+ array[offset + index] = values[index];
2318
+ }
2319
+ return array;
2320
+ }
2321
+
2322
+ /** Used for built-in method references. */
2323
+ var objectProto = Object.prototype;
2324
+
2325
+ /** Used to check objects for own properties. */
2326
+ var hasOwnProperty = objectProto.hasOwnProperty;
2327
+
2328
+ /**
2329
+ * Used to resolve the
2330
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2331
+ * of values.
2332
+ */
2333
+ var objectToString = objectProto.toString;
2334
+
2335
+ /** Built-in value references. */
2336
+ var Symbol = root.Symbol,
2337
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
2338
+ spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
2339
+
2340
+ /**
2341
+ * The base implementation of `_.flatten` with support for restricting flattening.
2342
+ *
2343
+ * @private
2344
+ * @param {Array} array The array to flatten.
2345
+ * @param {number} depth The maximum recursion depth.
2346
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
2347
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
2348
+ * @param {Array} [result=[]] The initial result value.
2349
+ * @returns {Array} Returns the new flattened array.
2350
+ */
2351
+ function baseFlatten(array, depth, predicate, isStrict, result) {
2352
+ var index = -1,
2353
+ length = array.length;
2354
+
2355
+ predicate || (predicate = isFlattenable);
2356
+ result || (result = []);
2357
+
2358
+ while (++index < length) {
2359
+ var value = array[index];
2360
+ if (depth > 0 && predicate(value)) {
2361
+ if (depth > 1) {
2362
+ // Recursively flatten arrays (susceptible to call stack limits).
2363
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
2364
+ } else {
2365
+ arrayPush(result, value);
2366
+ }
2367
+ } else if (!isStrict) {
2368
+ result[result.length] = value;
2369
+ }
2370
+ }
2371
+ return result;
2372
+ }
2373
+
2374
+ /**
2375
+ * Checks if `value` is a flattenable `arguments` object or array.
2376
+ *
2377
+ * @private
2378
+ * @param {*} value The value to check.
2379
+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
2380
+ */
2381
+ function isFlattenable(value) {
2382
+ return isArray(value) || isArguments(value) ||
2383
+ !!(spreadableSymbol && value && value[spreadableSymbol]);
2384
+ }
2385
+
2386
+ /**
2387
+ * Flattens `array` a single level deep.
2388
+ *
2389
+ * @static
2390
+ * @memberOf _
2391
+ * @since 0.1.0
2392
+ * @category Array
2393
+ * @param {Array} array The array to flatten.
2394
+ * @returns {Array} Returns the new flattened array.
2395
+ * @example
2396
+ *
2397
+ * _.flatten([1, [2, [3, [4]], 5]]);
2398
+ * // => [1, 2, [3, [4]], 5]
2399
+ */
2400
+ function flatten(array) {
2401
+ var length = array ? array.length : 0;
2402
+ return length ? baseFlatten(array, 1) : [];
2403
+ }
2404
+
2405
+ /**
2406
+ * Checks if `value` is likely an `arguments` object.
2407
+ *
2408
+ * @static
2409
+ * @memberOf _
2410
+ * @since 0.1.0
2411
+ * @category Lang
2412
+ * @param {*} value The value to check.
2413
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2414
+ * else `false`.
2415
+ * @example
2416
+ *
2417
+ * _.isArguments(function() { return arguments; }());
2418
+ * // => true
2419
+ *
2420
+ * _.isArguments([1, 2, 3]);
2421
+ * // => false
2422
+ */
2423
+ function isArguments(value) {
2424
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
2425
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
2426
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
2427
+ }
2428
+
2429
+ /**
2430
+ * Checks if `value` is classified as an `Array` object.
2431
+ *
2432
+ * @static
2433
+ * @memberOf _
2434
+ * @since 0.1.0
2435
+ * @category Lang
2436
+ * @param {*} value The value to check.
2437
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
2438
+ * @example
2439
+ *
2440
+ * _.isArray([1, 2, 3]);
2441
+ * // => true
2442
+ *
2443
+ * _.isArray(document.body.children);
2444
+ * // => false
2445
+ *
2446
+ * _.isArray('abc');
2447
+ * // => false
2448
+ *
2449
+ * _.isArray(_.noop);
2450
+ * // => false
2451
+ */
2452
+ var isArray = Array.isArray;
2453
+
2454
+ /**
2455
+ * Checks if `value` is array-like. A value is considered array-like if it's
2456
+ * not a function and has a `value.length` that's an integer greater than or
2457
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2458
+ *
2459
+ * @static
2460
+ * @memberOf _
2461
+ * @since 4.0.0
2462
+ * @category Lang
2463
+ * @param {*} value The value to check.
2464
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2465
+ * @example
2466
+ *
2467
+ * _.isArrayLike([1, 2, 3]);
2468
+ * // => true
2469
+ *
2470
+ * _.isArrayLike(document.body.children);
2471
+ * // => true
2472
+ *
2473
+ * _.isArrayLike('abc');
2474
+ * // => true
2475
+ *
2476
+ * _.isArrayLike(_.noop);
2477
+ * // => false
2478
+ */
2479
+ function isArrayLike(value) {
2480
+ return value != null && isLength(value.length) && !isFunction(value);
2481
+ }
2482
+
2483
+ /**
2484
+ * This method is like `_.isArrayLike` except that it also checks if `value`
2485
+ * is an object.
2486
+ *
2487
+ * @static
2488
+ * @memberOf _
2489
+ * @since 4.0.0
2490
+ * @category Lang
2491
+ * @param {*} value The value to check.
2492
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
2493
+ * else `false`.
2494
+ * @example
2495
+ *
2496
+ * _.isArrayLikeObject([1, 2, 3]);
2497
+ * // => true
2498
+ *
2499
+ * _.isArrayLikeObject(document.body.children);
2500
+ * // => true
2501
+ *
2502
+ * _.isArrayLikeObject('abc');
2503
+ * // => false
2504
+ *
2505
+ * _.isArrayLikeObject(_.noop);
2506
+ * // => false
2507
+ */
2508
+ function isArrayLikeObject(value) {
2509
+ return isObjectLike(value) && isArrayLike(value);
2510
+ }
2511
+
2512
+ /**
2513
+ * Checks if `value` is classified as a `Function` object.
2514
+ *
2515
+ * @static
2516
+ * @memberOf _
2517
+ * @since 0.1.0
2518
+ * @category Lang
2519
+ * @param {*} value The value to check.
2520
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
2521
+ * @example
2522
+ *
2523
+ * _.isFunction(_);
2524
+ * // => true
2525
+ *
2526
+ * _.isFunction(/abc/);
2527
+ * // => false
2528
+ */
2529
+ function isFunction(value) {
2530
+ // The use of `Object#toString` avoids issues with the `typeof` operator
2531
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
2532
+ var tag = isObject(value) ? objectToString.call(value) : '';
2533
+ return tag == funcTag || tag == genTag;
2534
+ }
2535
+
2536
+ /**
2537
+ * Checks if `value` is a valid array-like length.
2538
+ *
2539
+ * **Note:** This method is loosely based on
2540
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2541
+ *
2542
+ * @static
2543
+ * @memberOf _
2544
+ * @since 4.0.0
2545
+ * @category Lang
2546
+ * @param {*} value The value to check.
2547
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2548
+ * @example
2549
+ *
2550
+ * _.isLength(3);
2551
+ * // => true
2552
+ *
2553
+ * _.isLength(Number.MIN_VALUE);
2554
+ * // => false
2555
+ *
2556
+ * _.isLength(Infinity);
2557
+ * // => false
2558
+ *
2559
+ * _.isLength('3');
2560
+ * // => false
2561
+ */
2562
+ function isLength(value) {
2563
+ return typeof value == 'number' &&
2564
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2565
+ }
2566
+
2567
+ /**
2568
+ * Checks if `value` is the
2569
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
2570
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
2571
+ *
2572
+ * @static
2573
+ * @memberOf _
2574
+ * @since 0.1.0
2575
+ * @category Lang
2576
+ * @param {*} value The value to check.
2577
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
2578
+ * @example
2579
+ *
2580
+ * _.isObject({});
2581
+ * // => true
2582
+ *
2583
+ * _.isObject([1, 2, 3]);
2584
+ * // => true
2585
+ *
2586
+ * _.isObject(_.noop);
2587
+ * // => true
2588
+ *
2589
+ * _.isObject(null);
2590
+ * // => false
2591
+ */
2592
+ function isObject(value) {
2593
+ var type = typeof value;
2594
+ return !!value && (type == 'object' || type == 'function');
2595
+ }
2596
+
2597
+ /**
2598
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2599
+ * and has a `typeof` result of "object".
2600
+ *
2601
+ * @static
2602
+ * @memberOf _
2603
+ * @since 4.0.0
2604
+ * @category Lang
2605
+ * @param {*} value The value to check.
2606
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2607
+ * @example
2608
+ *
2609
+ * _.isObjectLike({});
2610
+ * // => true
2611
+ *
2612
+ * _.isObjectLike([1, 2, 3]);
2613
+ * // => true
2614
+ *
2615
+ * _.isObjectLike(_.noop);
2616
+ * // => false
2617
+ *
2618
+ * _.isObjectLike(null);
2619
+ * // => false
2620
+ */
2621
+ function isObjectLike(value) {
2622
+ return !!value && typeof value == 'object';
2623
+ }
2624
+
2625
+ module.exports = flatten;
2626
+
2627
+
2628
+ /***/ }),
2629
+
2630
+ /***/ 91171:
2631
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2632
+
2633
+ module.exports = minimatch
2634
+ minimatch.Minimatch = Minimatch
2635
+
2636
+ var path = { sep: '/' }
2637
+ try {
2638
+ path = __webpack_require__(85622)
2639
+ } catch (er) {}
2640
+
2641
+ var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
2642
+ var expand = __webpack_require__(3644)
2643
+
2644
+ var plTypes = {
2645
+ '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
2646
+ '?': { open: '(?:', close: ')?' },
2647
+ '+': { open: '(?:', close: ')+' },
2648
+ '*': { open: '(?:', close: ')*' },
2649
+ '@': { open: '(?:', close: ')' }
2650
+ }
2651
+
2652
+ // any single thing other than /
2653
+ // don't need to escape / when using new RegExp()
2654
+ var qmark = '[^/]'
2655
+
2656
+ // * => any number of characters
2657
+ var star = qmark + '*?'
2658
+
2659
+ // ** when dots are allowed. Anything goes, except .. and .
2660
+ // not (^ or / followed by one or two dots followed by $ or /),
2661
+ // followed by anything, any number of times.
2662
+ var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
2663
+
2664
+ // not a ^ or / followed by a dot,
2665
+ // followed by anything, any number of times.
2666
+ var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
2667
+
2668
+ // characters that need to be escaped in RegExp.
2669
+ var reSpecials = charSet('().*{}+?[]^$\\!')
2670
+
2671
+ // "abc" -> { a:true, b:true, c:true }
2672
+ function charSet (s) {
2673
+ return s.split('').reduce(function (set, c) {
2674
+ set[c] = true
2675
+ return set
2676
+ }, {})
2677
+ }
2678
+
2679
+ // normalizes slashes.
2680
+ var slashSplit = /\/+/
2681
+
2682
+ minimatch.filter = filter
2683
+ function filter (pattern, options) {
2684
+ options = options || {}
2685
+ return function (p, i, list) {
2686
+ return minimatch(p, pattern, options)
2687
+ }
2688
+ }
2689
+
2690
+ function ext (a, b) {
2691
+ a = a || {}
2692
+ b = b || {}
2693
+ var t = {}
2694
+ Object.keys(b).forEach(function (k) {
2695
+ t[k] = b[k]
2696
+ })
2697
+ Object.keys(a).forEach(function (k) {
2698
+ t[k] = a[k]
2699
+ })
2700
+ return t
2701
+ }
2702
+
2703
+ minimatch.defaults = function (def) {
2704
+ if (!def || !Object.keys(def).length) return minimatch
2705
+
2706
+ var orig = minimatch
2707
+
2708
+ var m = function minimatch (p, pattern, options) {
2709
+ return orig.minimatch(p, pattern, ext(def, options))
2710
+ }
2711
+
2712
+ m.Minimatch = function Minimatch (pattern, options) {
2713
+ return new orig.Minimatch(pattern, ext(def, options))
2714
+ }
2715
+
2716
+ return m
2717
+ }
2718
+
2719
+ Minimatch.defaults = function (def) {
2720
+ if (!def || !Object.keys(def).length) return Minimatch
2721
+ return minimatch.defaults(def).Minimatch
2722
+ }
2723
+
2724
+ function minimatch (p, pattern, options) {
2725
+ if (typeof pattern !== 'string') {
2726
+ throw new TypeError('glob pattern string required')
2727
+ }
2728
+
2729
+ if (!options) options = {}
2730
+
2731
+ // shortcut: comments match nothing.
2732
+ if (!options.nocomment && pattern.charAt(0) === '#') {
2733
+ return false
2734
+ }
2735
+
2736
+ // "" only matches ""
2737
+ if (pattern.trim() === '') return p === ''
2738
+
2739
+ return new Minimatch(pattern, options).match(p)
2740
+ }
2741
+
2742
+ function Minimatch (pattern, options) {
2743
+ if (!(this instanceof Minimatch)) {
2744
+ return new Minimatch(pattern, options)
2745
+ }
2746
+
2747
+ if (typeof pattern !== 'string') {
2748
+ throw new TypeError('glob pattern string required')
2749
+ }
2750
+
2751
+ if (!options) options = {}
2752
+ pattern = pattern.trim()
2753
+
2754
+ // windows support: need to use /, not \
2755
+ if (path.sep !== '/') {
2756
+ pattern = pattern.split(path.sep).join('/')
2757
+ }
2758
+
2759
+ this.options = options
2760
+ this.set = []
2761
+ this.pattern = pattern
2762
+ this.regexp = null
2763
+ this.negate = false
2764
+ this.comment = false
2765
+ this.empty = false
2766
+
2767
+ // make the set of regexps etc.
2768
+ this.make()
2769
+ }
2770
+
2771
+ Minimatch.prototype.debug = function () {}
2772
+
2773
+ Minimatch.prototype.make = make
2774
+ function make () {
2775
+ // don't do it more than once.
2776
+ if (this._made) return
2777
+
2778
+ var pattern = this.pattern
2779
+ var options = this.options
2780
+
2781
+ // empty patterns and comments match nothing.
2782
+ if (!options.nocomment && pattern.charAt(0) === '#') {
2783
+ this.comment = true
2784
+ return
2785
+ }
2786
+ if (!pattern) {
2787
+ this.empty = true
2788
+ return
2789
+ }
2790
+
2791
+ // step 1: figure out negation, etc.
2792
+ this.parseNegate()
2793
+
2794
+ // step 2: expand braces
2795
+ var set = this.globSet = this.braceExpand()
2796
+
2797
+ if (options.debug) this.debug = console.error
2798
+
2799
+ this.debug(this.pattern, set)
2800
+
2801
+ // step 3: now we have a set, so turn each one into a series of path-portion
2802
+ // matching patterns.
2803
+ // These will be regexps, except in the case of "**", which is
2804
+ // set to the GLOBSTAR object for globstar behavior,
2805
+ // and will not contain any / characters
2806
+ set = this.globParts = set.map(function (s) {
2807
+ return s.split(slashSplit)
2808
+ })
2809
+
2810
+ this.debug(this.pattern, set)
2811
+
2812
+ // glob --> regexps
2813
+ set = set.map(function (s, si, set) {
2814
+ return s.map(this.parse, this)
2815
+ }, this)
2816
+
2817
+ this.debug(this.pattern, set)
2818
+
2819
+ // filter out everything that didn't compile properly.
2820
+ set = set.filter(function (s) {
2821
+ return s.indexOf(false) === -1
2822
+ })
2823
+
2824
+ this.debug(this.pattern, set)
2825
+
2826
+ this.set = set
2827
+ }
2828
+
2829
+ Minimatch.prototype.parseNegate = parseNegate
2830
+ function parseNegate () {
2831
+ var pattern = this.pattern
2832
+ var negate = false
2833
+ var options = this.options
2834
+ var negateOffset = 0
2835
+
2836
+ if (options.nonegate) return
2837
+
2838
+ for (var i = 0, l = pattern.length
2839
+ ; i < l && pattern.charAt(i) === '!'
2840
+ ; i++) {
2841
+ negate = !negate
2842
+ negateOffset++
2843
+ }
2844
+
2845
+ if (negateOffset) this.pattern = pattern.substr(negateOffset)
2846
+ this.negate = negate
2847
+ }
2848
+
2849
+ // Brace expansion:
2850
+ // a{b,c}d -> abd acd
2851
+ // a{b,}c -> abc ac
2852
+ // a{0..3}d -> a0d a1d a2d a3d
2853
+ // a{b,c{d,e}f}g -> abg acdfg acefg
2854
+ // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
2855
+ //
2856
+ // Invalid sets are not expanded.
2857
+ // a{2..}b -> a{2..}b
2858
+ // a{b}c -> a{b}c
2859
+ minimatch.braceExpand = function (pattern, options) {
2860
+ return braceExpand(pattern, options)
2861
+ }
2862
+
2863
+ Minimatch.prototype.braceExpand = braceExpand
2864
+
2865
+ function braceExpand (pattern, options) {
2866
+ if (!options) {
2867
+ if (this instanceof Minimatch) {
2868
+ options = this.options
2869
+ } else {
2870
+ options = {}
2871
+ }
2872
+ }
2873
+
2874
+ pattern = typeof pattern === 'undefined'
2875
+ ? this.pattern : pattern
2876
+
2877
+ if (typeof pattern === 'undefined') {
2878
+ throw new TypeError('undefined pattern')
2879
+ }
2880
+
2881
+ if (options.nobrace ||
2882
+ !pattern.match(/\{.*\}/)) {
2883
+ // shortcut. no need to expand.
2884
+ return [pattern]
2885
+ }
2886
+
2887
+ return expand(pattern)
2888
+ }
2889
+
2890
+ // parse a component of the expanded set.
2891
+ // At this point, no pattern may contain "/" in it
2892
+ // so we're going to return a 2d array, where each entry is the full
2893
+ // pattern, split on '/', and then turned into a regular expression.
2894
+ // A regexp is made at the end which joins each array with an
2895
+ // escaped /, and another full one which joins each regexp with |.
2896
+ //
2897
+ // Following the lead of Bash 4.1, note that "**" only has special meaning
2898
+ // when it is the *only* thing in a path portion. Otherwise, any series
2899
+ // of * is equivalent to a single *. Globstar behavior is enabled by
2900
+ // default, and can be disabled by setting options.noglobstar.
2901
+ Minimatch.prototype.parse = parse
2902
+ var SUBPARSE = {}
2903
+ function parse (pattern, isSub) {
2904
+ if (pattern.length > 1024 * 64) {
2905
+ throw new TypeError('pattern is too long')
2906
+ }
2907
+
2908
+ var options = this.options
2909
+
2910
+ // shortcuts
2911
+ if (!options.noglobstar && pattern === '**') return GLOBSTAR
2912
+ if (pattern === '') return ''
2913
+
2914
+ var re = ''
2915
+ var hasMagic = !!options.nocase
2916
+ var escaping = false
2917
+ // ? => one single character
2918
+ var patternListStack = []
2919
+ var negativeLists = []
2920
+ var stateChar
2921
+ var inClass = false
2922
+ var reClassStart = -1
2923
+ var classStart = -1
2924
+ // . and .. never match anything that doesn't start with .,
2925
+ // even when options.dot is set.
2926
+ var patternStart = pattern.charAt(0) === '.' ? '' // anything
2927
+ // not (start or / followed by . or .. followed by / or end)
2928
+ : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
2929
+ : '(?!\\.)'
2930
+ var self = this
2931
+
2932
+ function clearStateChar () {
2933
+ if (stateChar) {
2934
+ // we had some state-tracking character
2935
+ // that wasn't consumed by this pass.
2936
+ switch (stateChar) {
2937
+ case '*':
2938
+ re += star
2939
+ hasMagic = true
2940
+ break
2941
+ case '?':
2942
+ re += qmark
2943
+ hasMagic = true
2944
+ break
2945
+ default:
2946
+ re += '\\' + stateChar
2947
+ break
2948
+ }
2949
+ self.debug('clearStateChar %j %j', stateChar, re)
2950
+ stateChar = false
2951
+ }
2952
+ }
2953
+
2954
+ for (var i = 0, len = pattern.length, c
2955
+ ; (i < len) && (c = pattern.charAt(i))
2956
+ ; i++) {
2957
+ this.debug('%s\t%s %s %j', pattern, i, re, c)
2958
+
2959
+ // skip over any that are escaped.
2960
+ if (escaping && reSpecials[c]) {
2961
+ re += '\\' + c
2962
+ escaping = false
2963
+ continue
2964
+ }
2965
+
2966
+ switch (c) {
2967
+ case '/':
2968
+ // completely not allowed, even escaped.
2969
+ // Should already be path-split by now.
2970
+ return false
2971
+
2972
+ case '\\':
2973
+ clearStateChar()
2974
+ escaping = true
2975
+ continue
2976
+
2977
+ // the various stateChar values
2978
+ // for the "extglob" stuff.
2979
+ case '?':
2980
+ case '*':
2981
+ case '+':
2982
+ case '@':
2983
+ case '!':
2984
+ this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
2985
+
2986
+ // all of those are literals inside a class, except that
2987
+ // the glob [!a] means [^a] in regexp
2988
+ if (inClass) {
2989
+ this.debug(' in class')
2990
+ if (c === '!' && i === classStart + 1) c = '^'
2991
+ re += c
2992
+ continue
2993
+ }
2994
+
2995
+ // if we already have a stateChar, then it means
2996
+ // that there was something like ** or +? in there.
2997
+ // Handle the stateChar, then proceed with this one.
2998
+ self.debug('call clearStateChar %j', stateChar)
2999
+ clearStateChar()
3000
+ stateChar = c
3001
+ // if extglob is disabled, then +(asdf|foo) isn't a thing.
3002
+ // just clear the statechar *now*, rather than even diving into
3003
+ // the patternList stuff.
3004
+ if (options.noext) clearStateChar()
3005
+ continue
3006
+
3007
+ case '(':
3008
+ if (inClass) {
3009
+ re += '('
3010
+ continue
3011
+ }
3012
+
3013
+ if (!stateChar) {
3014
+ re += '\\('
3015
+ continue
3016
+ }
3017
+
3018
+ patternListStack.push({
3019
+ type: stateChar,
3020
+ start: i - 1,
3021
+ reStart: re.length,
3022
+ open: plTypes[stateChar].open,
3023
+ close: plTypes[stateChar].close
3024
+ })
3025
+ // negation is (?:(?!js)[^/]*)
3026
+ re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
3027
+ this.debug('plType %j %j', stateChar, re)
3028
+ stateChar = false
3029
+ continue
3030
+
3031
+ case ')':
3032
+ if (inClass || !patternListStack.length) {
3033
+ re += '\\)'
3034
+ continue
3035
+ }
3036
+
3037
+ clearStateChar()
3038
+ hasMagic = true
3039
+ var pl = patternListStack.pop()
3040
+ // negation is (?:(?!js)[^/]*)
3041
+ // The others are (?:<pattern>)<type>
3042
+ re += pl.close
3043
+ if (pl.type === '!') {
3044
+ negativeLists.push(pl)
3045
+ }
3046
+ pl.reEnd = re.length
3047
+ continue
3048
+
3049
+ case '|':
3050
+ if (inClass || !patternListStack.length || escaping) {
3051
+ re += '\\|'
3052
+ escaping = false
3053
+ continue
3054
+ }
3055
+
3056
+ clearStateChar()
3057
+ re += '|'
3058
+ continue
3059
+
3060
+ // these are mostly the same in regexp and glob
3061
+ case '[':
3062
+ // swallow any state-tracking char before the [
3063
+ clearStateChar()
3064
+
3065
+ if (inClass) {
3066
+ re += '\\' + c
3067
+ continue
3068
+ }
3069
+
3070
+ inClass = true
3071
+ classStart = i
3072
+ reClassStart = re.length
3073
+ re += c
3074
+ continue
3075
+
3076
+ case ']':
3077
+ // a right bracket shall lose its special
3078
+ // meaning and represent itself in
3079
+ // a bracket expression if it occurs
3080
+ // first in the list. -- POSIX.2 2.8.3.2
3081
+ if (i === classStart + 1 || !inClass) {
3082
+ re += '\\' + c
3083
+ escaping = false
3084
+ continue
3085
+ }
3086
+
3087
+ // handle the case where we left a class open.
3088
+ // "[z-a]" is valid, equivalent to "\[z-a\]"
3089
+ if (inClass) {
3090
+ // split where the last [ was, make sure we don't have
3091
+ // an invalid re. if so, re-walk the contents of the
3092
+ // would-be class to re-translate any characters that
3093
+ // were passed through as-is
3094
+ // TODO: It would probably be faster to determine this
3095
+ // without a try/catch and a new RegExp, but it's tricky
3096
+ // to do safely. For now, this is safe and works.
3097
+ var cs = pattern.substring(classStart + 1, i)
3098
+ try {
3099
+ RegExp('[' + cs + ']')
3100
+ } catch (er) {
3101
+ // not a valid class!
3102
+ var sp = this.parse(cs, SUBPARSE)
3103
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
3104
+ hasMagic = hasMagic || sp[1]
3105
+ inClass = false
3106
+ continue
3107
+ }
3108
+ }
3109
+
3110
+ // finish up the class.
3111
+ hasMagic = true
3112
+ inClass = false
3113
+ re += c
3114
+ continue
3115
+
3116
+ default:
3117
+ // swallow any state char that wasn't consumed
3118
+ clearStateChar()
3119
+
3120
+ if (escaping) {
3121
+ // no need
3122
+ escaping = false
3123
+ } else if (reSpecials[c]
3124
+ && !(c === '^' && inClass)) {
3125
+ re += '\\'
3126
+ }
3127
+
3128
+ re += c
3129
+
3130
+ } // switch
3131
+ } // for
3132
+
3133
+ // handle the case where we left a class open.
3134
+ // "[abc" is valid, equivalent to "\[abc"
3135
+ if (inClass) {
3136
+ // split where the last [ was, and escape it
3137
+ // this is a huge pita. We now have to re-walk
3138
+ // the contents of the would-be class to re-translate
3139
+ // any characters that were passed through as-is
3140
+ cs = pattern.substr(classStart + 1)
3141
+ sp = this.parse(cs, SUBPARSE)
3142
+ re = re.substr(0, reClassStart) + '\\[' + sp[0]
3143
+ hasMagic = hasMagic || sp[1]
3144
+ }
3145
+
3146
+ // handle the case where we had a +( thing at the *end*
3147
+ // of the pattern.
3148
+ // each pattern list stack adds 3 chars, and we need to go through
3149
+ // and escape any | chars that were passed through as-is for the regexp.
3150
+ // Go through and escape them, taking care not to double-escape any
3151
+ // | chars that were already escaped.
3152
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
3153
+ var tail = re.slice(pl.reStart + pl.open.length)
3154
+ this.debug('setting tail', re, pl)
3155
+ // maybe some even number of \, then maybe 1 \, followed by a |
3156
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
3157
+ if (!$2) {
3158
+ // the | isn't already escaped, so escape it.
3159
+ $2 = '\\'
3160
+ }
3161
+
3162
+ // need to escape all those slashes *again*, without escaping the
3163
+ // one that we need for escaping the | character. As it works out,
3164
+ // escaping an even number of slashes can be done by simply repeating
3165
+ // it exactly after itself. That's why this trick works.
3166
+ //
3167
+ // I am sorry that you have to see this.
3168
+ return $1 + $1 + $2 + '|'
3169
+ })
3170
+
3171
+ this.debug('tail=%j\n %s', tail, tail, pl, re)
3172
+ var t = pl.type === '*' ? star
3173
+ : pl.type === '?' ? qmark
3174
+ : '\\' + pl.type
3175
+
3176
+ hasMagic = true
3177
+ re = re.slice(0, pl.reStart) + t + '\\(' + tail
3178
+ }
3179
+
3180
+ // handle trailing things that only matter at the very end.
3181
+ clearStateChar()
3182
+ if (escaping) {
3183
+ // trailing \\
3184
+ re += '\\\\'
3185
+ }
3186
+
3187
+ // only need to apply the nodot start if the re starts with
3188
+ // something that could conceivably capture a dot
3189
+ var addPatternStart = false
3190
+ switch (re.charAt(0)) {
3191
+ case '.':
3192
+ case '[':
3193
+ case '(': addPatternStart = true
3194
+ }
3195
+
3196
+ // Hack to work around lack of negative lookbehind in JS
3197
+ // A pattern like: *.!(x).!(y|z) needs to ensure that a name
3198
+ // like 'a.xyz.yz' doesn't match. So, the first negative
3199
+ // lookahead, has to look ALL the way ahead, to the end of
3200
+ // the pattern.
3201
+ for (var n = negativeLists.length - 1; n > -1; n--) {
3202
+ var nl = negativeLists[n]
3203
+
3204
+ var nlBefore = re.slice(0, nl.reStart)
3205
+ var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
3206
+ var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
3207
+ var nlAfter = re.slice(nl.reEnd)
3208
+
3209
+ nlLast += nlAfter
3210
+
3211
+ // Handle nested stuff like *(*.js|!(*.json)), where open parens
3212
+ // mean that we should *not* include the ) in the bit that is considered
3213
+ // "after" the negated section.
3214
+ var openParensBefore = nlBefore.split('(').length - 1
3215
+ var cleanAfter = nlAfter
3216
+ for (i = 0; i < openParensBefore; i++) {
3217
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
3218
+ }
3219
+ nlAfter = cleanAfter
3220
+
3221
+ var dollar = ''
3222
+ if (nlAfter === '' && isSub !== SUBPARSE) {
3223
+ dollar = '$'
3224
+ }
3225
+ var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
3226
+ re = newRe
3227
+ }
3228
+
3229
+ // if the re is not "" at this point, then we need to make sure
3230
+ // it doesn't match against an empty path part.
3231
+ // Otherwise a/* will match a/, which it should not.
3232
+ if (re !== '' && hasMagic) {
3233
+ re = '(?=.)' + re
3234
+ }
3235
+
3236
+ if (addPatternStart) {
3237
+ re = patternStart + re
3238
+ }
3239
+
3240
+ // parsing just a piece of a larger pattern.
3241
+ if (isSub === SUBPARSE) {
3242
+ return [re, hasMagic]
3243
+ }
3244
+
3245
+ // skip the regexp for non-magical patterns
3246
+ // unescape anything in it, though, so that it'll be
3247
+ // an exact match against a file etc.
3248
+ if (!hasMagic) {
3249
+ return globUnescape(pattern)
3250
+ }
3251
+
3252
+ var flags = options.nocase ? 'i' : ''
3253
+ try {
3254
+ var regExp = new RegExp('^' + re + '$', flags)
3255
+ } catch (er) {
3256
+ // If it was an invalid regular expression, then it can't match
3257
+ // anything. This trick looks for a character after the end of
3258
+ // the string, which is of course impossible, except in multi-line
3259
+ // mode, but it's not a /m regex.
3260
+ return new RegExp('$.')
3261
+ }
3262
+
3263
+ regExp._glob = pattern
3264
+ regExp._src = re
3265
+
3266
+ return regExp
3267
+ }
3268
+
3269
+ minimatch.makeRe = function (pattern, options) {
3270
+ return new Minimatch(pattern, options || {}).makeRe()
3271
+ }
3272
+
3273
+ Minimatch.prototype.makeRe = makeRe
3274
+ function makeRe () {
3275
+ if (this.regexp || this.regexp === false) return this.regexp
3276
+
3277
+ // at this point, this.set is a 2d array of partial
3278
+ // pattern strings, or "**".
3279
+ //
3280
+ // It's better to use .match(). This function shouldn't
3281
+ // be used, really, but it's pretty convenient sometimes,
3282
+ // when you just want to work with a regex.
3283
+ var set = this.set
3284
+
3285
+ if (!set.length) {
3286
+ this.regexp = false
3287
+ return this.regexp
3288
+ }
3289
+ var options = this.options
3290
+
3291
+ var twoStar = options.noglobstar ? star
3292
+ : options.dot ? twoStarDot
3293
+ : twoStarNoDot
3294
+ var flags = options.nocase ? 'i' : ''
3295
+
3296
+ var re = set.map(function (pattern) {
3297
+ return pattern.map(function (p) {
3298
+ return (p === GLOBSTAR) ? twoStar
3299
+ : (typeof p === 'string') ? regExpEscape(p)
3300
+ : p._src
3301
+ }).join('\\\/')
3302
+ }).join('|')
3303
+
3304
+ // must match entire pattern
3305
+ // ending in a * or ** will make it less strict.
3306
+ re = '^(?:' + re + ')$'
3307
+
3308
+ // can match anything, as long as it's not this.
3309
+ if (this.negate) re = '^(?!' + re + ').*$'
3310
+
3311
+ try {
3312
+ this.regexp = new RegExp(re, flags)
3313
+ } catch (ex) {
3314
+ this.regexp = false
3315
+ }
3316
+ return this.regexp
3317
+ }
3318
+
3319
+ minimatch.match = function (list, pattern, options) {
3320
+ options = options || {}
3321
+ var mm = new Minimatch(pattern, options)
3322
+ list = list.filter(function (f) {
3323
+ return mm.match(f)
3324
+ })
3325
+ if (mm.options.nonull && !list.length) {
3326
+ list.push(pattern)
3327
+ }
3328
+ return list
3329
+ }
3330
+
3331
+ Minimatch.prototype.match = match
3332
+ function match (f, partial) {
3333
+ this.debug('match', f, this.pattern)
3334
+ // short-circuit in the case of busted things.
3335
+ // comments, etc.
3336
+ if (this.comment) return false
3337
+ if (this.empty) return f === ''
3338
+
3339
+ if (f === '/' && partial) return true
3340
+
3341
+ var options = this.options
3342
+
3343
+ // windows: need to use /, not \
3344
+ if (path.sep !== '/') {
3345
+ f = f.split(path.sep).join('/')
3346
+ }
3347
+
3348
+ // treat the test path as a set of pathparts.
3349
+ f = f.split(slashSplit)
3350
+ this.debug(this.pattern, 'split', f)
3351
+
3352
+ // just ONE of the pattern sets in this.set needs to match
3353
+ // in order for it to be valid. If negating, then just one
3354
+ // match means that we have failed.
3355
+ // Either way, return on the first hit.
3356
+
3357
+ var set = this.set
3358
+ this.debug(this.pattern, 'set', set)
3359
+
3360
+ // Find the basename of the path by looking for the last non-empty segment
3361
+ var filename
3362
+ var i
3363
+ for (i = f.length - 1; i >= 0; i--) {
3364
+ filename = f[i]
3365
+ if (filename) break
3366
+ }
3367
+
3368
+ for (i = 0; i < set.length; i++) {
3369
+ var pattern = set[i]
3370
+ var file = f
3371
+ if (options.matchBase && pattern.length === 1) {
3372
+ file = [filename]
3373
+ }
3374
+ var hit = this.matchOne(file, pattern, partial)
3375
+ if (hit) {
3376
+ if (options.flipNegate) return true
3377
+ return !this.negate
3378
+ }
3379
+ }
3380
+
3381
+ // didn't get any hits. this is success if it's a negative
3382
+ // pattern, failure otherwise.
3383
+ if (options.flipNegate) return false
3384
+ return this.negate
3385
+ }
3386
+
3387
+ // set partial to true to test if, for example,
3388
+ // "/a/b" matches the start of "/*/b/*/d"
3389
+ // Partial means, if you run out of file before you run
3390
+ // out of pattern, then that's fine, as long as all
3391
+ // the parts match.
3392
+ Minimatch.prototype.matchOne = function (file, pattern, partial) {
3393
+ var options = this.options
3394
+
3395
+ this.debug('matchOne',
3396
+ { 'this': this, file: file, pattern: pattern })
3397
+
3398
+ this.debug('matchOne', file.length, pattern.length)
3399
+
3400
+ for (var fi = 0,
3401
+ pi = 0,
3402
+ fl = file.length,
3403
+ pl = pattern.length
3404
+ ; (fi < fl) && (pi < pl)
3405
+ ; fi++, pi++) {
3406
+ this.debug('matchOne loop')
3407
+ var p = pattern[pi]
3408
+ var f = file[fi]
3409
+
3410
+ this.debug(pattern, p, f)
3411
+
3412
+ // should be impossible.
3413
+ // some invalid regexp stuff in the set.
3414
+ if (p === false) return false
3415
+
3416
+ if (p === GLOBSTAR) {
3417
+ this.debug('GLOBSTAR', [pattern, p, f])
3418
+
3419
+ // "**"
3420
+ // a/**/b/**/c would match the following:
3421
+ // a/b/x/y/z/c
3422
+ // a/x/y/z/b/c
3423
+ // a/b/x/b/x/c
3424
+ // a/b/c
3425
+ // To do this, take the rest of the pattern after
3426
+ // the **, and see if it would match the file remainder.
3427
+ // If so, return success.
3428
+ // If not, the ** "swallows" a segment, and try again.
3429
+ // This is recursively awful.
3430
+ //
3431
+ // a/**/b/**/c matching a/b/x/y/z/c
3432
+ // - a matches a
3433
+ // - doublestar
3434
+ // - matchOne(b/x/y/z/c, b/**/c)
3435
+ // - b matches b
3436
+ // - doublestar
3437
+ // - matchOne(x/y/z/c, c) -> no
3438
+ // - matchOne(y/z/c, c) -> no
3439
+ // - matchOne(z/c, c) -> no
3440
+ // - matchOne(c, c) yes, hit
3441
+ var fr = fi
3442
+ var pr = pi + 1
3443
+ if (pr === pl) {
3444
+ this.debug('** at the end')
3445
+ // a ** at the end will just swallow the rest.
3446
+ // We have found a match.
3447
+ // however, it will not swallow /.x, unless
3448
+ // options.dot is set.
3449
+ // . and .. are *never* matched by **, for explosively
3450
+ // exponential reasons.
3451
+ for (; fi < fl; fi++) {
3452
+ if (file[fi] === '.' || file[fi] === '..' ||
3453
+ (!options.dot && file[fi].charAt(0) === '.')) return false
3454
+ }
3455
+ return true
3456
+ }
3457
+
3458
+ // ok, let's see if we can swallow whatever we can.
3459
+ while (fr < fl) {
3460
+ var swallowee = file[fr]
3461
+
3462
+ this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
3463
+
3464
+ // XXX remove this slice. Just pass the start index.
3465
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
3466
+ this.debug('globstar found match!', fr, fl, swallowee)
3467
+ // found a match.
3468
+ return true
3469
+ } else {
3470
+ // can't swallow "." or ".." ever.
3471
+ // can only swallow ".foo" when explicitly asked.
3472
+ if (swallowee === '.' || swallowee === '..' ||
3473
+ (!options.dot && swallowee.charAt(0) === '.')) {
3474
+ this.debug('dot detected!', file, fr, pattern, pr)
3475
+ break
3476
+ }
3477
+
3478
+ // ** swallows a segment, and continue.
3479
+ this.debug('globstar swallow a segment, and continue')
3480
+ fr++
3481
+ }
3482
+ }
3483
+
3484
+ // no match was found.
3485
+ // However, in partial mode, we can't say this is necessarily over.
3486
+ // If there's more *pattern* left, then
3487
+ if (partial) {
3488
+ // ran out of file
3489
+ this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
3490
+ if (fr === fl) return true
3491
+ }
3492
+ return false
3493
+ }
3494
+
3495
+ // something other than **
3496
+ // non-magic patterns just have to match exactly
3497
+ // patterns with magic have been turned into regexps.
3498
+ var hit
3499
+ if (typeof p === 'string') {
3500
+ if (options.nocase) {
3501
+ hit = f.toLowerCase() === p.toLowerCase()
3502
+ } else {
3503
+ hit = f === p
3504
+ }
3505
+ this.debug('string match', p, f, hit)
3506
+ } else {
3507
+ hit = f.match(p)
3508
+ this.debug('pattern match', p, f, hit)
3509
+ }
3510
+
3511
+ if (!hit) return false
3512
+ }
3513
+
3514
+ // Note: ending in / means that we'll get a final ""
3515
+ // at the end of the pattern. This can only match a
3516
+ // corresponding "" at the end of the file.
3517
+ // If the file ends in /, then it can only match a
3518
+ // a pattern that ends in /, unless the pattern just
3519
+ // doesn't have any more for it. But, a/b/ should *not*
3520
+ // match "a/b/*", even though "" matches against the
3521
+ // [^/]*? pattern, except in partial mode, where it might
3522
+ // simply not be reached yet.
3523
+ // However, a/b/ should still satisfy a/*
3524
+
3525
+ // now either we fell off the end of the pattern, or we're done.
3526
+ if (fi === fl && pi === pl) {
3527
+ // ran out of pattern and filename at the same time.
3528
+ // an exact hit!
3529
+ return true
3530
+ } else if (fi === fl) {
3531
+ // ran out of file, but still had pattern left.
3532
+ // this is ok if we're doing the match as part of
3533
+ // a glob fs traversal.
3534
+ return partial
3535
+ } else if (pi === pl) {
3536
+ // ran out of pattern, still have file left.
3537
+ // this is only acceptable if we're on the very last
3538
+ // empty segment of a file with a trailing slash.
3539
+ // a/* should match a/b/
3540
+ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
3541
+ return emptyFileEnd
3542
+ }
3543
+
3544
+ // should be unreachable.
3545
+ throw new Error('wtf?')
3546
+ }
3547
+
3548
+ // replace stuff like \* with *
3549
+ function globUnescape (s) {
3550
+ return s.replace(/\\(.)/g, '$1')
3551
+ }
3552
+
3553
+ function regExpEscape (s) {
3554
+ return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
3555
+ }
3556
+
3557
+
3558
+ /***/ }),
3559
+
3560
+ /***/ 64095:
3561
+ /***/ ((module) => {
3562
+
3563
+ "use strict";
3564
+
3565
+
3566
+ function posix(path) {
3567
+ return path.charAt(0) === '/';
3568
+ }
3569
+
3570
+ function win32(path) {
3571
+ // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
3572
+ var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
3573
+ var result = splitDeviceRe.exec(path);
3574
+ var device = result[1] || '';
3575
+ var isUnc = Boolean(device && device.charAt(1) !== ':');
3576
+
3577
+ // UNC paths are always absolute
3578
+ return Boolean(result[2] || isUnc);
3579
+ }
3580
+
3581
+ module.exports = process.platform === 'win32' ? win32 : posix;
3582
+ module.exports.posix = posix;
3583
+ module.exports.win32 = win32;
3584
+
3585
+
3586
+ /***/ }),
3587
+
3588
+ /***/ 50984:
3589
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3590
+
3591
+ module.exports = rimraf
3592
+ rimraf.sync = rimrafSync
3593
+
3594
+ var assert = __webpack_require__(42357)
3595
+ var path = __webpack_require__(85622)
3596
+ var fs = __webpack_require__(35747)
3597
+ var glob = undefined
3598
+ try {
3599
+ glob = __webpack_require__(12884)
3600
+ } catch (_err) {
3601
+ // treat glob as optional.
3602
+ }
3603
+ var _0666 = parseInt('666', 8)
3604
+
3605
+ var defaultGlobOpts = {
3606
+ nosort: true,
3607
+ silent: true
3608
+ }
3609
+
3610
+ // for EMFILE handling
3611
+ var timeout = 0
3612
+
3613
+ var isWindows = (process.platform === "win32")
3614
+
3615
+ function defaults (options) {
3616
+ var methods = [
3617
+ 'unlink',
3618
+ 'chmod',
3619
+ 'stat',
3620
+ 'lstat',
3621
+ 'rmdir',
3622
+ 'readdir'
3623
+ ]
3624
+ methods.forEach(function(m) {
3625
+ options[m] = options[m] || fs[m]
3626
+ m = m + 'Sync'
3627
+ options[m] = options[m] || fs[m]
3628
+ })
3629
+
3630
+ options.maxBusyTries = options.maxBusyTries || 3
3631
+ options.emfileWait = options.emfileWait || 1000
3632
+ if (options.glob === false) {
3633
+ options.disableGlob = true
3634
+ }
3635
+ if (options.disableGlob !== true && glob === undefined) {
3636
+ throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
3637
+ }
3638
+ options.disableGlob = options.disableGlob || false
3639
+ options.glob = options.glob || defaultGlobOpts
3640
+ }
3641
+
3642
+ function rimraf (p, options, cb) {
3643
+ if (typeof options === 'function') {
3644
+ cb = options
3645
+ options = {}
3646
+ }
3647
+
3648
+ assert(p, 'rimraf: missing path')
3649
+ assert.equal(typeof p, 'string', 'rimraf: path should be a string')
3650
+ assert.equal(typeof cb, 'function', 'rimraf: callback function required')
3651
+ assert(options, 'rimraf: invalid options argument provided')
3652
+ assert.equal(typeof options, 'object', 'rimraf: options should be object')
3653
+
3654
+ defaults(options)
3655
+
3656
+ var busyTries = 0
3657
+ var errState = null
3658
+ var n = 0
3659
+
3660
+ if (options.disableGlob || !glob.hasMagic(p))
3661
+ return afterGlob(null, [p])
3662
+
3663
+ options.lstat(p, function (er, stat) {
3664
+ if (!er)
3665
+ return afterGlob(null, [p])
3666
+
3667
+ glob(p, options.glob, afterGlob)
3668
+ })
3669
+
3670
+ function next (er) {
3671
+ errState = errState || er
3672
+ if (--n === 0)
3673
+ cb(errState)
3674
+ }
3675
+
3676
+ function afterGlob (er, results) {
3677
+ if (er)
3678
+ return cb(er)
3679
+
3680
+ n = results.length
3681
+ if (n === 0)
3682
+ return cb()
3683
+
3684
+ results.forEach(function (p) {
3685
+ rimraf_(p, options, function CB (er) {
3686
+ if (er) {
3687
+ if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
3688
+ busyTries < options.maxBusyTries) {
3689
+ busyTries ++
3690
+ var time = busyTries * 100
3691
+ // try again, with the same exact callback as this one.
3692
+ return setTimeout(function () {
3693
+ rimraf_(p, options, CB)
3694
+ }, time)
3695
+ }
3696
+
3697
+ // this one won't happen if graceful-fs is used.
3698
+ if (er.code === "EMFILE" && timeout < options.emfileWait) {
3699
+ return setTimeout(function () {
3700
+ rimraf_(p, options, CB)
3701
+ }, timeout ++)
3702
+ }
3703
+
3704
+ // already gone
3705
+ if (er.code === "ENOENT") er = null
3706
+ }
3707
+
3708
+ timeout = 0
3709
+ next(er)
3710
+ })
3711
+ })
3712
+ }
3713
+ }
3714
+
3715
+ // Two possible strategies.
3716
+ // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
3717
+ // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
3718
+ //
3719
+ // Both result in an extra syscall when you guess wrong. However, there
3720
+ // are likely far more normal files in the world than directories. This
3721
+ // is based on the assumption that a the average number of files per
3722
+ // directory is >= 1.
3723
+ //
3724
+ // If anyone ever complains about this, then I guess the strategy could
3725
+ // be made configurable somehow. But until then, YAGNI.
3726
+ function rimraf_ (p, options, cb) {
3727
+ assert(p)
3728
+ assert(options)
3729
+ assert(typeof cb === 'function')
3730
+
3731
+ // sunos lets the root user unlink directories, which is... weird.
3732
+ // so we have to lstat here and make sure it's not a dir.
3733
+ options.lstat(p, function (er, st) {
3734
+ if (er && er.code === "ENOENT")
3735
+ return cb(null)
3736
+
3737
+ // Windows can EPERM on stat. Life is suffering.
3738
+ if (er && er.code === "EPERM" && isWindows)
3739
+ fixWinEPERM(p, options, er, cb)
3740
+
3741
+ if (st && st.isDirectory())
3742
+ return rmdir(p, options, er, cb)
3743
+
3744
+ options.unlink(p, function (er) {
3745
+ if (er) {
3746
+ if (er.code === "ENOENT")
3747
+ return cb(null)
3748
+ if (er.code === "EPERM")
3749
+ return (isWindows)
3750
+ ? fixWinEPERM(p, options, er, cb)
3751
+ : rmdir(p, options, er, cb)
3752
+ if (er.code === "EISDIR")
3753
+ return rmdir(p, options, er, cb)
3754
+ }
3755
+ return cb(er)
3756
+ })
3757
+ })
3758
+ }
3759
+
3760
+ function fixWinEPERM (p, options, er, cb) {
3761
+ assert(p)
3762
+ assert(options)
3763
+ assert(typeof cb === 'function')
3764
+ if (er)
3765
+ assert(er instanceof Error)
3766
+
3767
+ options.chmod(p, _0666, function (er2) {
3768
+ if (er2)
3769
+ cb(er2.code === "ENOENT" ? null : er)
3770
+ else
3771
+ options.stat(p, function(er3, stats) {
3772
+ if (er3)
3773
+ cb(er3.code === "ENOENT" ? null : er)
3774
+ else if (stats.isDirectory())
3775
+ rmdir(p, options, er, cb)
3776
+ else
3777
+ options.unlink(p, cb)
3778
+ })
3779
+ })
3780
+ }
3781
+
3782
+ function fixWinEPERMSync (p, options, er) {
3783
+ assert(p)
3784
+ assert(options)
3785
+ if (er)
3786
+ assert(er instanceof Error)
3787
+
3788
+ try {
3789
+ options.chmodSync(p, _0666)
3790
+ } catch (er2) {
3791
+ if (er2.code === "ENOENT")
3792
+ return
3793
+ else
3794
+ throw er
3795
+ }
3796
+
3797
+ try {
3798
+ var stats = options.statSync(p)
3799
+ } catch (er3) {
3800
+ if (er3.code === "ENOENT")
3801
+ return
3802
+ else
3803
+ throw er
3804
+ }
3805
+
3806
+ if (stats.isDirectory())
3807
+ rmdirSync(p, options, er)
3808
+ else
3809
+ options.unlinkSync(p)
3810
+ }
3811
+
3812
+ function rmdir (p, options, originalEr, cb) {
3813
+ assert(p)
3814
+ assert(options)
3815
+ if (originalEr)
3816
+ assert(originalEr instanceof Error)
3817
+ assert(typeof cb === 'function')
3818
+
3819
+ // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
3820
+ // if we guessed wrong, and it's not a directory, then
3821
+ // raise the original error.
3822
+ options.rmdir(p, function (er) {
3823
+ if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
3824
+ rmkids(p, options, cb)
3825
+ else if (er && er.code === "ENOTDIR")
3826
+ cb(originalEr)
3827
+ else
3828
+ cb(er)
3829
+ })
3830
+ }
3831
+
3832
+ function rmkids(p, options, cb) {
3833
+ assert(p)
3834
+ assert(options)
3835
+ assert(typeof cb === 'function')
3836
+
3837
+ options.readdir(p, function (er, files) {
3838
+ if (er)
3839
+ return cb(er)
3840
+ var n = files.length
3841
+ if (n === 0)
3842
+ return options.rmdir(p, cb)
3843
+ var errState
3844
+ files.forEach(function (f) {
3845
+ rimraf(path.join(p, f), options, function (er) {
3846
+ if (errState)
3847
+ return
3848
+ if (er)
3849
+ return cb(errState = er)
3850
+ if (--n === 0)
3851
+ options.rmdir(p, cb)
3852
+ })
3853
+ })
3854
+ })
3855
+ }
3856
+
3857
+ // this looks simpler, and is strictly *faster*, but will
3858
+ // tie up the JavaScript thread and fail on excessively
3859
+ // deep directory trees.
3860
+ function rimrafSync (p, options) {
3861
+ options = options || {}
3862
+ defaults(options)
3863
+
3864
+ assert(p, 'rimraf: missing path')
3865
+ assert.equal(typeof p, 'string', 'rimraf: path should be a string')
3866
+ assert(options, 'rimraf: missing options')
3867
+ assert.equal(typeof options, 'object', 'rimraf: options should be object')
3868
+
3869
+ var results
3870
+
3871
+ if (options.disableGlob || !glob.hasMagic(p)) {
3872
+ results = [p]
3873
+ } else {
3874
+ try {
3875
+ options.lstatSync(p)
3876
+ results = [p]
3877
+ } catch (er) {
3878
+ results = glob.sync(p, options.glob)
3879
+ }
3880
+ }
3881
+
3882
+ if (!results.length)
3883
+ return
3884
+
3885
+ for (var i = 0; i < results.length; i++) {
3886
+ var p = results[i]
3887
+
3888
+ try {
3889
+ var st = options.lstatSync(p)
3890
+ } catch (er) {
3891
+ if (er.code === "ENOENT")
3892
+ return
3893
+
3894
+ // Windows can EPERM on stat. Life is suffering.
3895
+ if (er.code === "EPERM" && isWindows)
3896
+ fixWinEPERMSync(p, options, er)
3897
+ }
3898
+
3899
+ try {
3900
+ // sunos lets the root user unlink directories, which is... weird.
3901
+ if (st && st.isDirectory())
3902
+ rmdirSync(p, options, null)
3903
+ else
3904
+ options.unlinkSync(p)
3905
+ } catch (er) {
3906
+ if (er.code === "ENOENT")
3907
+ return
3908
+ if (er.code === "EPERM")
3909
+ return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
3910
+ if (er.code !== "EISDIR")
3911
+ throw er
3912
+
3913
+ rmdirSync(p, options, er)
3914
+ }
3915
+ }
3916
+ }
3917
+
3918
+ function rmdirSync (p, options, originalEr) {
3919
+ assert(p)
3920
+ assert(options)
3921
+ if (originalEr)
3922
+ assert(originalEr instanceof Error)
3923
+
3924
+ try {
3925
+ options.rmdirSync(p)
3926
+ } catch (er) {
3927
+ if (er.code === "ENOENT")
3928
+ return
3929
+ if (er.code === "ENOTDIR")
3930
+ throw originalEr
3931
+ if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
3932
+ rmkidsSync(p, options)
3933
+ }
3934
+ }
3935
+
3936
+ function rmkidsSync (p, options) {
3937
+ assert(p)
3938
+ assert(options)
3939
+ options.readdirSync(p).forEach(function (f) {
3940
+ rimrafSync(path.join(p, f), options)
3941
+ })
3942
+
3943
+ // We only end up here once we got ENOTEMPTY at least once, and
3944
+ // at this point, we are guaranteed to have removed all the kids.
3945
+ // So, we know that it won't be ENOENT or ENOTDIR or anything else.
3946
+ // try really hard to delete stuff on windows, because it has a
3947
+ // PROFOUNDLY annoying habit of not closing handles promptly when
3948
+ // files are deleted, resulting in spurious ENOTEMPTY errors.
3949
+ var retries = isWindows ? 100 : 1
3950
+ var i = 0
3951
+ do {
3952
+ var threw = true
3953
+ try {
3954
+ var ret = options.rmdirSync(p, options)
3955
+ threw = false
3956
+ return ret
3957
+ } finally {
3958
+ if (++i < retries && threw)
3959
+ continue
3960
+ }
3961
+ } while (true)
3962
+ }
3963
+
3964
+
3965
+ /***/ })
3966
+
3967
+ };
3968
+ ;
3969
+ //# sourceMappingURL=213.index.js.map