jitsu-cli 1.9.12 → 1.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -489,7 +489,7 @@ __webpack_require__.d(__webpack_exports__, {
489
489
  aj: () => (/* reexport */ sanitize)
490
490
  });
491
491
 
492
- // UNUSED EXPORTS: ApiResponseError, alwaysThrottle, asArray, asFunction, asSingleton, assertFalse, checkHash, checkRawToken, createAuthorized, createHash, deepMerge, disableService, encrypt, getCached, getErrorMessage, getSingleton, getThrottle, hash, hint, index, isEqual, isTruish, isValidSecret, logFormat, namedParameters, newError, noThrottle, noopLogMessageBuilder, parseNumber, parseRequiredNumber, requireDefined, rpc, setGlobalLogLevel, setServerJsonFormat, setServerLogColoring, stopwatch, transformKeys, tryJson, unrollParams, urlWithQueryString
492
+ // UNUSED EXPORTS: ApiResponseError, alwaysThrottle, asArray, asFunction, asSingleton, assertFalse, checkHash, checkRawToken, createAuthorized, createHash, deepMerge, disableService, encrypt, getCached, getErrorMessage, getSingleton, getThrottle, hash, hideSensitiveInfo, hint, index, isEqual, isTruish, isValidSecret, logFormat, namedParameters, newError, noThrottle, noopLogMessageBuilder, parseNumber, parseRequiredNumber, requireDefined, rpc, setGlobalLogLevel, setServerJsonFormat, setServerLogColoring, stopwatch, transformKeys, tryJson, unrollParams, urlWithQueryString
493
493
 
494
494
  ;// ../../libs/juava/src/security.ts
495
495
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
@@ -565,6 +565,15 @@ function decrypt(secret, iv, value) {
565
565
  var decrypted = Buffer.concat([decipher.update(Buffer.from(value, "hex")), decipher["final"]()]);
566
566
  return decrypted.toString();
567
567
  }
568
+ function hideSensitiveInfo(url) {
569
+ try {
570
+ var parsedUrl = new URL(url);
571
+ parsedUrl.password = "****";
572
+ return parsedUrl.toString();
573
+ } catch (e) {
574
+ return "***";
575
+ }
576
+ }
568
577
  ;// ../../libs/juava/src/asserts.ts
569
578
  function toError(err) {
570
579
  if (typeof err === "string") {
@@ -1219,76 +1228,6 @@ function getSingleton(globalName, factory) {
1219
1228
 
1220
1229
 
1221
1230
 
1222
- /***/ }),
1223
-
1224
- /***/ 4323:
1225
- /***/ ((module) => {
1226
-
1227
- "use strict";
1228
-
1229
- module.exports = balanced;
1230
- function balanced(a, b, str) {
1231
- if (a instanceof RegExp) a = maybeMatch(a, str);
1232
- if (b instanceof RegExp) b = maybeMatch(b, str);
1233
-
1234
- var r = range(a, b, str);
1235
-
1236
- return r && {
1237
- start: r[0],
1238
- end: r[1],
1239
- pre: str.slice(0, r[0]),
1240
- body: str.slice(r[0] + a.length, r[1]),
1241
- post: str.slice(r[1] + b.length)
1242
- };
1243
- }
1244
-
1245
- function maybeMatch(reg, str) {
1246
- var m = str.match(reg);
1247
- return m ? m[0] : null;
1248
- }
1249
-
1250
- balanced.range = range;
1251
- function range(a, b, str) {
1252
- var begs, beg, left, right, result;
1253
- var ai = str.indexOf(a);
1254
- var bi = str.indexOf(b, ai + 1);
1255
- var i = ai;
1256
-
1257
- if (ai >= 0 && bi > 0) {
1258
- if(a===b) {
1259
- return [ai, bi];
1260
- }
1261
- begs = [];
1262
- left = str.length;
1263
-
1264
- while (i >= 0 && !result) {
1265
- if (i == ai) {
1266
- begs.push(i);
1267
- ai = str.indexOf(a, i + 1);
1268
- } else if (begs.length == 1) {
1269
- result = [ begs.pop(), bi ];
1270
- } else {
1271
- beg = begs.pop();
1272
- if (beg < left) {
1273
- left = beg;
1274
- right = bi;
1275
- }
1276
-
1277
- bi = str.indexOf(b, i + 1);
1278
- }
1279
-
1280
- i = ai < bi && ai >= 0 ? ai : bi;
1281
- }
1282
-
1283
- if (begs.length) {
1284
- result = [ left, right ];
1285
- }
1286
- }
1287
-
1288
- return result;
1289
- }
1290
-
1291
-
1292
1231
  /***/ }),
1293
1232
 
1294
1233
  /***/ 7255:
@@ -1785,216 +1724,6 @@ module.exports.BufferListStream = BufferListStream
1785
1724
  module.exports.BufferList = BufferList
1786
1725
 
1787
1726
 
1788
- /***/ }),
1789
-
1790
- /***/ 4807:
1791
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1792
-
1793
- var balanced = __webpack_require__(4323);
1794
-
1795
- module.exports = expandTop;
1796
-
1797
- var escSlash = '\0SLASH'+Math.random()+'\0';
1798
- var escOpen = '\0OPEN'+Math.random()+'\0';
1799
- var escClose = '\0CLOSE'+Math.random()+'\0';
1800
- var escComma = '\0COMMA'+Math.random()+'\0';
1801
- var escPeriod = '\0PERIOD'+Math.random()+'\0';
1802
-
1803
- function numeric(str) {
1804
- return parseInt(str, 10) == str
1805
- ? parseInt(str, 10)
1806
- : str.charCodeAt(0);
1807
- }
1808
-
1809
- function escapeBraces(str) {
1810
- return str.split('\\\\').join(escSlash)
1811
- .split('\\{').join(escOpen)
1812
- .split('\\}').join(escClose)
1813
- .split('\\,').join(escComma)
1814
- .split('\\.').join(escPeriod);
1815
- }
1816
-
1817
- function unescapeBraces(str) {
1818
- return str.split(escSlash).join('\\')
1819
- .split(escOpen).join('{')
1820
- .split(escClose).join('}')
1821
- .split(escComma).join(',')
1822
- .split(escPeriod).join('.');
1823
- }
1824
-
1825
-
1826
- // Basically just str.split(","), but handling cases
1827
- // where we have nested braced sections, which should be
1828
- // treated as individual members, like {a,{b,c},d}
1829
- function parseCommaParts(str) {
1830
- if (!str)
1831
- return [''];
1832
-
1833
- var parts = [];
1834
- var m = balanced('{', '}', str);
1835
-
1836
- if (!m)
1837
- return str.split(',');
1838
-
1839
- var pre = m.pre;
1840
- var body = m.body;
1841
- var post = m.post;
1842
- var p = pre.split(',');
1843
-
1844
- p[p.length-1] += '{' + body + '}';
1845
- var postParts = parseCommaParts(post);
1846
- if (post.length) {
1847
- p[p.length-1] += postParts.shift();
1848
- p.push.apply(p, postParts);
1849
- }
1850
-
1851
- parts.push.apply(parts, p);
1852
-
1853
- return parts;
1854
- }
1855
-
1856
- function expandTop(str) {
1857
- if (!str)
1858
- return [];
1859
-
1860
- // I don't know why Bash 4.3 does this, but it does.
1861
- // Anything starting with {} will have the first two bytes preserved
1862
- // but *only* at the top level, so {},a}b will not expand to anything,
1863
- // but a{},b}c will be expanded to [a}c,abc].
1864
- // One could argue that this is a bug in Bash, but since the goal of
1865
- // this module is to match Bash's rules, we escape a leading {}
1866
- if (str.substr(0, 2) === '{}') {
1867
- str = '\\{\\}' + str.substr(2);
1868
- }
1869
-
1870
- return expand(escapeBraces(str), true).map(unescapeBraces);
1871
- }
1872
-
1873
- function embrace(str) {
1874
- return '{' + str + '}';
1875
- }
1876
- function isPadded(el) {
1877
- return /^-?0\d/.test(el);
1878
- }
1879
-
1880
- function lte(i, y) {
1881
- return i <= y;
1882
- }
1883
- function gte(i, y) {
1884
- return i >= y;
1885
- }
1886
-
1887
- function expand(str, isTop) {
1888
- var expansions = [];
1889
-
1890
- var m = balanced('{', '}', str);
1891
- if (!m) return [str];
1892
-
1893
- // no need to expand pre, since it is guaranteed to be free of brace-sets
1894
- var pre = m.pre;
1895
- var post = m.post.length
1896
- ? expand(m.post, false)
1897
- : [''];
1898
-
1899
- if (/\$$/.test(m.pre)) {
1900
- for (var k = 0; k < post.length; k++) {
1901
- var expansion = pre+ '{' + m.body + '}' + post[k];
1902
- expansions.push(expansion);
1903
- }
1904
- } else {
1905
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
1906
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
1907
- var isSequence = isNumericSequence || isAlphaSequence;
1908
- var isOptions = m.body.indexOf(',') >= 0;
1909
- if (!isSequence && !isOptions) {
1910
- // {a},b}
1911
- if (m.post.match(/,.*\}/)) {
1912
- str = m.pre + '{' + m.body + escClose + m.post;
1913
- return expand(str);
1914
- }
1915
- return [str];
1916
- }
1917
-
1918
- var n;
1919
- if (isSequence) {
1920
- n = m.body.split(/\.\./);
1921
- } else {
1922
- n = parseCommaParts(m.body);
1923
- if (n.length === 1) {
1924
- // x{{a,b}}y ==> x{a}y x{b}y
1925
- n = expand(n[0], false).map(embrace);
1926
- if (n.length === 1) {
1927
- return post.map(function(p) {
1928
- return m.pre + n[0] + p;
1929
- });
1930
- }
1931
- }
1932
- }
1933
-
1934
- // at this point, n is the parts, and we know it's not a comma set
1935
- // with a single entry.
1936
- var N;
1937
-
1938
- if (isSequence) {
1939
- var x = numeric(n[0]);
1940
- var y = numeric(n[1]);
1941
- var width = Math.max(n[0].length, n[1].length)
1942
- var incr = n.length == 3
1943
- ? Math.abs(numeric(n[2]))
1944
- : 1;
1945
- var test = lte;
1946
- var reverse = y < x;
1947
- if (reverse) {
1948
- incr *= -1;
1949
- test = gte;
1950
- }
1951
- var pad = n.some(isPadded);
1952
-
1953
- N = [];
1954
-
1955
- for (var i = x; test(i, y); i += incr) {
1956
- var c;
1957
- if (isAlphaSequence) {
1958
- c = String.fromCharCode(i);
1959
- if (c === '\\')
1960
- c = '';
1961
- } else {
1962
- c = String(i);
1963
- if (pad) {
1964
- var need = width - c.length;
1965
- if (need > 0) {
1966
- var z = new Array(need + 1).join('0');
1967
- if (i < 0)
1968
- c = '-' + z + c.slice(1);
1969
- else
1970
- c = z + c;
1971
- }
1972
- }
1973
- }
1974
- N.push(c);
1975
- }
1976
- } else {
1977
- N = [];
1978
-
1979
- for (var j = 0; j < n.length; j++) {
1980
- N.push.apply(N, expand(n[j], false));
1981
- }
1982
- }
1983
-
1984
- for (var j = 0; j < N.length; j++) {
1985
- for (var k = 0; k < post.length; k++) {
1986
- var expansion = pre + N[j] + post[k];
1987
- if (!isTop || isSequence || expansion)
1988
- expansions.push(expansion);
1989
- }
1990
- }
1991
- }
1992
-
1993
- return expansions;
1994
- }
1995
-
1996
-
1997
-
1998
1727
  /***/ }),
1999
1728
 
2000
1729
  /***/ 6181:
@@ -6642,385 +6371,855 @@ __webpack_unused_export__ = ExternalEditor;
6642
6371
 
6643
6372
  /***/ }),
6644
6373
 
6645
- /***/ 8831:
6646
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6374
+ /***/ 6957:
6375
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6647
6376
 
6648
- module.exports = realpath
6649
- realpath.realpath = realpath
6650
- realpath.sync = realpathSync
6651
- realpath.realpathSync = realpathSync
6652
- realpath.monkeypatch = monkeypatch
6653
- realpath.unmonkeypatch = unmonkeypatch
6654
-
6655
- var fs = __webpack_require__(9896)
6656
- var origRealpath = fs.realpath
6657
- var origRealpathSync = fs.realpathSync
6658
-
6659
- var version = process.version
6660
- var ok = /^v[0-5]\./.test(version)
6661
- var old = __webpack_require__(4354)
6662
-
6663
- function newError (er) {
6664
- return er && er.syscall === 'realpath' && (
6665
- er.code === 'ELOOP' ||
6666
- er.code === 'ENOMEM' ||
6667
- er.code === 'ENAMETOOLONG'
6668
- )
6377
+ "use strict";
6378
+
6379
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6380
+ exports.callback = exports.promise = void 0;
6381
+ const walker_1 = __webpack_require__(5427);
6382
+ function promise(root, options) {
6383
+ return new Promise((resolve, reject) => {
6384
+ callback(root, options, (err, output) => {
6385
+ if (err)
6386
+ return reject(err);
6387
+ resolve(output);
6388
+ });
6389
+ });
6390
+ }
6391
+ exports.promise = promise;
6392
+ function callback(root, options, callback) {
6393
+ let walker = new walker_1.Walker(root, options, callback);
6394
+ walker.start();
6669
6395
  }
6396
+ exports.callback = callback;
6670
6397
 
6671
- function realpath (p, cache, cb) {
6672
- if (ok) {
6673
- return origRealpath(p, cache, cb)
6674
- }
6675
6398
 
6676
- if (typeof cache === 'function') {
6677
- cb = cache
6678
- cache = null
6679
- }
6680
- origRealpath(p, cache, function (er, result) {
6681
- if (newError(er)) {
6682
- old.realpath(p, cache, cb)
6683
- } else {
6684
- cb(er, result)
6399
+ /***/ }),
6400
+
6401
+ /***/ 8177:
6402
+ /***/ ((__unused_webpack_module, exports) => {
6403
+
6404
+ "use strict";
6405
+
6406
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6407
+ exports.Counter = void 0;
6408
+ class Counter {
6409
+ _files = 0;
6410
+ _directories = 0;
6411
+ set files(num) {
6412
+ this._files = num;
6413
+ }
6414
+ get files() {
6415
+ return this._files;
6416
+ }
6417
+ set directories(num) {
6418
+ this._directories = num;
6419
+ }
6420
+ get directories() {
6421
+ return this._directories;
6422
+ }
6423
+ /**
6424
+ * @deprecated use `directories` instead
6425
+ */
6426
+ /* c8 ignore next 3 */
6427
+ get dirs() {
6428
+ return this._directories;
6685
6429
  }
6686
- })
6687
6430
  }
6431
+ exports.Counter = Counter;
6688
6432
 
6689
- function realpathSync (p, cache) {
6690
- if (ok) {
6691
- return origRealpathSync(p, cache)
6692
- }
6693
6433
 
6694
- try {
6695
- return origRealpathSync(p, cache)
6696
- } catch (er) {
6697
- if (newError(er)) {
6698
- return old.realpathSync(p, cache)
6699
- } else {
6700
- throw er
6701
- }
6702
- }
6434
+ /***/ }),
6435
+
6436
+ /***/ 515:
6437
+ /***/ ((__unused_webpack_module, exports) => {
6438
+
6439
+ "use strict";
6440
+
6441
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6442
+ exports.build = void 0;
6443
+ const getArray = (paths) => {
6444
+ return paths;
6445
+ };
6446
+ const getArrayGroup = () => {
6447
+ return [""].slice(0, 0);
6448
+ };
6449
+ function build(options) {
6450
+ return options.group ? getArrayGroup : getArray;
6703
6451
  }
6452
+ exports.build = build;
6453
+
6704
6454
 
6705
- function monkeypatch () {
6706
- fs.realpath = realpath
6707
- fs.realpathSync = realpathSync
6455
+ /***/ }),
6456
+
6457
+ /***/ 8461:
6458
+ /***/ ((__unused_webpack_module, exports) => {
6459
+
6460
+ "use strict";
6461
+
6462
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6463
+ exports.build = void 0;
6464
+ const groupFiles = (groups, directory, files) => {
6465
+ groups.push({ directory, files, dir: directory });
6466
+ };
6467
+ const empty = () => { };
6468
+ function build(options) {
6469
+ return options.group ? groupFiles : empty;
6708
6470
  }
6471
+ exports.build = build;
6472
+
6473
+
6474
+ /***/ }),
6475
+
6476
+ /***/ 2523:
6477
+ /***/ ((__unused_webpack_module, exports) => {
6478
+
6479
+ "use strict";
6709
6480
 
6710
- function unmonkeypatch () {
6711
- fs.realpath = origRealpath
6712
- fs.realpathSync = origRealpathSync
6481
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6482
+ exports.build = void 0;
6483
+ const onlyCountsSync = (state) => {
6484
+ return state.counts;
6485
+ };
6486
+ const groupsSync = (state) => {
6487
+ return state.groups;
6488
+ };
6489
+ const defaultSync = (state) => {
6490
+ return state.paths;
6491
+ };
6492
+ const limitFilesSync = (state) => {
6493
+ return state.paths.slice(0, state.options.maxFiles);
6494
+ };
6495
+ const onlyCountsAsync = (state, error, callback) => {
6496
+ report(error, callback, state.counts, state.options.suppressErrors);
6497
+ return null;
6498
+ };
6499
+ const defaultAsync = (state, error, callback) => {
6500
+ report(error, callback, state.paths, state.options.suppressErrors);
6501
+ return null;
6502
+ };
6503
+ const limitFilesAsync = (state, error, callback) => {
6504
+ report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
6505
+ return null;
6506
+ };
6507
+ const groupsAsync = (state, error, callback) => {
6508
+ report(error, callback, state.groups, state.options.suppressErrors);
6509
+ return null;
6510
+ };
6511
+ function report(error, callback, output, suppressErrors) {
6512
+ if (error && !suppressErrors)
6513
+ callback(error, output);
6514
+ else
6515
+ callback(null, output);
6516
+ }
6517
+ function build(options, isSynchronous) {
6518
+ const { onlyCounts, group, maxFiles } = options;
6519
+ if (onlyCounts)
6520
+ return isSynchronous
6521
+ ? onlyCountsSync
6522
+ : onlyCountsAsync;
6523
+ else if (group)
6524
+ return isSynchronous
6525
+ ? groupsSync
6526
+ : groupsAsync;
6527
+ else if (maxFiles)
6528
+ return isSynchronous
6529
+ ? limitFilesSync
6530
+ : limitFilesAsync;
6531
+ else
6532
+ return isSynchronous
6533
+ ? defaultSync
6534
+ : defaultAsync;
6713
6535
  }
6536
+ exports.build = build;
6714
6537
 
6715
6538
 
6716
6539
  /***/ }),
6717
6540
 
6718
- /***/ 4354:
6541
+ /***/ 4315:
6719
6542
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6720
6543
 
6721
- // Copyright Joyent, Inc. and other Node contributors.
6722
- //
6723
- // Permission is hereby granted, free of charge, to any person obtaining a
6724
- // copy of this software and associated documentation files (the
6725
- // "Software"), to deal in the Software without restriction, including
6726
- // without limitation the rights to use, copy, modify, merge, publish,
6727
- // distribute, sublicense, and/or sell copies of the Software, and to permit
6728
- // persons to whom the Software is furnished to do so, subject to the
6729
- // following conditions:
6730
- //
6731
- // The above copyright notice and this permission notice shall be included
6732
- // in all copies or substantial portions of the Software.
6733
- //
6734
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6735
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6736
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6737
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6738
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6739
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6740
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
6544
+ "use strict";
6741
6545
 
6742
- var pathModule = __webpack_require__(6928);
6743
- var isWindows = process.platform === 'win32';
6744
- var fs = __webpack_require__(9896);
6546
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6547
+ exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
6548
+ const path_1 = __webpack_require__(6928);
6549
+ const utils_1 = __webpack_require__(7607);
6550
+ function joinPathWithBasePath(filename, directoryPath) {
6551
+ return directoryPath + filename;
6552
+ }
6553
+ exports.joinPathWithBasePath = joinPathWithBasePath;
6554
+ function joinPathWithRelativePath(root, options) {
6555
+ return function (filename, directoryPath) {
6556
+ const sameRoot = directoryPath.startsWith(root);
6557
+ if (sameRoot)
6558
+ return directoryPath.replace(root, "") + filename;
6559
+ else
6560
+ return ((0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) +
6561
+ options.pathSeparator +
6562
+ filename);
6563
+ };
6564
+ }
6565
+ function joinPath(filename) {
6566
+ return filename;
6567
+ }
6568
+ function joinDirectoryPath(filename, directoryPath, separator) {
6569
+ return directoryPath + filename + separator;
6570
+ }
6571
+ exports.joinDirectoryPath = joinDirectoryPath;
6572
+ function build(root, options) {
6573
+ const { relativePaths, includeBasePath } = options;
6574
+ return relativePaths && root
6575
+ ? joinPathWithRelativePath(root, options)
6576
+ : includeBasePath
6577
+ ? joinPathWithBasePath
6578
+ : joinPath;
6579
+ }
6580
+ exports.build = build;
6745
6581
 
6746
- // JavaScript implementation of realpath, ported from node pre-v6
6747
6582
 
6748
- var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
6583
+ /***/ }),
6749
6584
 
6750
- function rethrow() {
6751
- // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
6752
- // is fairly slow to generate.
6753
- var callback;
6754
- if (DEBUG) {
6755
- var backtrace = new Error;
6756
- callback = debugCallback;
6757
- } else
6758
- callback = missingCallback;
6585
+ /***/ 4649:
6586
+ /***/ ((__unused_webpack_module, exports) => {
6759
6587
 
6760
- return callback;
6588
+ "use strict";
6761
6589
 
6762
- function debugCallback(err) {
6763
- if (err) {
6764
- backtrace.message = err.message;
6765
- err = backtrace;
6766
- missingCallback(err);
6590
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6591
+ exports.build = void 0;
6592
+ function pushDirectoryWithRelativePath(root) {
6593
+ return function (directoryPath, paths) {
6594
+ paths.push(directoryPath.substring(root.length) || ".");
6595
+ };
6596
+ }
6597
+ function pushDirectoryFilterWithRelativePath(root) {
6598
+ return function (directoryPath, paths, filters) {
6599
+ const relativePath = directoryPath.substring(root.length) || ".";
6600
+ if (filters.every((filter) => filter(relativePath, true))) {
6601
+ paths.push(relativePath);
6602
+ }
6603
+ };
6604
+ }
6605
+ const pushDirectory = (directoryPath, paths) => {
6606
+ paths.push(directoryPath || ".");
6607
+ };
6608
+ const pushDirectoryFilter = (directoryPath, paths, filters) => {
6609
+ const path = directoryPath || ".";
6610
+ if (filters.every((filter) => filter(path, true))) {
6611
+ paths.push(path);
6767
6612
  }
6768
- }
6613
+ };
6614
+ const empty = () => { };
6615
+ function build(root, options) {
6616
+ const { includeDirs, filters, relativePaths } = options;
6617
+ if (!includeDirs)
6618
+ return empty;
6619
+ if (relativePaths)
6620
+ return filters && filters.length
6621
+ ? pushDirectoryFilterWithRelativePath(root)
6622
+ : pushDirectoryWithRelativePath(root);
6623
+ return filters && filters.length ? pushDirectoryFilter : pushDirectory;
6624
+ }
6625
+ exports.build = build;
6769
6626
 
6770
- function missingCallback(err) {
6771
- if (err) {
6772
- if (process.throwDeprecation)
6773
- throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
6774
- else if (!process.noDeprecation) {
6775
- var msg = 'fs: missing callback ' + (err.stack || err.message);
6776
- if (process.traceDeprecation)
6777
- console.trace(msg);
6778
- else
6779
- console.error(msg);
6780
- }
6627
+
6628
+ /***/ }),
6629
+
6630
+ /***/ 9826:
6631
+ /***/ ((__unused_webpack_module, exports) => {
6632
+
6633
+ "use strict";
6634
+
6635
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6636
+ exports.build = void 0;
6637
+ const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
6638
+ if (filters.every((filter) => filter(filename, false)))
6639
+ counts.files++;
6640
+ };
6641
+ const pushFileFilter = (filename, paths, _counts, filters) => {
6642
+ if (filters.every((filter) => filter(filename, false)))
6643
+ paths.push(filename);
6644
+ };
6645
+ const pushFileCount = (_filename, _paths, counts, _filters) => {
6646
+ counts.files++;
6647
+ };
6648
+ const pushFile = (filename, paths) => {
6649
+ paths.push(filename);
6650
+ };
6651
+ const empty = () => { };
6652
+ function build(options) {
6653
+ const { excludeFiles, filters, onlyCounts } = options;
6654
+ if (excludeFiles)
6655
+ return empty;
6656
+ if (filters && filters.length) {
6657
+ return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
6658
+ }
6659
+ else if (onlyCounts) {
6660
+ return pushFileCount;
6661
+ }
6662
+ else {
6663
+ return pushFile;
6781
6664
  }
6782
- }
6783
6665
  }
6666
+ exports.build = build;
6784
6667
 
6785
- function maybeCallback(cb) {
6786
- return typeof cb === 'function' ? cb : rethrow();
6787
- }
6788
6668
 
6789
- var normalize = pathModule.normalize;
6669
+ /***/ }),
6670
+
6671
+ /***/ 4185:
6672
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6790
6673
 
6791
- // Regexp that finds the next partion of a (partial) path
6792
- // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
6793
- if (isWindows) {
6794
- var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
6795
- } else {
6796
- var nextPartRe = /(.*?)(?:[\/]+|$)/g;
6797
- }
6674
+ "use strict";
6798
6675
 
6799
- // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
6800
- if (isWindows) {
6801
- var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
6802
- } else {
6803
- var splitRootRe = /^[\/]*/;
6676
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6677
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6678
+ };
6679
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6680
+ exports.build = void 0;
6681
+ const fs_1 = __importDefault(__webpack_require__(9896));
6682
+ const path_1 = __webpack_require__(6928);
6683
+ const resolveSymlinksAsync = function (path, state, callback) {
6684
+ const { queue, options: { suppressErrors }, } = state;
6685
+ queue.enqueue();
6686
+ fs_1.default.realpath(path, (error, resolvedPath) => {
6687
+ if (error)
6688
+ return queue.dequeue(suppressErrors ? null : error, state);
6689
+ fs_1.default.stat(resolvedPath, (error, stat) => {
6690
+ if (error)
6691
+ return queue.dequeue(suppressErrors ? null : error, state);
6692
+ if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
6693
+ return queue.dequeue(null, state);
6694
+ callback(stat, resolvedPath);
6695
+ queue.dequeue(null, state);
6696
+ });
6697
+ });
6698
+ };
6699
+ const resolveSymlinks = function (path, state, callback) {
6700
+ const { queue, options: { suppressErrors }, } = state;
6701
+ queue.enqueue();
6702
+ try {
6703
+ const resolvedPath = fs_1.default.realpathSync(path);
6704
+ const stat = fs_1.default.statSync(resolvedPath);
6705
+ if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
6706
+ return;
6707
+ callback(stat, resolvedPath);
6708
+ }
6709
+ catch (e) {
6710
+ if (!suppressErrors)
6711
+ throw e;
6712
+ }
6713
+ };
6714
+ function build(options, isSynchronous) {
6715
+ if (!options.resolveSymlinks || options.excludeSymlinks)
6716
+ return null;
6717
+ return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
6718
+ }
6719
+ exports.build = build;
6720
+ function isRecursive(path, resolved, state) {
6721
+ if (state.options.useRealPaths)
6722
+ return isRecursiveUsingRealPaths(resolved, state);
6723
+ let parent = (0, path_1.dirname)(path);
6724
+ let depth = 1;
6725
+ while (parent !== state.root && depth < 2) {
6726
+ const resolvedPath = state.symlinks.get(parent);
6727
+ const isSameRoot = !!resolvedPath &&
6728
+ (resolvedPath === resolved ||
6729
+ resolvedPath.startsWith(resolved) ||
6730
+ resolved.startsWith(resolvedPath));
6731
+ if (isSameRoot)
6732
+ depth++;
6733
+ else
6734
+ parent = (0, path_1.dirname)(parent);
6735
+ }
6736
+ state.symlinks.set(path, resolved);
6737
+ return depth > 1;
6738
+ }
6739
+ function isRecursiveUsingRealPaths(resolved, state) {
6740
+ return state.visited.includes(resolved + state.options.pathSeparator);
6804
6741
  }
6805
6742
 
6806
- exports.realpathSync = function realpathSync(p, cache) {
6807
- // make p is absolute
6808
- p = pathModule.resolve(p);
6809
6743
 
6810
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
6811
- return cache[p];
6812
- }
6744
+ /***/ }),
6813
6745
 
6814
- var original = p,
6815
- seenLinks = {},
6816
- knownHard = {};
6746
+ /***/ 7800:
6747
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6817
6748
 
6818
- // current character position in p
6819
- var pos;
6820
- // the partial path so far, including a trailing slash if any
6821
- var current;
6822
- // the partial path without a trailing slash (except when pointing at a root)
6823
- var base;
6824
- // the partial path scanned in the previous round, with slash
6825
- var previous;
6749
+ "use strict";
6826
6750
 
6827
- start();
6751
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6752
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6753
+ };
6754
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6755
+ exports.build = void 0;
6756
+ const fs_1 = __importDefault(__webpack_require__(9896));
6757
+ const readdirOpts = { withFileTypes: true };
6758
+ const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback) => {
6759
+ if (currentDepth < 0)
6760
+ return state.queue.dequeue(null, state);
6761
+ state.visited.push(crawlPath);
6762
+ state.counts.directories++;
6763
+ state.queue.enqueue();
6764
+ // Perf: Node >= 10 introduced withFileTypes that helps us
6765
+ // skip an extra fs.stat call.
6766
+ fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
6767
+ callback(entries, directoryPath, currentDepth);
6768
+ state.queue.dequeue(state.options.suppressErrors ? null : error, state);
6769
+ });
6770
+ };
6771
+ const walkSync = (state, crawlPath, directoryPath, currentDepth, callback) => {
6772
+ if (currentDepth < 0)
6773
+ return;
6774
+ state.visited.push(crawlPath);
6775
+ state.counts.directories++;
6776
+ let entries = [];
6777
+ try {
6778
+ entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
6779
+ }
6780
+ catch (e) {
6781
+ if (!state.options.suppressErrors)
6782
+ throw e;
6783
+ }
6784
+ callback(entries, directoryPath, currentDepth);
6785
+ };
6786
+ function build(isSynchronous) {
6787
+ return isSynchronous ? walkSync : walkAsync;
6788
+ }
6789
+ exports.build = build;
6828
6790
 
6829
- function start() {
6830
- // Skip over roots
6831
- var m = splitRootRe.exec(p);
6832
- pos = m[0].length;
6833
- current = m[0];
6834
- base = m[0];
6835
- previous = '';
6836
6791
 
6837
- // On windows, check that the root exists. On unix there is no need.
6838
- if (isWindows && !knownHard[base]) {
6839
- fs.lstatSync(base);
6840
- knownHard[base] = true;
6841
- }
6842
- }
6792
+ /***/ }),
6843
6793
 
6844
- // walk down the path, swapping out linked pathparts for their real
6845
- // values
6846
- // NB: p.length changes.
6847
- while (pos < p.length) {
6848
- // find the next part
6849
- nextPartRe.lastIndex = pos;
6850
- var result = nextPartRe.exec(p);
6851
- previous = current;
6852
- current += result[0];
6853
- base = previous + result[1];
6854
- pos = nextPartRe.lastIndex;
6794
+ /***/ 1250:
6795
+ /***/ ((__unused_webpack_module, exports) => {
6855
6796
 
6856
- // continue if not a symlink
6857
- if (knownHard[base] || (cache && cache[base] === base)) {
6858
- continue;
6797
+ "use strict";
6798
+
6799
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6800
+ exports.Queue = void 0;
6801
+ /**
6802
+ * This is a custom stateless queue to track concurrent async fs calls.
6803
+ * It increments a counter whenever a call is queued and decrements it
6804
+ * as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
6805
+ */
6806
+ class Queue {
6807
+ onQueueEmpty;
6808
+ count = 0;
6809
+ constructor(onQueueEmpty) {
6810
+ this.onQueueEmpty = onQueueEmpty;
6811
+ }
6812
+ enqueue() {
6813
+ this.count++;
6814
+ }
6815
+ dequeue(error, output) {
6816
+ if (--this.count <= 0 || error)
6817
+ this.onQueueEmpty(error, output);
6859
6818
  }
6819
+ }
6820
+ exports.Queue = Queue;
6860
6821
 
6861
- var resolvedLink;
6862
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
6863
- // some known symbolic link. no need to stat again.
6864
- resolvedLink = cache[base];
6865
- } else {
6866
- var stat = fs.lstatSync(base);
6867
- if (!stat.isSymbolicLink()) {
6868
- knownHard[base] = true;
6869
- if (cache) cache[base] = base;
6870
- continue;
6871
- }
6872
6822
 
6873
- // read the link if it wasn't read before
6874
- // dev/ino always return 0 on windows, so skip the check.
6875
- var linkTarget = null;
6876
- if (!isWindows) {
6877
- var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
6878
- if (seenLinks.hasOwnProperty(id)) {
6879
- linkTarget = seenLinks[id];
6880
- }
6881
- }
6882
- if (linkTarget === null) {
6883
- fs.statSync(base);
6884
- linkTarget = fs.readlinkSync(base);
6885
- }
6886
- resolvedLink = pathModule.resolve(previous, linkTarget);
6887
- // track this, if given a cache.
6888
- if (cache) cache[base] = resolvedLink;
6889
- if (!isWindows) seenLinks[id] = linkTarget;
6890
- }
6823
+ /***/ }),
6891
6824
 
6892
- // resolve the link, then start over
6893
- p = pathModule.resolve(resolvedLink, p.slice(pos));
6894
- start();
6895
- }
6825
+ /***/ 2910:
6826
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6896
6827
 
6897
- if (cache) cache[original] = p;
6828
+ "use strict";
6898
6829
 
6899
- return p;
6900
- };
6830
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6831
+ exports.sync = void 0;
6832
+ const walker_1 = __webpack_require__(5427);
6833
+ function sync(root, options) {
6834
+ const walker = new walker_1.Walker(root, options);
6835
+ return walker.start();
6836
+ }
6837
+ exports.sync = sync;
6901
6838
 
6902
6839
 
6903
- exports.realpath = function realpath(p, cache, cb) {
6904
- if (typeof cb !== 'function') {
6905
- cb = maybeCallback(cache);
6906
- cache = null;
6907
- }
6840
+ /***/ }),
6908
6841
 
6909
- // make p is absolute
6910
- p = pathModule.resolve(p);
6842
+ /***/ 5427:
6843
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6911
6844
 
6912
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
6913
- return process.nextTick(cb.bind(null, null, cache[p]));
6914
- }
6845
+ "use strict";
6846
+
6847
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6848
+ if (k2 === undefined) k2 = k;
6849
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6850
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6851
+ desc = { enumerable: true, get: function() { return m[k]; } };
6852
+ }
6853
+ Object.defineProperty(o, k2, desc);
6854
+ }) : (function(o, m, k, k2) {
6855
+ if (k2 === undefined) k2 = k;
6856
+ o[k2] = m[k];
6857
+ }));
6858
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
6859
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
6860
+ }) : function(o, v) {
6861
+ o["default"] = v;
6862
+ });
6863
+ var __importStar = (this && this.__importStar) || function (mod) {
6864
+ if (mod && mod.__esModule) return mod;
6865
+ var result = {};
6866
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
6867
+ __setModuleDefault(result, mod);
6868
+ return result;
6869
+ };
6870
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6871
+ exports.Walker = void 0;
6872
+ const path_1 = __webpack_require__(6928);
6873
+ const utils_1 = __webpack_require__(7607);
6874
+ const joinPath = __importStar(__webpack_require__(4315));
6875
+ const pushDirectory = __importStar(__webpack_require__(4649));
6876
+ const pushFile = __importStar(__webpack_require__(9826));
6877
+ const getArray = __importStar(__webpack_require__(515));
6878
+ const groupFiles = __importStar(__webpack_require__(8461));
6879
+ const resolveSymlink = __importStar(__webpack_require__(4185));
6880
+ const invokeCallback = __importStar(__webpack_require__(2523));
6881
+ const walkDirectory = __importStar(__webpack_require__(7800));
6882
+ const queue_1 = __webpack_require__(1250);
6883
+ const counter_1 = __webpack_require__(8177);
6884
+ class Walker {
6885
+ root;
6886
+ isSynchronous;
6887
+ state;
6888
+ joinPath;
6889
+ pushDirectory;
6890
+ pushFile;
6891
+ getArray;
6892
+ groupFiles;
6893
+ resolveSymlink;
6894
+ walkDirectory;
6895
+ callbackInvoker;
6896
+ constructor(root, options, callback) {
6897
+ this.isSynchronous = !callback;
6898
+ this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
6899
+ this.root = (0, utils_1.normalizePath)(root, options);
6900
+ this.state = {
6901
+ root: this.root.slice(0, -1),
6902
+ // Perf: we explicitly tell the compiler to optimize for String arrays
6903
+ paths: [""].slice(0, 0),
6904
+ groups: [],
6905
+ counts: new counter_1.Counter(),
6906
+ options,
6907
+ queue: new queue_1.Queue((error, state) => this.callbackInvoker(state, error, callback)),
6908
+ symlinks: new Map(),
6909
+ visited: [""].slice(0, 0),
6910
+ };
6911
+ /*
6912
+ * Perf: We conditionally change functions according to options. This gives a slight
6913
+ * performance boost. Since these functions are so small, they are automatically inlined
6914
+ * by the javascript engine so there's no function call overhead (in most cases).
6915
+ */
6916
+ this.joinPath = joinPath.build(this.root, options);
6917
+ this.pushDirectory = pushDirectory.build(this.root, options);
6918
+ this.pushFile = pushFile.build(options);
6919
+ this.getArray = getArray.build(options);
6920
+ this.groupFiles = groupFiles.build(options);
6921
+ this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
6922
+ this.walkDirectory = walkDirectory.build(this.isSynchronous);
6923
+ }
6924
+ start() {
6925
+ this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
6926
+ return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
6927
+ }
6928
+ walk = (entries, directoryPath, depth) => {
6929
+ const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator, }, } = this.state;
6930
+ if ((signal && signal.aborted) || (maxFiles && paths.length > maxFiles))
6931
+ return;
6932
+ this.pushDirectory(directoryPath, paths, filters);
6933
+ const files = this.getArray(this.state.paths);
6934
+ for (let i = 0; i < entries.length; ++i) {
6935
+ const entry = entries[i];
6936
+ if (entry.isFile() ||
6937
+ (entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks)) {
6938
+ const filename = this.joinPath(entry.name, directoryPath);
6939
+ this.pushFile(filename, files, this.state.counts, filters);
6940
+ }
6941
+ else if (entry.isDirectory()) {
6942
+ let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
6943
+ if (exclude && exclude(entry.name, path))
6944
+ continue;
6945
+ this.walkDirectory(this.state, path, path, depth - 1, this.walk);
6946
+ }
6947
+ else if (entry.isSymbolicLink() && this.resolveSymlink) {
6948
+ let path = joinPath.joinPathWithBasePath(entry.name, directoryPath);
6949
+ this.resolveSymlink(path, this.state, (stat, resolvedPath) => {
6950
+ if (stat.isDirectory()) {
6951
+ resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
6952
+ if (exclude && exclude(entry.name, resolvedPath))
6953
+ return;
6954
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
6955
+ }
6956
+ else {
6957
+ resolvedPath = useRealPaths ? resolvedPath : path;
6958
+ const filename = (0, path_1.basename)(resolvedPath);
6959
+ const directoryPath = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
6960
+ resolvedPath = this.joinPath(filename, directoryPath);
6961
+ this.pushFile(resolvedPath, files, this.state.counts, filters);
6962
+ }
6963
+ });
6964
+ }
6965
+ }
6966
+ this.groupFiles(this.state.groups, directoryPath, files);
6967
+ };
6968
+ }
6969
+ exports.Walker = Walker;
6915
6970
 
6916
- var original = p,
6917
- seenLinks = {},
6918
- knownHard = {};
6919
6971
 
6920
- // current character position in p
6921
- var pos;
6922
- // the partial path so far, including a trailing slash if any
6923
- var current;
6924
- // the partial path without a trailing slash (except when pointing at a root)
6925
- var base;
6926
- // the partial path scanned in the previous round, with slash
6927
- var previous;
6972
+ /***/ }),
6928
6973
 
6929
- start();
6974
+ /***/ 8536:
6975
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6930
6976
 
6931
- function start() {
6932
- // Skip over roots
6933
- var m = splitRootRe.exec(p);
6934
- pos = m[0].length;
6935
- current = m[0];
6936
- base = m[0];
6937
- previous = '';
6977
+ "use strict";
6938
6978
 
6939
- // On windows, check that the root exists. On unix there is no need.
6940
- if (isWindows && !knownHard[base]) {
6941
- fs.lstat(base, function(err) {
6942
- if (err) return cb(err);
6943
- knownHard[base] = true;
6944
- LOOP();
6945
- });
6946
- } else {
6947
- process.nextTick(LOOP);
6979
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6980
+ exports.APIBuilder = void 0;
6981
+ const async_1 = __webpack_require__(6957);
6982
+ const sync_1 = __webpack_require__(2910);
6983
+ class APIBuilder {
6984
+ root;
6985
+ options;
6986
+ constructor(root, options) {
6987
+ this.root = root;
6988
+ this.options = options;
6948
6989
  }
6949
- }
6950
-
6951
- // walk down the path, swapping out linked pathparts for their real
6952
- // values
6953
- function LOOP() {
6954
- // stop if scanned past end of path
6955
- if (pos >= p.length) {
6956
- if (cache) cache[original] = p;
6957
- return cb(null, p);
6990
+ withPromise() {
6991
+ return (0, async_1.promise)(this.root, this.options);
6992
+ }
6993
+ withCallback(cb) {
6994
+ (0, async_1.callback)(this.root, this.options, cb);
6958
6995
  }
6996
+ sync() {
6997
+ return (0, sync_1.sync)(this.root, this.options);
6998
+ }
6999
+ }
7000
+ exports.APIBuilder = APIBuilder;
6959
7001
 
6960
- // find the next part
6961
- nextPartRe.lastIndex = pos;
6962
- var result = nextPartRe.exec(p);
6963
- previous = current;
6964
- current += result[0];
6965
- base = previous + result[1];
6966
- pos = nextPartRe.lastIndex;
6967
7002
 
6968
- // continue if not a symlink
6969
- if (knownHard[base] || (cache && cache[base] === base)) {
6970
- return process.nextTick(LOOP);
6971
- }
7003
+ /***/ }),
7004
+
7005
+ /***/ 6178:
7006
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7007
+
7008
+ "use strict";
6972
7009
 
6973
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
6974
- // known symbolic link. no need to stat again.
6975
- return gotResolvedLink(cache[base]);
7010
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
7011
+ exports.Builder = void 0;
7012
+ const path_1 = __webpack_require__(6928);
7013
+ const api_builder_1 = __webpack_require__(8536);
7014
+ var pm = null;
7015
+ /* c8 ignore next 6 */
7016
+ try {
7017
+ /*require.resolve*/(5728);
7018
+ pm = __webpack_require__(5728);
7019
+ }
7020
+ catch (_e) {
7021
+ // do nothing
7022
+ }
7023
+ class Builder {
7024
+ globCache = {};
7025
+ options = {
7026
+ maxDepth: Infinity,
7027
+ suppressErrors: true,
7028
+ pathSeparator: path_1.sep,
7029
+ filters: [],
7030
+ };
7031
+ globFunction;
7032
+ constructor(options) {
7033
+ this.options = { ...this.options, ...options };
7034
+ this.globFunction = this.options.globFunction;
7035
+ }
7036
+ group() {
7037
+ this.options.group = true;
7038
+ return this;
7039
+ }
7040
+ withPathSeparator(separator) {
7041
+ this.options.pathSeparator = separator;
7042
+ return this;
7043
+ }
7044
+ withBasePath() {
7045
+ this.options.includeBasePath = true;
7046
+ return this;
7047
+ }
7048
+ withRelativePaths() {
7049
+ this.options.relativePaths = true;
7050
+ return this;
7051
+ }
7052
+ withDirs() {
7053
+ this.options.includeDirs = true;
7054
+ return this;
7055
+ }
7056
+ withMaxDepth(depth) {
7057
+ this.options.maxDepth = depth;
7058
+ return this;
7059
+ }
7060
+ withMaxFiles(limit) {
7061
+ this.options.maxFiles = limit;
7062
+ return this;
7063
+ }
7064
+ withFullPaths() {
7065
+ this.options.resolvePaths = true;
7066
+ this.options.includeBasePath = true;
7067
+ return this;
7068
+ }
7069
+ withErrors() {
7070
+ this.options.suppressErrors = false;
7071
+ return this;
7072
+ }
7073
+ withSymlinks({ resolvePaths = true } = {}) {
7074
+ this.options.resolveSymlinks = true;
7075
+ this.options.useRealPaths = resolvePaths;
7076
+ return this.withFullPaths();
7077
+ }
7078
+ withAbortSignal(signal) {
7079
+ this.options.signal = signal;
7080
+ return this;
7081
+ }
7082
+ normalize() {
7083
+ this.options.normalizePath = true;
7084
+ return this;
7085
+ }
7086
+ filter(predicate) {
7087
+ this.options.filters.push(predicate);
7088
+ return this;
7089
+ }
7090
+ onlyDirs() {
7091
+ this.options.excludeFiles = true;
7092
+ this.options.includeDirs = true;
7093
+ return this;
7094
+ }
7095
+ exclude(predicate) {
7096
+ this.options.exclude = predicate;
7097
+ return this;
7098
+ }
7099
+ onlyCounts() {
7100
+ this.options.onlyCounts = true;
7101
+ return this;
6976
7102
  }
7103
+ crawl(root) {
7104
+ return new api_builder_1.APIBuilder(root || ".", this.options);
7105
+ }
7106
+ withGlobFunction(fn) {
7107
+ // cast this since we don't have the new type params yet
7108
+ this.globFunction = fn;
7109
+ return this;
7110
+ }
7111
+ /**
7112
+ * @deprecated Pass options using the constructor instead:
7113
+ * ```ts
7114
+ * new fdir(options).crawl("/path/to/root");
7115
+ * ```
7116
+ * This method will be removed in v7.0
7117
+ */
7118
+ /* c8 ignore next 4 */
7119
+ crawlWithOptions(root, options) {
7120
+ this.options = { ...this.options, ...options };
7121
+ return new api_builder_1.APIBuilder(root || ".", this.options);
7122
+ }
7123
+ glob(...patterns) {
7124
+ if (this.globFunction) {
7125
+ return this.globWithOptions(patterns);
7126
+ }
7127
+ return this.globWithOptions(patterns, ...[{ dot: true }]);
7128
+ }
7129
+ globWithOptions(patterns, ...options) {
7130
+ const globFn = (this.globFunction || pm);
7131
+ /* c8 ignore next 5 */
7132
+ if (!globFn) {
7133
+ throw new Error('Please specify a glob function to use glob matching.');
7134
+ }
7135
+ var isMatch = this.globCache[patterns.join("\0")];
7136
+ if (!isMatch) {
7137
+ isMatch = globFn(patterns, ...options);
7138
+ this.globCache[patterns.join("\0")] = isMatch;
7139
+ }
7140
+ this.options.filters.push((path) => isMatch(path));
7141
+ return this;
7142
+ }
7143
+ }
7144
+ exports.Builder = Builder;
6977
7145
 
6978
- return fs.lstat(base, gotStat);
6979
- }
6980
7146
 
6981
- function gotStat(err, stat) {
6982
- if (err) return cb(err);
7147
+ /***/ }),
6983
7148
 
6984
- // if not a symlink, skip to the next path part
6985
- if (!stat.isSymbolicLink()) {
6986
- knownHard[base] = true;
6987
- if (cache) cache[base] = base;
6988
- return process.nextTick(LOOP);
6989
- }
7149
+ /***/ 4294:
7150
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6990
7151
 
6991
- // stat & read the link if not read before
6992
- // call gotTarget as soon as the link target is known
6993
- // dev/ino always return 0 on windows, so skip the check.
6994
- if (!isWindows) {
6995
- var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
6996
- if (seenLinks.hasOwnProperty(id)) {
6997
- return gotTarget(null, seenLinks[id], base);
6998
- }
7152
+ "use strict";
7153
+
7154
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7155
+ if (k2 === undefined) k2 = k;
7156
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7157
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7158
+ desc = { enumerable: true, get: function() { return m[k]; } };
6999
7159
  }
7000
- fs.stat(base, function(err) {
7001
- if (err) return cb(err);
7160
+ Object.defineProperty(o, k2, desc);
7161
+ }) : (function(o, m, k, k2) {
7162
+ if (k2 === undefined) k2 = k;
7163
+ o[k2] = m[k];
7164
+ }));
7165
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
7166
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
7167
+ };
7168
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
7169
+ exports.fdir = void 0;
7170
+ const builder_1 = __webpack_require__(6178);
7171
+ Object.defineProperty(exports, "fdir", ({ enumerable: true, get: function () { return builder_1.Builder; } }));
7172
+ __exportStar(__webpack_require__(9675), exports);
7002
7173
 
7003
- fs.readlink(base, function(err, target) {
7004
- if (!isWindows) seenLinks[id] = target;
7005
- gotTarget(err, target);
7006
- });
7007
- });
7008
- }
7009
7174
 
7010
- function gotTarget(err, target, base) {
7011
- if (err) return cb(err);
7175
+ /***/ }),
7012
7176
 
7013
- var resolvedLink = pathModule.resolve(previous, target);
7014
- if (cache) cache[base] = resolvedLink;
7015
- gotResolvedLink(resolvedLink);
7016
- }
7177
+ /***/ 9675:
7178
+ /***/ ((__unused_webpack_module, exports) => {
7017
7179
 
7018
- function gotResolvedLink(resolvedLink) {
7019
- // resolve the link, then start over
7020
- p = pathModule.resolve(resolvedLink, p.slice(pos));
7021
- start();
7022
- }
7023
- };
7180
+ "use strict";
7181
+
7182
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
7183
+
7184
+
7185
+ /***/ }),
7186
+
7187
+ /***/ 7607:
7188
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7189
+
7190
+ "use strict";
7191
+
7192
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
7193
+ exports.normalizePath = exports.convertSlashes = exports.cleanPath = void 0;
7194
+ const path_1 = __webpack_require__(6928);
7195
+ function cleanPath(path) {
7196
+ let normalized = (0, path_1.normalize)(path);
7197
+ // we have to remove the last path separator
7198
+ // to account for / root path
7199
+ if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep)
7200
+ normalized = normalized.substring(0, normalized.length - 1);
7201
+ return normalized;
7202
+ }
7203
+ exports.cleanPath = cleanPath;
7204
+ const SLASHES_REGEX = /[\\/]/g;
7205
+ function convertSlashes(path, separator) {
7206
+ return path.replace(SLASHES_REGEX, separator);
7207
+ }
7208
+ exports.convertSlashes = convertSlashes;
7209
+ function normalizePath(path, options) {
7210
+ const { resolvePaths, normalizePath, pathSeparator } = options;
7211
+ const pathNeedsCleaning = (process.platform === "win32" && path.includes("/")) ||
7212
+ path.startsWith(".");
7213
+ if (resolvePaths)
7214
+ path = (0, path_1.resolve)(path);
7215
+ if (normalizePath || pathNeedsCleaning)
7216
+ path = cleanPath(path);
7217
+ if (path === ".")
7218
+ return "";
7219
+ const needsSeperator = path[path.length - 1] !== pathSeparator;
7220
+ return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
7221
+ }
7222
+ exports.normalizePath = normalizePath;
7024
7223
 
7025
7224
 
7026
7225
  /***/ }),
@@ -7128,1547 +7327,6 @@ var implementation = __webpack_require__(9992);
7128
7327
  module.exports = Function.prototype.bind || implementation;
7129
7328
 
7130
7329
 
7131
- /***/ }),
7132
-
7133
- /***/ 3092:
7134
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7135
-
7136
- exports.setopts = setopts
7137
- exports.ownProp = ownProp
7138
- exports.makeAbs = makeAbs
7139
- exports.finish = finish
7140
- exports.mark = mark
7141
- exports.isIgnored = isIgnored
7142
- exports.childrenIgnored = childrenIgnored
7143
-
7144
- function ownProp (obj, field) {
7145
- return Object.prototype.hasOwnProperty.call(obj, field)
7146
- }
7147
-
7148
- var fs = __webpack_require__(9896)
7149
- var path = __webpack_require__(6928)
7150
- var minimatch = __webpack_require__(9064)
7151
- var isAbsolute = (__webpack_require__(6928).isAbsolute)
7152
- var Minimatch = minimatch.Minimatch
7153
-
7154
- function alphasort (a, b) {
7155
- return a.localeCompare(b, 'en')
7156
- }
7157
-
7158
- function setupIgnores (self, options) {
7159
- self.ignore = options.ignore || []
7160
-
7161
- if (!Array.isArray(self.ignore))
7162
- self.ignore = [self.ignore]
7163
-
7164
- if (self.ignore.length) {
7165
- self.ignore = self.ignore.map(ignoreMap)
7166
- }
7167
- }
7168
-
7169
- // ignore patterns are always in dot:true mode.
7170
- function ignoreMap (pattern) {
7171
- var gmatcher = null
7172
- if (pattern.slice(-3) === '/**') {
7173
- var gpattern = pattern.replace(/(\/\*\*)+$/, '')
7174
- gmatcher = new Minimatch(gpattern, { dot: true })
7175
- }
7176
-
7177
- return {
7178
- matcher: new Minimatch(pattern, { dot: true }),
7179
- gmatcher: gmatcher
7180
- }
7181
- }
7182
-
7183
- function setopts (self, pattern, options) {
7184
- if (!options)
7185
- options = {}
7186
-
7187
- // base-matching: just use globstar for that.
7188
- if (options.matchBase && -1 === pattern.indexOf("/")) {
7189
- if (options.noglobstar) {
7190
- throw new Error("base matching requires globstar")
7191
- }
7192
- pattern = "**/" + pattern
7193
- }
7194
-
7195
- self.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||
7196
- options.allowWindowsEscape === false
7197
- if (self.windowsPathsNoEscape) {
7198
- pattern = pattern.replace(/\\/g, '/')
7199
- }
7200
-
7201
- self.silent = !!options.silent
7202
- self.pattern = pattern
7203
- self.strict = options.strict !== false
7204
- self.realpath = !!options.realpath
7205
- self.realpathCache = options.realpathCache || Object.create(null)
7206
- self.follow = !!options.follow
7207
- self.dot = !!options.dot
7208
- self.mark = !!options.mark
7209
- self.nodir = !!options.nodir
7210
- if (self.nodir)
7211
- self.mark = true
7212
- self.sync = !!options.sync
7213
- self.nounique = !!options.nounique
7214
- self.nonull = !!options.nonull
7215
- self.nosort = !!options.nosort
7216
- self.nocase = !!options.nocase
7217
- self.stat = !!options.stat
7218
- self.noprocess = !!options.noprocess
7219
- self.absolute = !!options.absolute
7220
- self.fs = options.fs || fs
7221
-
7222
- self.maxLength = options.maxLength || Infinity
7223
- self.cache = options.cache || Object.create(null)
7224
- self.statCache = options.statCache || Object.create(null)
7225
- self.symlinks = options.symlinks || Object.create(null)
7226
-
7227
- setupIgnores(self, options)
7228
-
7229
- self.changedCwd = false
7230
- var cwd = process.cwd()
7231
- if (!ownProp(options, "cwd"))
7232
- self.cwd = path.resolve(cwd)
7233
- else {
7234
- self.cwd = path.resolve(options.cwd)
7235
- self.changedCwd = self.cwd !== cwd
7236
- }
7237
-
7238
- self.root = options.root || path.resolve(self.cwd, "/")
7239
- self.root = path.resolve(self.root)
7240
-
7241
- // TODO: is an absolute `cwd` supposed to be resolved against `root`?
7242
- // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
7243
- self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
7244
- self.nomount = !!options.nomount
7245
-
7246
- if (process.platform === "win32") {
7247
- self.root = self.root.replace(/\\/g, "/")
7248
- self.cwd = self.cwd.replace(/\\/g, "/")
7249
- self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
7250
- }
7251
-
7252
- // disable comments and negation in Minimatch.
7253
- // Note that they are not supported in Glob itself anyway.
7254
- options.nonegate = true
7255
- options.nocomment = true
7256
-
7257
- self.minimatch = new Minimatch(pattern, options)
7258
- self.options = self.minimatch.options
7259
- }
7260
-
7261
- function finish (self) {
7262
- var nou = self.nounique
7263
- var all = nou ? [] : Object.create(null)
7264
-
7265
- for (var i = 0, l = self.matches.length; i < l; i ++) {
7266
- var matches = self.matches[i]
7267
- if (!matches || Object.keys(matches).length === 0) {
7268
- if (self.nonull) {
7269
- // do like the shell, and spit out the literal glob
7270
- var literal = self.minimatch.globSet[i]
7271
- if (nou)
7272
- all.push(literal)
7273
- else
7274
- all[literal] = true
7275
- }
7276
- } else {
7277
- // had matches
7278
- var m = Object.keys(matches)
7279
- if (nou)
7280
- all.push.apply(all, m)
7281
- else
7282
- m.forEach(function (m) {
7283
- all[m] = true
7284
- })
7285
- }
7286
- }
7287
-
7288
- if (!nou)
7289
- all = Object.keys(all)
7290
-
7291
- if (!self.nosort)
7292
- all = all.sort(alphasort)
7293
-
7294
- // at *some* point we statted all of these
7295
- if (self.mark) {
7296
- for (var i = 0; i < all.length; i++) {
7297
- all[i] = self._mark(all[i])
7298
- }
7299
- if (self.nodir) {
7300
- all = all.filter(function (e) {
7301
- var notDir = !(/\/$/.test(e))
7302
- var c = self.cache[e] || self.cache[makeAbs(self, e)]
7303
- if (notDir && c)
7304
- notDir = c !== 'DIR' && !Array.isArray(c)
7305
- return notDir
7306
- })
7307
- }
7308
- }
7309
-
7310
- if (self.ignore.length)
7311
- all = all.filter(function(m) {
7312
- return !isIgnored(self, m)
7313
- })
7314
-
7315
- self.found = all
7316
- }
7317
-
7318
- function mark (self, p) {
7319
- var abs = makeAbs(self, p)
7320
- var c = self.cache[abs]
7321
- var m = p
7322
- if (c) {
7323
- var isDir = c === 'DIR' || Array.isArray(c)
7324
- var slash = p.slice(-1) === '/'
7325
-
7326
- if (isDir && !slash)
7327
- m += '/'
7328
- else if (!isDir && slash)
7329
- m = m.slice(0, -1)
7330
-
7331
- if (m !== p) {
7332
- var mabs = makeAbs(self, m)
7333
- self.statCache[mabs] = self.statCache[abs]
7334
- self.cache[mabs] = self.cache[abs]
7335
- }
7336
- }
7337
-
7338
- return m
7339
- }
7340
-
7341
- // lotta situps...
7342
- function makeAbs (self, f) {
7343
- var abs = f
7344
- if (f.charAt(0) === '/') {
7345
- abs = path.join(self.root, f)
7346
- } else if (isAbsolute(f) || f === '') {
7347
- abs = f
7348
- } else if (self.changedCwd) {
7349
- abs = path.resolve(self.cwd, f)
7350
- } else {
7351
- abs = path.resolve(f)
7352
- }
7353
-
7354
- if (process.platform === 'win32')
7355
- abs = abs.replace(/\\/g, '/')
7356
-
7357
- return abs
7358
- }
7359
-
7360
-
7361
- // Return true, if pattern ends with globstar '**', for the accompanying parent directory.
7362
- // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
7363
- function isIgnored (self, path) {
7364
- if (!self.ignore.length)
7365
- return false
7366
-
7367
- return self.ignore.some(function(item) {
7368
- return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
7369
- })
7370
- }
7371
-
7372
- function childrenIgnored (self, path) {
7373
- if (!self.ignore.length)
7374
- return false
7375
-
7376
- return self.ignore.some(function(item) {
7377
- return !!(item.gmatcher && item.gmatcher.match(path))
7378
- })
7379
- }
7380
-
7381
-
7382
- /***/ }),
7383
-
7384
- /***/ 9011:
7385
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7386
-
7387
- // Approach:
7388
- //
7389
- // 1. Get the minimatch set
7390
- // 2. For each pattern in the set, PROCESS(pattern, false)
7391
- // 3. Store matches per-set, then uniq them
7392
- //
7393
- // PROCESS(pattern, inGlobStar)
7394
- // Get the first [n] items from pattern that are all strings
7395
- // Join these together. This is PREFIX.
7396
- // If there is no more remaining, then stat(PREFIX) and
7397
- // add to matches if it succeeds. END.
7398
- //
7399
- // If inGlobStar and PREFIX is symlink and points to dir
7400
- // set ENTRIES = []
7401
- // else readdir(PREFIX) as ENTRIES
7402
- // If fail, END
7403
- //
7404
- // with ENTRIES
7405
- // If pattern[n] is GLOBSTAR
7406
- // // handle the case where the globstar match is empty
7407
- // // by pruning it out, and testing the resulting pattern
7408
- // PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
7409
- // // handle other cases.
7410
- // for ENTRY in ENTRIES (not dotfiles)
7411
- // // attach globstar + tail onto the entry
7412
- // // Mark that this entry is a globstar match
7413
- // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
7414
- //
7415
- // else // not globstar
7416
- // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
7417
- // Test ENTRY against pattern[n]
7418
- // If fails, continue
7419
- // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
7420
- //
7421
- // Caveat:
7422
- // Cache all stats and readdirs results to minimize syscall. Since all
7423
- // we ever care about is existence and directory-ness, we can just keep
7424
- // `true` for files, and [children,...] for directories, or `false` for
7425
- // things that don't exist.
7426
-
7427
- module.exports = glob
7428
-
7429
- var rp = __webpack_require__(8831)
7430
- var minimatch = __webpack_require__(9064)
7431
- var Minimatch = minimatch.Minimatch
7432
- var inherits = __webpack_require__(2666)
7433
- var EE = (__webpack_require__(4434).EventEmitter)
7434
- var path = __webpack_require__(6928)
7435
- var assert = __webpack_require__(2613)
7436
- var isAbsolute = (__webpack_require__(6928).isAbsolute)
7437
- var globSync = __webpack_require__(5766)
7438
- var common = __webpack_require__(3092)
7439
- var setopts = common.setopts
7440
- var ownProp = common.ownProp
7441
- var inflight = __webpack_require__(7794)
7442
- var util = __webpack_require__(9023)
7443
- var childrenIgnored = common.childrenIgnored
7444
- var isIgnored = common.isIgnored
7445
-
7446
- var once = __webpack_require__(7992)
7447
-
7448
- function glob (pattern, options, cb) {
7449
- if (typeof options === 'function') cb = options, options = {}
7450
- if (!options) options = {}
7451
-
7452
- if (options.sync) {
7453
- if (cb)
7454
- throw new TypeError('callback provided to sync glob')
7455
- return globSync(pattern, options)
7456
- }
7457
-
7458
- return new Glob(pattern, options, cb)
7459
- }
7460
-
7461
- glob.sync = globSync
7462
- var GlobSync = glob.GlobSync = globSync.GlobSync
7463
-
7464
- // old api surface
7465
- glob.glob = glob
7466
-
7467
- function extend (origin, add) {
7468
- if (add === null || typeof add !== 'object') {
7469
- return origin
7470
- }
7471
-
7472
- var keys = Object.keys(add)
7473
- var i = keys.length
7474
- while (i--) {
7475
- origin[keys[i]] = add[keys[i]]
7476
- }
7477
- return origin
7478
- }
7479
-
7480
- glob.hasMagic = function (pattern, options_) {
7481
- var options = extend({}, options_)
7482
- options.noprocess = true
7483
-
7484
- var g = new Glob(pattern, options)
7485
- var set = g.minimatch.set
7486
-
7487
- if (!pattern)
7488
- return false
7489
-
7490
- if (set.length > 1)
7491
- return true
7492
-
7493
- for (var j = 0; j < set[0].length; j++) {
7494
- if (typeof set[0][j] !== 'string')
7495
- return true
7496
- }
7497
-
7498
- return false
7499
- }
7500
-
7501
- glob.Glob = Glob
7502
- inherits(Glob, EE)
7503
- function Glob (pattern, options, cb) {
7504
- if (typeof options === 'function') {
7505
- cb = options
7506
- options = null
7507
- }
7508
-
7509
- if (options && options.sync) {
7510
- if (cb)
7511
- throw new TypeError('callback provided to sync glob')
7512
- return new GlobSync(pattern, options)
7513
- }
7514
-
7515
- if (!(this instanceof Glob))
7516
- return new Glob(pattern, options, cb)
7517
-
7518
- setopts(this, pattern, options)
7519
- this._didRealPath = false
7520
-
7521
- // process each pattern in the minimatch set
7522
- var n = this.minimatch.set.length
7523
-
7524
- // The matches are stored as {<filename>: true,...} so that
7525
- // duplicates are automagically pruned.
7526
- // Later, we do an Object.keys() on these.
7527
- // Keep them as a list so we can fill in when nonull is set.
7528
- this.matches = new Array(n)
7529
-
7530
- if (typeof cb === 'function') {
7531
- cb = once(cb)
7532
- this.on('error', cb)
7533
- this.on('end', function (matches) {
7534
- cb(null, matches)
7535
- })
7536
- }
7537
-
7538
- var self = this
7539
- this._processing = 0
7540
-
7541
- this._emitQueue = []
7542
- this._processQueue = []
7543
- this.paused = false
7544
-
7545
- if (this.noprocess)
7546
- return this
7547
-
7548
- if (n === 0)
7549
- return done()
7550
-
7551
- var sync = true
7552
- for (var i = 0; i < n; i ++) {
7553
- this._process(this.minimatch.set[i], i, false, done)
7554
- }
7555
- sync = false
7556
-
7557
- function done () {
7558
- --self._processing
7559
- if (self._processing <= 0) {
7560
- if (sync) {
7561
- process.nextTick(function () {
7562
- self._finish()
7563
- })
7564
- } else {
7565
- self._finish()
7566
- }
7567
- }
7568
- }
7569
- }
7570
-
7571
- Glob.prototype._finish = function () {
7572
- assert(this instanceof Glob)
7573
- if (this.aborted)
7574
- return
7575
-
7576
- if (this.realpath && !this._didRealpath)
7577
- return this._realpath()
7578
-
7579
- common.finish(this)
7580
- this.emit('end', this.found)
7581
- }
7582
-
7583
- Glob.prototype._realpath = function () {
7584
- if (this._didRealpath)
7585
- return
7586
-
7587
- this._didRealpath = true
7588
-
7589
- var n = this.matches.length
7590
- if (n === 0)
7591
- return this._finish()
7592
-
7593
- var self = this
7594
- for (var i = 0; i < this.matches.length; i++)
7595
- this._realpathSet(i, next)
7596
-
7597
- function next () {
7598
- if (--n === 0)
7599
- self._finish()
7600
- }
7601
- }
7602
-
7603
- Glob.prototype._realpathSet = function (index, cb) {
7604
- var matchset = this.matches[index]
7605
- if (!matchset)
7606
- return cb()
7607
-
7608
- var found = Object.keys(matchset)
7609
- var self = this
7610
- var n = found.length
7611
-
7612
- if (n === 0)
7613
- return cb()
7614
-
7615
- var set = this.matches[index] = Object.create(null)
7616
- found.forEach(function (p, i) {
7617
- // If there's a problem with the stat, then it means that
7618
- // one or more of the links in the realpath couldn't be
7619
- // resolved. just return the abs value in that case.
7620
- p = self._makeAbs(p)
7621
- rp.realpath(p, self.realpathCache, function (er, real) {
7622
- if (!er)
7623
- set[real] = true
7624
- else if (er.syscall === 'stat')
7625
- set[p] = true
7626
- else
7627
- self.emit('error', er) // srsly wtf right here
7628
-
7629
- if (--n === 0) {
7630
- self.matches[index] = set
7631
- cb()
7632
- }
7633
- })
7634
- })
7635
- }
7636
-
7637
- Glob.prototype._mark = function (p) {
7638
- return common.mark(this, p)
7639
- }
7640
-
7641
- Glob.prototype._makeAbs = function (f) {
7642
- return common.makeAbs(this, f)
7643
- }
7644
-
7645
- Glob.prototype.abort = function () {
7646
- this.aborted = true
7647
- this.emit('abort')
7648
- }
7649
-
7650
- Glob.prototype.pause = function () {
7651
- if (!this.paused) {
7652
- this.paused = true
7653
- this.emit('pause')
7654
- }
7655
- }
7656
-
7657
- Glob.prototype.resume = function () {
7658
- if (this.paused) {
7659
- this.emit('resume')
7660
- this.paused = false
7661
- if (this._emitQueue.length) {
7662
- var eq = this._emitQueue.slice(0)
7663
- this._emitQueue.length = 0
7664
- for (var i = 0; i < eq.length; i ++) {
7665
- var e = eq[i]
7666
- this._emitMatch(e[0], e[1])
7667
- }
7668
- }
7669
- if (this._processQueue.length) {
7670
- var pq = this._processQueue.slice(0)
7671
- this._processQueue.length = 0
7672
- for (var i = 0; i < pq.length; i ++) {
7673
- var p = pq[i]
7674
- this._processing--
7675
- this._process(p[0], p[1], p[2], p[3])
7676
- }
7677
- }
7678
- }
7679
- }
7680
-
7681
- Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
7682
- assert(this instanceof Glob)
7683
- assert(typeof cb === 'function')
7684
-
7685
- if (this.aborted)
7686
- return
7687
-
7688
- this._processing++
7689
- if (this.paused) {
7690
- this._processQueue.push([pattern, index, inGlobStar, cb])
7691
- return
7692
- }
7693
-
7694
- //console.error('PROCESS %d', this._processing, pattern)
7695
-
7696
- // Get the first [n] parts of pattern that are all strings.
7697
- var n = 0
7698
- while (typeof pattern[n] === 'string') {
7699
- n ++
7700
- }
7701
- // now n is the index of the first one that is *not* a string.
7702
-
7703
- // see if there's anything else
7704
- var prefix
7705
- switch (n) {
7706
- // if not, then this is rather simple
7707
- case pattern.length:
7708
- this._processSimple(pattern.join('/'), index, cb)
7709
- return
7710
-
7711
- case 0:
7712
- // pattern *starts* with some non-trivial item.
7713
- // going to readdir(cwd), but not include the prefix in matches.
7714
- prefix = null
7715
- break
7716
-
7717
- default:
7718
- // pattern has some string bits in the front.
7719
- // whatever it starts with, whether that's 'absolute' like /foo/bar,
7720
- // or 'relative' like '../baz'
7721
- prefix = pattern.slice(0, n).join('/')
7722
- break
7723
- }
7724
-
7725
- var remain = pattern.slice(n)
7726
-
7727
- // get the list of entries.
7728
- var read
7729
- if (prefix === null)
7730
- read = '.'
7731
- else if (isAbsolute(prefix) ||
7732
- isAbsolute(pattern.map(function (p) {
7733
- return typeof p === 'string' ? p : '[*]'
7734
- }).join('/'))) {
7735
- if (!prefix || !isAbsolute(prefix))
7736
- prefix = '/' + prefix
7737
- read = prefix
7738
- } else
7739
- read = prefix
7740
-
7741
- var abs = this._makeAbs(read)
7742
-
7743
- //if ignored, skip _processing
7744
- if (childrenIgnored(this, read))
7745
- return cb()
7746
-
7747
- var isGlobStar = remain[0] === minimatch.GLOBSTAR
7748
- if (isGlobStar)
7749
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
7750
- else
7751
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
7752
- }
7753
-
7754
- Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
7755
- var self = this
7756
- this._readdir(abs, inGlobStar, function (er, entries) {
7757
- return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
7758
- })
7759
- }
7760
-
7761
- Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
7762
-
7763
- // if the abs isn't a dir, then nothing can match!
7764
- if (!entries)
7765
- return cb()
7766
-
7767
- // It will only match dot entries if it starts with a dot, or if
7768
- // dot is set. Stuff like @(.foo|.bar) isn't allowed.
7769
- var pn = remain[0]
7770
- var negate = !!this.minimatch.negate
7771
- var rawGlob = pn._glob
7772
- var dotOk = this.dot || rawGlob.charAt(0) === '.'
7773
-
7774
- var matchedEntries = []
7775
- for (var i = 0; i < entries.length; i++) {
7776
- var e = entries[i]
7777
- if (e.charAt(0) !== '.' || dotOk) {
7778
- var m
7779
- if (negate && !prefix) {
7780
- m = !e.match(pn)
7781
- } else {
7782
- m = e.match(pn)
7783
- }
7784
- if (m)
7785
- matchedEntries.push(e)
7786
- }
7787
- }
7788
-
7789
- //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
7790
-
7791
- var len = matchedEntries.length
7792
- // If there are no matched entries, then nothing matches.
7793
- if (len === 0)
7794
- return cb()
7795
-
7796
- // if this is the last remaining pattern bit, then no need for
7797
- // an additional stat *unless* the user has specified mark or
7798
- // stat explicitly. We know they exist, since readdir returned
7799
- // them.
7800
-
7801
- if (remain.length === 1 && !this.mark && !this.stat) {
7802
- if (!this.matches[index])
7803
- this.matches[index] = Object.create(null)
7804
-
7805
- for (var i = 0; i < len; i ++) {
7806
- var e = matchedEntries[i]
7807
- if (prefix) {
7808
- if (prefix !== '/')
7809
- e = prefix + '/' + e
7810
- else
7811
- e = prefix + e
7812
- }
7813
-
7814
- if (e.charAt(0) === '/' && !this.nomount) {
7815
- e = path.join(this.root, e)
7816
- }
7817
- this._emitMatch(index, e)
7818
- }
7819
- // This was the last one, and no stats were needed
7820
- return cb()
7821
- }
7822
-
7823
- // now test all matched entries as stand-ins for that part
7824
- // of the pattern.
7825
- remain.shift()
7826
- for (var i = 0; i < len; i ++) {
7827
- var e = matchedEntries[i]
7828
- var newPattern
7829
- if (prefix) {
7830
- if (prefix !== '/')
7831
- e = prefix + '/' + e
7832
- else
7833
- e = prefix + e
7834
- }
7835
- this._process([e].concat(remain), index, inGlobStar, cb)
7836
- }
7837
- cb()
7838
- }
7839
-
7840
- Glob.prototype._emitMatch = function (index, e) {
7841
- if (this.aborted)
7842
- return
7843
-
7844
- if (isIgnored(this, e))
7845
- return
7846
-
7847
- if (this.paused) {
7848
- this._emitQueue.push([index, e])
7849
- return
7850
- }
7851
-
7852
- var abs = isAbsolute(e) ? e : this._makeAbs(e)
7853
-
7854
- if (this.mark)
7855
- e = this._mark(e)
7856
-
7857
- if (this.absolute)
7858
- e = abs
7859
-
7860
- if (this.matches[index][e])
7861
- return
7862
-
7863
- if (this.nodir) {
7864
- var c = this.cache[abs]
7865
- if (c === 'DIR' || Array.isArray(c))
7866
- return
7867
- }
7868
-
7869
- this.matches[index][e] = true
7870
-
7871
- var st = this.statCache[abs]
7872
- if (st)
7873
- this.emit('stat', e, st)
7874
-
7875
- this.emit('match', e)
7876
- }
7877
-
7878
- Glob.prototype._readdirInGlobStar = function (abs, cb) {
7879
- if (this.aborted)
7880
- return
7881
-
7882
- // follow all symlinked directories forever
7883
- // just proceed as if this is a non-globstar situation
7884
- if (this.follow)
7885
- return this._readdir(abs, false, cb)
7886
-
7887
- var lstatkey = 'lstat\0' + abs
7888
- var self = this
7889
- var lstatcb = inflight(lstatkey, lstatcb_)
7890
-
7891
- if (lstatcb)
7892
- self.fs.lstat(abs, lstatcb)
7893
-
7894
- function lstatcb_ (er, lstat) {
7895
- if (er && er.code === 'ENOENT')
7896
- return cb()
7897
-
7898
- var isSym = lstat && lstat.isSymbolicLink()
7899
- self.symlinks[abs] = isSym
7900
-
7901
- // If it's not a symlink or a dir, then it's definitely a regular file.
7902
- // don't bother doing a readdir in that case.
7903
- if (!isSym && lstat && !lstat.isDirectory()) {
7904
- self.cache[abs] = 'FILE'
7905
- cb()
7906
- } else
7907
- self._readdir(abs, false, cb)
7908
- }
7909
- }
7910
-
7911
- Glob.prototype._readdir = function (abs, inGlobStar, cb) {
7912
- if (this.aborted)
7913
- return
7914
-
7915
- cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
7916
- if (!cb)
7917
- return
7918
-
7919
- //console.error('RD %j %j', +inGlobStar, abs)
7920
- if (inGlobStar && !ownProp(this.symlinks, abs))
7921
- return this._readdirInGlobStar(abs, cb)
7922
-
7923
- if (ownProp(this.cache, abs)) {
7924
- var c = this.cache[abs]
7925
- if (!c || c === 'FILE')
7926
- return cb()
7927
-
7928
- if (Array.isArray(c))
7929
- return cb(null, c)
7930
- }
7931
-
7932
- var self = this
7933
- self.fs.readdir(abs, readdirCb(this, abs, cb))
7934
- }
7935
-
7936
- function readdirCb (self, abs, cb) {
7937
- return function (er, entries) {
7938
- if (er)
7939
- self._readdirError(abs, er, cb)
7940
- else
7941
- self._readdirEntries(abs, entries, cb)
7942
- }
7943
- }
7944
-
7945
- Glob.prototype._readdirEntries = function (abs, entries, cb) {
7946
- if (this.aborted)
7947
- return
7948
-
7949
- // if we haven't asked to stat everything, then just
7950
- // assume that everything in there exists, so we can avoid
7951
- // having to stat it a second time.
7952
- if (!this.mark && !this.stat) {
7953
- for (var i = 0; i < entries.length; i ++) {
7954
- var e = entries[i]
7955
- if (abs === '/')
7956
- e = abs + e
7957
- else
7958
- e = abs + '/' + e
7959
- this.cache[e] = true
7960
- }
7961
- }
7962
-
7963
- this.cache[abs] = entries
7964
- return cb(null, entries)
7965
- }
7966
-
7967
- Glob.prototype._readdirError = function (f, er, cb) {
7968
- if (this.aborted)
7969
- return
7970
-
7971
- // handle errors, and cache the information
7972
- switch (er.code) {
7973
- case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
7974
- case 'ENOTDIR': // totally normal. means it *does* exist.
7975
- var abs = this._makeAbs(f)
7976
- this.cache[abs] = 'FILE'
7977
- if (abs === this.cwdAbs) {
7978
- var error = new Error(er.code + ' invalid cwd ' + this.cwd)
7979
- error.path = this.cwd
7980
- error.code = er.code
7981
- this.emit('error', error)
7982
- this.abort()
7983
- }
7984
- break
7985
-
7986
- case 'ENOENT': // not terribly unusual
7987
- case 'ELOOP':
7988
- case 'ENAMETOOLONG':
7989
- case 'UNKNOWN':
7990
- this.cache[this._makeAbs(f)] = false
7991
- break
7992
-
7993
- default: // some unusual error. Treat as failure.
7994
- this.cache[this._makeAbs(f)] = false
7995
- if (this.strict) {
7996
- this.emit('error', er)
7997
- // If the error is handled, then we abort
7998
- // if not, we threw out of here
7999
- this.abort()
8000
- }
8001
- if (!this.silent)
8002
- console.error('glob error', er)
8003
- break
8004
- }
8005
-
8006
- return cb()
8007
- }
8008
-
8009
- Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
8010
- var self = this
8011
- this._readdir(abs, inGlobStar, function (er, entries) {
8012
- self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
8013
- })
8014
- }
8015
-
8016
-
8017
- Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
8018
- //console.error('pgs2', prefix, remain[0], entries)
8019
-
8020
- // no entries means not a dir, so it can never have matches
8021
- // foo.txt/** doesn't match foo.txt
8022
- if (!entries)
8023
- return cb()
8024
-
8025
- // test without the globstar, and with every child both below
8026
- // and replacing the globstar.
8027
- var remainWithoutGlobStar = remain.slice(1)
8028
- var gspref = prefix ? [ prefix ] : []
8029
- var noGlobStar = gspref.concat(remainWithoutGlobStar)
8030
-
8031
- // the noGlobStar pattern exits the inGlobStar state
8032
- this._process(noGlobStar, index, false, cb)
8033
-
8034
- var isSym = this.symlinks[abs]
8035
- var len = entries.length
8036
-
8037
- // If it's a symlink, and we're in a globstar, then stop
8038
- if (isSym && inGlobStar)
8039
- return cb()
8040
-
8041
- for (var i = 0; i < len; i++) {
8042
- var e = entries[i]
8043
- if (e.charAt(0) === '.' && !this.dot)
8044
- continue
8045
-
8046
- // these two cases enter the inGlobStar state
8047
- var instead = gspref.concat(entries[i], remainWithoutGlobStar)
8048
- this._process(instead, index, true, cb)
8049
-
8050
- var below = gspref.concat(entries[i], remain)
8051
- this._process(below, index, true, cb)
8052
- }
8053
-
8054
- cb()
8055
- }
8056
-
8057
- Glob.prototype._processSimple = function (prefix, index, cb) {
8058
- // XXX review this. Shouldn't it be doing the mounting etc
8059
- // before doing stat? kinda weird?
8060
- var self = this
8061
- this._stat(prefix, function (er, exists) {
8062
- self._processSimple2(prefix, index, er, exists, cb)
8063
- })
8064
- }
8065
- Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
8066
-
8067
- //console.error('ps2', prefix, exists)
8068
-
8069
- if (!this.matches[index])
8070
- this.matches[index] = Object.create(null)
8071
-
8072
- // If it doesn't exist, then just mark the lack of results
8073
- if (!exists)
8074
- return cb()
8075
-
8076
- if (prefix && isAbsolute(prefix) && !this.nomount) {
8077
- var trail = /[\/\\]$/.test(prefix)
8078
- if (prefix.charAt(0) === '/') {
8079
- prefix = path.join(this.root, prefix)
8080
- } else {
8081
- prefix = path.resolve(this.root, prefix)
8082
- if (trail)
8083
- prefix += '/'
8084
- }
8085
- }
8086
-
8087
- if (process.platform === 'win32')
8088
- prefix = prefix.replace(/\\/g, '/')
8089
-
8090
- // Mark this as a match
8091
- this._emitMatch(index, prefix)
8092
- cb()
8093
- }
8094
-
8095
- // Returns either 'DIR', 'FILE', or false
8096
- Glob.prototype._stat = function (f, cb) {
8097
- var abs = this._makeAbs(f)
8098
- var needDir = f.slice(-1) === '/'
8099
-
8100
- if (f.length > this.maxLength)
8101
- return cb()
8102
-
8103
- if (!this.stat && ownProp(this.cache, abs)) {
8104
- var c = this.cache[abs]
8105
-
8106
- if (Array.isArray(c))
8107
- c = 'DIR'
8108
-
8109
- // It exists, but maybe not how we need it
8110
- if (!needDir || c === 'DIR')
8111
- return cb(null, c)
8112
-
8113
- if (needDir && c === 'FILE')
8114
- return cb()
8115
-
8116
- // otherwise we have to stat, because maybe c=true
8117
- // if we know it exists, but not what it is.
8118
- }
8119
-
8120
- var exists
8121
- var stat = this.statCache[abs]
8122
- if (stat !== undefined) {
8123
- if (stat === false)
8124
- return cb(null, stat)
8125
- else {
8126
- var type = stat.isDirectory() ? 'DIR' : 'FILE'
8127
- if (needDir && type === 'FILE')
8128
- return cb()
8129
- else
8130
- return cb(null, type, stat)
8131
- }
8132
- }
8133
-
8134
- var self = this
8135
- var statcb = inflight('stat\0' + abs, lstatcb_)
8136
- if (statcb)
8137
- self.fs.lstat(abs, statcb)
8138
-
8139
- function lstatcb_ (er, lstat) {
8140
- if (lstat && lstat.isSymbolicLink()) {
8141
- // If it's a symlink, then treat it as the target, unless
8142
- // the target does not exist, then treat it as a file.
8143
- return self.fs.stat(abs, function (er, stat) {
8144
- if (er)
8145
- self._stat2(f, abs, null, lstat, cb)
8146
- else
8147
- self._stat2(f, abs, er, stat, cb)
8148
- })
8149
- } else {
8150
- self._stat2(f, abs, er, lstat, cb)
8151
- }
8152
- }
8153
- }
8154
-
8155
- Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
8156
- if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
8157
- this.statCache[abs] = false
8158
- return cb()
8159
- }
8160
-
8161
- var needDir = f.slice(-1) === '/'
8162
- this.statCache[abs] = stat
8163
-
8164
- if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
8165
- return cb(null, false, stat)
8166
-
8167
- var c = true
8168
- if (stat)
8169
- c = stat.isDirectory() ? 'DIR' : 'FILE'
8170
- this.cache[abs] = this.cache[abs] || c
8171
-
8172
- if (needDir && c === 'FILE')
8173
- return cb()
8174
-
8175
- return cb(null, c, stat)
8176
- }
8177
-
8178
-
8179
- /***/ }),
8180
-
8181
- /***/ 5766:
8182
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8183
-
8184
- module.exports = globSync
8185
- globSync.GlobSync = GlobSync
8186
-
8187
- var rp = __webpack_require__(8831)
8188
- var minimatch = __webpack_require__(9064)
8189
- var Minimatch = minimatch.Minimatch
8190
- var Glob = (__webpack_require__(9011).Glob)
8191
- var util = __webpack_require__(9023)
8192
- var path = __webpack_require__(6928)
8193
- var assert = __webpack_require__(2613)
8194
- var isAbsolute = (__webpack_require__(6928).isAbsolute)
8195
- var common = __webpack_require__(3092)
8196
- var setopts = common.setopts
8197
- var ownProp = common.ownProp
8198
- var childrenIgnored = common.childrenIgnored
8199
- var isIgnored = common.isIgnored
8200
-
8201
- function globSync (pattern, options) {
8202
- if (typeof options === 'function' || arguments.length === 3)
8203
- throw new TypeError('callback provided to sync glob\n'+
8204
- 'See: https://github.com/isaacs/node-glob/issues/167')
8205
-
8206
- return new GlobSync(pattern, options).found
8207
- }
8208
-
8209
- function GlobSync (pattern, options) {
8210
- if (!pattern)
8211
- throw new Error('must provide pattern')
8212
-
8213
- if (typeof options === 'function' || arguments.length === 3)
8214
- throw new TypeError('callback provided to sync glob\n'+
8215
- 'See: https://github.com/isaacs/node-glob/issues/167')
8216
-
8217
- if (!(this instanceof GlobSync))
8218
- return new GlobSync(pattern, options)
8219
-
8220
- setopts(this, pattern, options)
8221
-
8222
- if (this.noprocess)
8223
- return this
8224
-
8225
- var n = this.minimatch.set.length
8226
- this.matches = new Array(n)
8227
- for (var i = 0; i < n; i ++) {
8228
- this._process(this.minimatch.set[i], i, false)
8229
- }
8230
- this._finish()
8231
- }
8232
-
8233
- GlobSync.prototype._finish = function () {
8234
- assert.ok(this instanceof GlobSync)
8235
- if (this.realpath) {
8236
- var self = this
8237
- this.matches.forEach(function (matchset, index) {
8238
- var set = self.matches[index] = Object.create(null)
8239
- for (var p in matchset) {
8240
- try {
8241
- p = self._makeAbs(p)
8242
- var real = rp.realpathSync(p, self.realpathCache)
8243
- set[real] = true
8244
- } catch (er) {
8245
- if (er.syscall === 'stat')
8246
- set[self._makeAbs(p)] = true
8247
- else
8248
- throw er
8249
- }
8250
- }
8251
- })
8252
- }
8253
- common.finish(this)
8254
- }
8255
-
8256
-
8257
- GlobSync.prototype._process = function (pattern, index, inGlobStar) {
8258
- assert.ok(this instanceof GlobSync)
8259
-
8260
- // Get the first [n] parts of pattern that are all strings.
8261
- var n = 0
8262
- while (typeof pattern[n] === 'string') {
8263
- n ++
8264
- }
8265
- // now n is the index of the first one that is *not* a string.
8266
-
8267
- // See if there's anything else
8268
- var prefix
8269
- switch (n) {
8270
- // if not, then this is rather simple
8271
- case pattern.length:
8272
- this._processSimple(pattern.join('/'), index)
8273
- return
8274
-
8275
- case 0:
8276
- // pattern *starts* with some non-trivial item.
8277
- // going to readdir(cwd), but not include the prefix in matches.
8278
- prefix = null
8279
- break
8280
-
8281
- default:
8282
- // pattern has some string bits in the front.
8283
- // whatever it starts with, whether that's 'absolute' like /foo/bar,
8284
- // or 'relative' like '../baz'
8285
- prefix = pattern.slice(0, n).join('/')
8286
- break
8287
- }
8288
-
8289
- var remain = pattern.slice(n)
8290
-
8291
- // get the list of entries.
8292
- var read
8293
- if (prefix === null)
8294
- read = '.'
8295
- else if (isAbsolute(prefix) ||
8296
- isAbsolute(pattern.map(function (p) {
8297
- return typeof p === 'string' ? p : '[*]'
8298
- }).join('/'))) {
8299
- if (!prefix || !isAbsolute(prefix))
8300
- prefix = '/' + prefix
8301
- read = prefix
8302
- } else
8303
- read = prefix
8304
-
8305
- var abs = this._makeAbs(read)
8306
-
8307
- //if ignored, skip processing
8308
- if (childrenIgnored(this, read))
8309
- return
8310
-
8311
- var isGlobStar = remain[0] === minimatch.GLOBSTAR
8312
- if (isGlobStar)
8313
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
8314
- else
8315
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
8316
- }
8317
-
8318
-
8319
- GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
8320
- var entries = this._readdir(abs, inGlobStar)
8321
-
8322
- // if the abs isn't a dir, then nothing can match!
8323
- if (!entries)
8324
- return
8325
-
8326
- // It will only match dot entries if it starts with a dot, or if
8327
- // dot is set. Stuff like @(.foo|.bar) isn't allowed.
8328
- var pn = remain[0]
8329
- var negate = !!this.minimatch.negate
8330
- var rawGlob = pn._glob
8331
- var dotOk = this.dot || rawGlob.charAt(0) === '.'
8332
-
8333
- var matchedEntries = []
8334
- for (var i = 0; i < entries.length; i++) {
8335
- var e = entries[i]
8336
- if (e.charAt(0) !== '.' || dotOk) {
8337
- var m
8338
- if (negate && !prefix) {
8339
- m = !e.match(pn)
8340
- } else {
8341
- m = e.match(pn)
8342
- }
8343
- if (m)
8344
- matchedEntries.push(e)
8345
- }
8346
- }
8347
-
8348
- var len = matchedEntries.length
8349
- // If there are no matched entries, then nothing matches.
8350
- if (len === 0)
8351
- return
8352
-
8353
- // if this is the last remaining pattern bit, then no need for
8354
- // an additional stat *unless* the user has specified mark or
8355
- // stat explicitly. We know they exist, since readdir returned
8356
- // them.
8357
-
8358
- if (remain.length === 1 && !this.mark && !this.stat) {
8359
- if (!this.matches[index])
8360
- this.matches[index] = Object.create(null)
8361
-
8362
- for (var i = 0; i < len; i ++) {
8363
- var e = matchedEntries[i]
8364
- if (prefix) {
8365
- if (prefix.slice(-1) !== '/')
8366
- e = prefix + '/' + e
8367
- else
8368
- e = prefix + e
8369
- }
8370
-
8371
- if (e.charAt(0) === '/' && !this.nomount) {
8372
- e = path.join(this.root, e)
8373
- }
8374
- this._emitMatch(index, e)
8375
- }
8376
- // This was the last one, and no stats were needed
8377
- return
8378
- }
8379
-
8380
- // now test all matched entries as stand-ins for that part
8381
- // of the pattern.
8382
- remain.shift()
8383
- for (var i = 0; i < len; i ++) {
8384
- var e = matchedEntries[i]
8385
- var newPattern
8386
- if (prefix)
8387
- newPattern = [prefix, e]
8388
- else
8389
- newPattern = [e]
8390
- this._process(newPattern.concat(remain), index, inGlobStar)
8391
- }
8392
- }
8393
-
8394
-
8395
- GlobSync.prototype._emitMatch = function (index, e) {
8396
- if (isIgnored(this, e))
8397
- return
8398
-
8399
- var abs = this._makeAbs(e)
8400
-
8401
- if (this.mark)
8402
- e = this._mark(e)
8403
-
8404
- if (this.absolute) {
8405
- e = abs
8406
- }
8407
-
8408
- if (this.matches[index][e])
8409
- return
8410
-
8411
- if (this.nodir) {
8412
- var c = this.cache[abs]
8413
- if (c === 'DIR' || Array.isArray(c))
8414
- return
8415
- }
8416
-
8417
- this.matches[index][e] = true
8418
-
8419
- if (this.stat)
8420
- this._stat(e)
8421
- }
8422
-
8423
-
8424
- GlobSync.prototype._readdirInGlobStar = function (abs) {
8425
- // follow all symlinked directories forever
8426
- // just proceed as if this is a non-globstar situation
8427
- if (this.follow)
8428
- return this._readdir(abs, false)
8429
-
8430
- var entries
8431
- var lstat
8432
- var stat
8433
- try {
8434
- lstat = this.fs.lstatSync(abs)
8435
- } catch (er) {
8436
- if (er.code === 'ENOENT') {
8437
- // lstat failed, doesn't exist
8438
- return null
8439
- }
8440
- }
8441
-
8442
- var isSym = lstat && lstat.isSymbolicLink()
8443
- this.symlinks[abs] = isSym
8444
-
8445
- // If it's not a symlink or a dir, then it's definitely a regular file.
8446
- // don't bother doing a readdir in that case.
8447
- if (!isSym && lstat && !lstat.isDirectory())
8448
- this.cache[abs] = 'FILE'
8449
- else
8450
- entries = this._readdir(abs, false)
8451
-
8452
- return entries
8453
- }
8454
-
8455
- GlobSync.prototype._readdir = function (abs, inGlobStar) {
8456
- var entries
8457
-
8458
- if (inGlobStar && !ownProp(this.symlinks, abs))
8459
- return this._readdirInGlobStar(abs)
8460
-
8461
- if (ownProp(this.cache, abs)) {
8462
- var c = this.cache[abs]
8463
- if (!c || c === 'FILE')
8464
- return null
8465
-
8466
- if (Array.isArray(c))
8467
- return c
8468
- }
8469
-
8470
- try {
8471
- return this._readdirEntries(abs, this.fs.readdirSync(abs))
8472
- } catch (er) {
8473
- this._readdirError(abs, er)
8474
- return null
8475
- }
8476
- }
8477
-
8478
- GlobSync.prototype._readdirEntries = function (abs, entries) {
8479
- // if we haven't asked to stat everything, then just
8480
- // assume that everything in there exists, so we can avoid
8481
- // having to stat it a second time.
8482
- if (!this.mark && !this.stat) {
8483
- for (var i = 0; i < entries.length; i ++) {
8484
- var e = entries[i]
8485
- if (abs === '/')
8486
- e = abs + e
8487
- else
8488
- e = abs + '/' + e
8489
- this.cache[e] = true
8490
- }
8491
- }
8492
-
8493
- this.cache[abs] = entries
8494
-
8495
- // mark and cache dir-ness
8496
- return entries
8497
- }
8498
-
8499
- GlobSync.prototype._readdirError = function (f, er) {
8500
- // handle errors, and cache the information
8501
- switch (er.code) {
8502
- case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
8503
- case 'ENOTDIR': // totally normal. means it *does* exist.
8504
- var abs = this._makeAbs(f)
8505
- this.cache[abs] = 'FILE'
8506
- if (abs === this.cwdAbs) {
8507
- var error = new Error(er.code + ' invalid cwd ' + this.cwd)
8508
- error.path = this.cwd
8509
- error.code = er.code
8510
- throw error
8511
- }
8512
- break
8513
-
8514
- case 'ENOENT': // not terribly unusual
8515
- case 'ELOOP':
8516
- case 'ENAMETOOLONG':
8517
- case 'UNKNOWN':
8518
- this.cache[this._makeAbs(f)] = false
8519
- break
8520
-
8521
- default: // some unusual error. Treat as failure.
8522
- this.cache[this._makeAbs(f)] = false
8523
- if (this.strict)
8524
- throw er
8525
- if (!this.silent)
8526
- console.error('glob error', er)
8527
- break
8528
- }
8529
- }
8530
-
8531
- GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
8532
-
8533
- var entries = this._readdir(abs, inGlobStar)
8534
-
8535
- // no entries means not a dir, so it can never have matches
8536
- // foo.txt/** doesn't match foo.txt
8537
- if (!entries)
8538
- return
8539
-
8540
- // test without the globstar, and with every child both below
8541
- // and replacing the globstar.
8542
- var remainWithoutGlobStar = remain.slice(1)
8543
- var gspref = prefix ? [ prefix ] : []
8544
- var noGlobStar = gspref.concat(remainWithoutGlobStar)
8545
-
8546
- // the noGlobStar pattern exits the inGlobStar state
8547
- this._process(noGlobStar, index, false)
8548
-
8549
- var len = entries.length
8550
- var isSym = this.symlinks[abs]
8551
-
8552
- // If it's a symlink, and we're in a globstar, then stop
8553
- if (isSym && inGlobStar)
8554
- return
8555
-
8556
- for (var i = 0; i < len; i++) {
8557
- var e = entries[i]
8558
- if (e.charAt(0) === '.' && !this.dot)
8559
- continue
8560
-
8561
- // these two cases enter the inGlobStar state
8562
- var instead = gspref.concat(entries[i], remainWithoutGlobStar)
8563
- this._process(instead, index, true)
8564
-
8565
- var below = gspref.concat(entries[i], remain)
8566
- this._process(below, index, true)
8567
- }
8568
- }
8569
-
8570
- GlobSync.prototype._processSimple = function (prefix, index) {
8571
- // XXX review this. Shouldn't it be doing the mounting etc
8572
- // before doing stat? kinda weird?
8573
- var exists = this._stat(prefix)
8574
-
8575
- if (!this.matches[index])
8576
- this.matches[index] = Object.create(null)
8577
-
8578
- // If it doesn't exist, then just mark the lack of results
8579
- if (!exists)
8580
- return
8581
-
8582
- if (prefix && isAbsolute(prefix) && !this.nomount) {
8583
- var trail = /[\/\\]$/.test(prefix)
8584
- if (prefix.charAt(0) === '/') {
8585
- prefix = path.join(this.root, prefix)
8586
- } else {
8587
- prefix = path.resolve(this.root, prefix)
8588
- if (trail)
8589
- prefix += '/'
8590
- }
8591
- }
8592
-
8593
- if (process.platform === 'win32')
8594
- prefix = prefix.replace(/\\/g, '/')
8595
-
8596
- // Mark this as a match
8597
- this._emitMatch(index, prefix)
8598
- }
8599
-
8600
- // Returns either 'DIR', 'FILE', or false
8601
- GlobSync.prototype._stat = function (f) {
8602
- var abs = this._makeAbs(f)
8603
- var needDir = f.slice(-1) === '/'
8604
-
8605
- if (f.length > this.maxLength)
8606
- return false
8607
-
8608
- if (!this.stat && ownProp(this.cache, abs)) {
8609
- var c = this.cache[abs]
8610
-
8611
- if (Array.isArray(c))
8612
- c = 'DIR'
8613
-
8614
- // It exists, but maybe not how we need it
8615
- if (!needDir || c === 'DIR')
8616
- return c
8617
-
8618
- if (needDir && c === 'FILE')
8619
- return false
8620
-
8621
- // otherwise we have to stat, because maybe c=true
8622
- // if we know it exists, but not what it is.
8623
- }
8624
-
8625
- var exists
8626
- var stat = this.statCache[abs]
8627
- if (!stat) {
8628
- var lstat
8629
- try {
8630
- lstat = this.fs.lstatSync(abs)
8631
- } catch (er) {
8632
- if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
8633
- this.statCache[abs] = false
8634
- return false
8635
- }
8636
- }
8637
-
8638
- if (lstat && lstat.isSymbolicLink()) {
8639
- try {
8640
- stat = this.fs.statSync(abs)
8641
- } catch (er) {
8642
- stat = lstat
8643
- }
8644
- } else {
8645
- stat = lstat
8646
- }
8647
- }
8648
-
8649
- this.statCache[abs] = stat
8650
-
8651
- var c = true
8652
- if (stat)
8653
- c = stat.isDirectory() ? 'DIR' : 'FILE'
8654
-
8655
- this.cache[abs] = this.cache[abs] || c
8656
-
8657
- if (needDir && c === 'FILE')
8658
- return false
8659
-
8660
- return c
8661
- }
8662
-
8663
- GlobSync.prototype._mark = function (p) {
8664
- return common.mark(this, p)
8665
- }
8666
-
8667
- GlobSync.prototype._makeAbs = function (f) {
8668
- return common.makeAbs(this, f)
8669
- }
8670
-
8671
-
8672
7330
  /***/ }),
8673
7331
 
8674
7332
  /***/ 910:
@@ -11450,67 +10108,6 @@ IconvLiteDecoderStream.prototype.collect = function(cb) {
11450
10108
 
11451
10109
 
11452
10110
 
11453
- /***/ }),
11454
-
11455
- /***/ 7794:
11456
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11457
-
11458
- var wrappy = __webpack_require__(4008)
11459
- var reqs = Object.create(null)
11460
- var once = __webpack_require__(7992)
11461
-
11462
- module.exports = wrappy(inflight)
11463
-
11464
- function inflight (key, cb) {
11465
- if (reqs[key]) {
11466
- reqs[key].push(cb)
11467
- return null
11468
- } else {
11469
- reqs[key] = [cb]
11470
- return makeres(key)
11471
- }
11472
- }
11473
-
11474
- function makeres (key) {
11475
- return once(function RES () {
11476
- var cbs = reqs[key]
11477
- var len = cbs.length
11478
- var args = slice(arguments)
11479
-
11480
- // XXX It's somewhat ambiguous whether a new callback added in this
11481
- // pass should be queued for later execution if something in the
11482
- // list of callbacks throws, or if it should just be discarded.
11483
- // However, it's such an edge case that it hardly matters, and either
11484
- // choice is likely as surprising as the other.
11485
- // As it happens, we do go ahead and schedule it for later execution.
11486
- try {
11487
- for (var i = 0; i < len; i++) {
11488
- cbs[i].apply(null, args)
11489
- }
11490
- } finally {
11491
- if (cbs.length > len) {
11492
- // added more in the interim.
11493
- // de-zalgo, just in case, but don't call again.
11494
- cbs.splice(0, len)
11495
- process.nextTick(function () {
11496
- RES.apply(null, args)
11497
- })
11498
- } else {
11499
- delete reqs[key]
11500
- }
11501
- }
11502
- })
11503
- }
11504
-
11505
- function slice (args) {
11506
- var length = args.length
11507
- var array = []
11508
-
11509
- for (var i = 0; i < length; i++) array[i] = args[i]
11510
- return array
11511
- }
11512
-
11513
-
11514
10111
  /***/ }),
11515
10112
 
11516
10113
  /***/ 2666:
@@ -11800,968 +10397,6 @@ module.exports = mimicFn;
11800
10397
  module.exports["default"] = mimicFn;
11801
10398
 
11802
10399
 
11803
- /***/ }),
11804
-
11805
- /***/ 285:
11806
- /***/ ((module) => {
11807
-
11808
- const isWindows = typeof process === 'object' &&
11809
- process &&
11810
- process.platform === 'win32'
11811
- module.exports = isWindows ? { sep: '\\' } : { sep: '/' }
11812
-
11813
-
11814
- /***/ }),
11815
-
11816
- /***/ 9064:
11817
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11818
-
11819
- const minimatch = module.exports = (p, pattern, options = {}) => {
11820
- assertValidPattern(pattern)
11821
-
11822
- // shortcut: comments match nothing.
11823
- if (!options.nocomment && pattern.charAt(0) === '#') {
11824
- return false
11825
- }
11826
-
11827
- return new Minimatch(pattern, options).match(p)
11828
- }
11829
-
11830
- module.exports = minimatch
11831
-
11832
- const path = __webpack_require__(285)
11833
- minimatch.sep = path.sep
11834
-
11835
- const GLOBSTAR = Symbol('globstar **')
11836
- minimatch.GLOBSTAR = GLOBSTAR
11837
- const expand = __webpack_require__(4807)
11838
-
11839
- const plTypes = {
11840
- '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
11841
- '?': { open: '(?:', close: ')?' },
11842
- '+': { open: '(?:', close: ')+' },
11843
- '*': { open: '(?:', close: ')*' },
11844
- '@': { open: '(?:', close: ')' }
11845
- }
11846
-
11847
- // any single thing other than /
11848
- // don't need to escape / when using new RegExp()
11849
- const qmark = '[^/]'
11850
-
11851
- // * => any number of characters
11852
- const star = qmark + '*?'
11853
-
11854
- // ** when dots are allowed. Anything goes, except .. and .
11855
- // not (^ or / followed by one or two dots followed by $ or /),
11856
- // followed by anything, any number of times.
11857
- const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
11858
-
11859
- // not a ^ or / followed by a dot,
11860
- // followed by anything, any number of times.
11861
- const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
11862
-
11863
- // "abc" -> { a:true, b:true, c:true }
11864
- const charSet = s => s.split('').reduce((set, c) => {
11865
- set[c] = true
11866
- return set
11867
- }, {})
11868
-
11869
- // characters that need to be escaped in RegExp.
11870
- const reSpecials = charSet('().*{}+?[]^$\\!')
11871
-
11872
- // characters that indicate we have to add the pattern start
11873
- const addPatternStartSet = charSet('[.(')
11874
-
11875
- // normalizes slashes.
11876
- const slashSplit = /\/+/
11877
-
11878
- minimatch.filter = (pattern, options = {}) =>
11879
- (p, i, list) => minimatch(p, pattern, options)
11880
-
11881
- const ext = (a, b = {}) => {
11882
- const t = {}
11883
- Object.keys(a).forEach(k => t[k] = a[k])
11884
- Object.keys(b).forEach(k => t[k] = b[k])
11885
- return t
11886
- }
11887
-
11888
- minimatch.defaults = def => {
11889
- if (!def || typeof def !== 'object' || !Object.keys(def).length) {
11890
- return minimatch
11891
- }
11892
-
11893
- const orig = minimatch
11894
-
11895
- const m = (p, pattern, options) => orig(p, pattern, ext(def, options))
11896
- m.Minimatch = class Minimatch extends orig.Minimatch {
11897
- constructor (pattern, options) {
11898
- super(pattern, ext(def, options))
11899
- }
11900
- }
11901
- m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch
11902
- m.filter = (pattern, options) => orig.filter(pattern, ext(def, options))
11903
- m.defaults = options => orig.defaults(ext(def, options))
11904
- m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options))
11905
- m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options))
11906
- m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options))
11907
-
11908
- return m
11909
- }
11910
-
11911
-
11912
-
11913
-
11914
-
11915
- // Brace expansion:
11916
- // a{b,c}d -> abd acd
11917
- // a{b,}c -> abc ac
11918
- // a{0..3}d -> a0d a1d a2d a3d
11919
- // a{b,c{d,e}f}g -> abg acdfg acefg
11920
- // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
11921
- //
11922
- // Invalid sets are not expanded.
11923
- // a{2..}b -> a{2..}b
11924
- // a{b}c -> a{b}c
11925
- minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options)
11926
-
11927
- const braceExpand = (pattern, options = {}) => {
11928
- assertValidPattern(pattern)
11929
-
11930
- // Thanks to Yeting Li <https://github.com/yetingli> for
11931
- // improving this regexp to avoid a ReDOS vulnerability.
11932
- if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
11933
- // shortcut. no need to expand.
11934
- return [pattern]
11935
- }
11936
-
11937
- return expand(pattern)
11938
- }
11939
-
11940
- const MAX_PATTERN_LENGTH = 1024 * 64
11941
- const assertValidPattern = pattern => {
11942
- if (typeof pattern !== 'string') {
11943
- throw new TypeError('invalid pattern')
11944
- }
11945
-
11946
- if (pattern.length > MAX_PATTERN_LENGTH) {
11947
- throw new TypeError('pattern is too long')
11948
- }
11949
- }
11950
-
11951
- // parse a component of the expanded set.
11952
- // At this point, no pattern may contain "/" in it
11953
- // so we're going to return a 2d array, where each entry is the full
11954
- // pattern, split on '/', and then turned into a regular expression.
11955
- // A regexp is made at the end which joins each array with an
11956
- // escaped /, and another full one which joins each regexp with |.
11957
- //
11958
- // Following the lead of Bash 4.1, note that "**" only has special meaning
11959
- // when it is the *only* thing in a path portion. Otherwise, any series
11960
- // of * is equivalent to a single *. Globstar behavior is enabled by
11961
- // default, and can be disabled by setting options.noglobstar.
11962
- const SUBPARSE = Symbol('subparse')
11963
-
11964
- minimatch.makeRe = (pattern, options) =>
11965
- new Minimatch(pattern, options || {}).makeRe()
11966
-
11967
- minimatch.match = (list, pattern, options = {}) => {
11968
- const mm = new Minimatch(pattern, options)
11969
- list = list.filter(f => mm.match(f))
11970
- if (mm.options.nonull && !list.length) {
11971
- list.push(pattern)
11972
- }
11973
- return list
11974
- }
11975
-
11976
- // replace stuff like \* with *
11977
- const globUnescape = s => s.replace(/\\(.)/g, '$1')
11978
- const charUnescape = s => s.replace(/\\([^-\]])/g, '$1')
11979
- const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
11980
- const braExpEscape = s => s.replace(/[[\]\\]/g, '\\$&')
11981
-
11982
- class Minimatch {
11983
- constructor (pattern, options) {
11984
- assertValidPattern(pattern)
11985
-
11986
- if (!options) options = {}
11987
-
11988
- this.options = options
11989
- this.set = []
11990
- this.pattern = pattern
11991
- this.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||
11992
- options.allowWindowsEscape === false
11993
- if (this.windowsPathsNoEscape) {
11994
- this.pattern = this.pattern.replace(/\\/g, '/')
11995
- }
11996
- this.regexp = null
11997
- this.negate = false
11998
- this.comment = false
11999
- this.empty = false
12000
- this.partial = !!options.partial
12001
-
12002
- // make the set of regexps etc.
12003
- this.make()
12004
- }
12005
-
12006
- debug () {}
12007
-
12008
- make () {
12009
- const pattern = this.pattern
12010
- const options = this.options
12011
-
12012
- // empty patterns and comments match nothing.
12013
- if (!options.nocomment && pattern.charAt(0) === '#') {
12014
- this.comment = true
12015
- return
12016
- }
12017
- if (!pattern) {
12018
- this.empty = true
12019
- return
12020
- }
12021
-
12022
- // step 1: figure out negation, etc.
12023
- this.parseNegate()
12024
-
12025
- // step 2: expand braces
12026
- let set = this.globSet = this.braceExpand()
12027
-
12028
- if (options.debug) this.debug = (...args) => console.error(...args)
12029
-
12030
- this.debug(this.pattern, set)
12031
-
12032
- // step 3: now we have a set, so turn each one into a series of path-portion
12033
- // matching patterns.
12034
- // These will be regexps, except in the case of "**", which is
12035
- // set to the GLOBSTAR object for globstar behavior,
12036
- // and will not contain any / characters
12037
- set = this.globParts = set.map(s => s.split(slashSplit))
12038
-
12039
- this.debug(this.pattern, set)
12040
-
12041
- // glob --> regexps
12042
- set = set.map((s, si, set) => s.map(this.parse, this))
12043
-
12044
- this.debug(this.pattern, set)
12045
-
12046
- // filter out everything that didn't compile properly.
12047
- set = set.filter(s => s.indexOf(false) === -1)
12048
-
12049
- this.debug(this.pattern, set)
12050
-
12051
- this.set = set
12052
- }
12053
-
12054
- parseNegate () {
12055
- if (this.options.nonegate) return
12056
-
12057
- const pattern = this.pattern
12058
- let negate = false
12059
- let negateOffset = 0
12060
-
12061
- for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
12062
- negate = !negate
12063
- negateOffset++
12064
- }
12065
-
12066
- if (negateOffset) this.pattern = pattern.slice(negateOffset)
12067
- this.negate = negate
12068
- }
12069
-
12070
- // set partial to true to test if, for example,
12071
- // "/a/b" matches the start of "/*/b/*/d"
12072
- // Partial means, if you run out of file before you run
12073
- // out of pattern, then that's fine, as long as all
12074
- // the parts match.
12075
- matchOne (file, pattern, partial) {
12076
- var options = this.options
12077
-
12078
- this.debug('matchOne',
12079
- { 'this': this, file: file, pattern: pattern })
12080
-
12081
- this.debug('matchOne', file.length, pattern.length)
12082
-
12083
- for (var fi = 0,
12084
- pi = 0,
12085
- fl = file.length,
12086
- pl = pattern.length
12087
- ; (fi < fl) && (pi < pl)
12088
- ; fi++, pi++) {
12089
- this.debug('matchOne loop')
12090
- var p = pattern[pi]
12091
- var f = file[fi]
12092
-
12093
- this.debug(pattern, p, f)
12094
-
12095
- // should be impossible.
12096
- // some invalid regexp stuff in the set.
12097
- /* istanbul ignore if */
12098
- if (p === false) return false
12099
-
12100
- if (p === GLOBSTAR) {
12101
- this.debug('GLOBSTAR', [pattern, p, f])
12102
-
12103
- // "**"
12104
- // a/**/b/**/c would match the following:
12105
- // a/b/x/y/z/c
12106
- // a/x/y/z/b/c
12107
- // a/b/x/b/x/c
12108
- // a/b/c
12109
- // To do this, take the rest of the pattern after
12110
- // the **, and see if it would match the file remainder.
12111
- // If so, return success.
12112
- // If not, the ** "swallows" a segment, and try again.
12113
- // This is recursively awful.
12114
- //
12115
- // a/**/b/**/c matching a/b/x/y/z/c
12116
- // - a matches a
12117
- // - doublestar
12118
- // - matchOne(b/x/y/z/c, b/**/c)
12119
- // - b matches b
12120
- // - doublestar
12121
- // - matchOne(x/y/z/c, c) -> no
12122
- // - matchOne(y/z/c, c) -> no
12123
- // - matchOne(z/c, c) -> no
12124
- // - matchOne(c, c) yes, hit
12125
- var fr = fi
12126
- var pr = pi + 1
12127
- if (pr === pl) {
12128
- this.debug('** at the end')
12129
- // a ** at the end will just swallow the rest.
12130
- // We have found a match.
12131
- // however, it will not swallow /.x, unless
12132
- // options.dot is set.
12133
- // . and .. are *never* matched by **, for explosively
12134
- // exponential reasons.
12135
- for (; fi < fl; fi++) {
12136
- if (file[fi] === '.' || file[fi] === '..' ||
12137
- (!options.dot && file[fi].charAt(0) === '.')) return false
12138
- }
12139
- return true
12140
- }
12141
-
12142
- // ok, let's see if we can swallow whatever we can.
12143
- while (fr < fl) {
12144
- var swallowee = file[fr]
12145
-
12146
- this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
12147
-
12148
- // XXX remove this slice. Just pass the start index.
12149
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
12150
- this.debug('globstar found match!', fr, fl, swallowee)
12151
- // found a match.
12152
- return true
12153
- } else {
12154
- // can't swallow "." or ".." ever.
12155
- // can only swallow ".foo" when explicitly asked.
12156
- if (swallowee === '.' || swallowee === '..' ||
12157
- (!options.dot && swallowee.charAt(0) === '.')) {
12158
- this.debug('dot detected!', file, fr, pattern, pr)
12159
- break
12160
- }
12161
-
12162
- // ** swallows a segment, and continue.
12163
- this.debug('globstar swallow a segment, and continue')
12164
- fr++
12165
- }
12166
- }
12167
-
12168
- // no match was found.
12169
- // However, in partial mode, we can't say this is necessarily over.
12170
- // If there's more *pattern* left, then
12171
- /* istanbul ignore if */
12172
- if (partial) {
12173
- // ran out of file
12174
- this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
12175
- if (fr === fl) return true
12176
- }
12177
- return false
12178
- }
12179
-
12180
- // something other than **
12181
- // non-magic patterns just have to match exactly
12182
- // patterns with magic have been turned into regexps.
12183
- var hit
12184
- if (typeof p === 'string') {
12185
- hit = f === p
12186
- this.debug('string match', p, f, hit)
12187
- } else {
12188
- hit = f.match(p)
12189
- this.debug('pattern match', p, f, hit)
12190
- }
12191
-
12192
- if (!hit) return false
12193
- }
12194
-
12195
- // Note: ending in / means that we'll get a final ""
12196
- // at the end of the pattern. This can only match a
12197
- // corresponding "" at the end of the file.
12198
- // If the file ends in /, then it can only match a
12199
- // a pattern that ends in /, unless the pattern just
12200
- // doesn't have any more for it. But, a/b/ should *not*
12201
- // match "a/b/*", even though "" matches against the
12202
- // [^/]*? pattern, except in partial mode, where it might
12203
- // simply not be reached yet.
12204
- // However, a/b/ should still satisfy a/*
12205
-
12206
- // now either we fell off the end of the pattern, or we're done.
12207
- if (fi === fl && pi === pl) {
12208
- // ran out of pattern and filename at the same time.
12209
- // an exact hit!
12210
- return true
12211
- } else if (fi === fl) {
12212
- // ran out of file, but still had pattern left.
12213
- // this is ok if we're doing the match as part of
12214
- // a glob fs traversal.
12215
- return partial
12216
- } else /* istanbul ignore else */ if (pi === pl) {
12217
- // ran out of pattern, still have file left.
12218
- // this is only acceptable if we're on the very last
12219
- // empty segment of a file with a trailing slash.
12220
- // a/* should match a/b/
12221
- return (fi === fl - 1) && (file[fi] === '')
12222
- }
12223
-
12224
- // should be unreachable.
12225
- /* istanbul ignore next */
12226
- throw new Error('wtf?')
12227
- }
12228
-
12229
- braceExpand () {
12230
- return braceExpand(this.pattern, this.options)
12231
- }
12232
-
12233
- parse (pattern, isSub) {
12234
- assertValidPattern(pattern)
12235
-
12236
- const options = this.options
12237
-
12238
- // shortcuts
12239
- if (pattern === '**') {
12240
- if (!options.noglobstar)
12241
- return GLOBSTAR
12242
- else
12243
- pattern = '*'
12244
- }
12245
- if (pattern === '') return ''
12246
-
12247
- let re = ''
12248
- let hasMagic = false
12249
- let escaping = false
12250
- // ? => one single character
12251
- const patternListStack = []
12252
- const negativeLists = []
12253
- let stateChar
12254
- let inClass = false
12255
- let reClassStart = -1
12256
- let classStart = -1
12257
- let cs
12258
- let pl
12259
- let sp
12260
- // . and .. never match anything that doesn't start with .,
12261
- // even when options.dot is set. However, if the pattern
12262
- // starts with ., then traversal patterns can match.
12263
- let dotTravAllowed = pattern.charAt(0) === '.'
12264
- let dotFileAllowed = options.dot || dotTravAllowed
12265
- const patternStart = () =>
12266
- dotTravAllowed
12267
- ? ''
12268
- : dotFileAllowed
12269
- ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
12270
- : '(?!\\.)'
12271
- const subPatternStart = (p) =>
12272
- p.charAt(0) === '.'
12273
- ? ''
12274
- : options.dot
12275
- ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
12276
- : '(?!\\.)'
12277
-
12278
-
12279
- const clearStateChar = () => {
12280
- if (stateChar) {
12281
- // we had some state-tracking character
12282
- // that wasn't consumed by this pass.
12283
- switch (stateChar) {
12284
- case '*':
12285
- re += star
12286
- hasMagic = true
12287
- break
12288
- case '?':
12289
- re += qmark
12290
- hasMagic = true
12291
- break
12292
- default:
12293
- re += '\\' + stateChar
12294
- break
12295
- }
12296
- this.debug('clearStateChar %j %j', stateChar, re)
12297
- stateChar = false
12298
- }
12299
- }
12300
-
12301
- for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) {
12302
- this.debug('%s\t%s %s %j', pattern, i, re, c)
12303
-
12304
- // skip over any that are escaped.
12305
- if (escaping) {
12306
- /* istanbul ignore next - completely not allowed, even escaped. */
12307
- if (c === '/') {
12308
- return false
12309
- }
12310
-
12311
- if (reSpecials[c]) {
12312
- re += '\\'
12313
- }
12314
- re += c
12315
- escaping = false
12316
- continue
12317
- }
12318
-
12319
- switch (c) {
12320
- /* istanbul ignore next */
12321
- case '/': {
12322
- // Should already be path-split by now.
12323
- return false
12324
- }
12325
-
12326
- case '\\':
12327
- if (inClass && pattern.charAt(i + 1) === '-') {
12328
- re += c
12329
- continue
12330
- }
12331
-
12332
- clearStateChar()
12333
- escaping = true
12334
- continue
12335
-
12336
- // the various stateChar values
12337
- // for the "extglob" stuff.
12338
- case '?':
12339
- case '*':
12340
- case '+':
12341
- case '@':
12342
- case '!':
12343
- this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
12344
-
12345
- // all of those are literals inside a class, except that
12346
- // the glob [!a] means [^a] in regexp
12347
- if (inClass) {
12348
- this.debug(' in class')
12349
- if (c === '!' && i === classStart + 1) c = '^'
12350
- re += c
12351
- continue
12352
- }
12353
-
12354
- // if we already have a stateChar, then it means
12355
- // that there was something like ** or +? in there.
12356
- // Handle the stateChar, then proceed with this one.
12357
- this.debug('call clearStateChar %j', stateChar)
12358
- clearStateChar()
12359
- stateChar = c
12360
- // if extglob is disabled, then +(asdf|foo) isn't a thing.
12361
- // just clear the statechar *now*, rather than even diving into
12362
- // the patternList stuff.
12363
- if (options.noext) clearStateChar()
12364
- continue
12365
-
12366
- case '(': {
12367
- if (inClass) {
12368
- re += '('
12369
- continue
12370
- }
12371
-
12372
- if (!stateChar) {
12373
- re += '\\('
12374
- continue
12375
- }
12376
-
12377
- const plEntry = {
12378
- type: stateChar,
12379
- start: i - 1,
12380
- reStart: re.length,
12381
- open: plTypes[stateChar].open,
12382
- close: plTypes[stateChar].close,
12383
- }
12384
- this.debug(this.pattern, '\t', plEntry)
12385
- patternListStack.push(plEntry)
12386
- // negation is (?:(?!(?:js)(?:<rest>))[^/]*)
12387
- re += plEntry.open
12388
- // next entry starts with a dot maybe?
12389
- if (plEntry.start === 0 && plEntry.type !== '!') {
12390
- dotTravAllowed = true
12391
- re += subPatternStart(pattern.slice(i + 1))
12392
- }
12393
- this.debug('plType %j %j', stateChar, re)
12394
- stateChar = false
12395
- continue
12396
- }
12397
-
12398
- case ')': {
12399
- const plEntry = patternListStack[patternListStack.length - 1]
12400
- if (inClass || !plEntry) {
12401
- re += '\\)'
12402
- continue
12403
- }
12404
- patternListStack.pop()
12405
-
12406
- // closing an extglob
12407
- clearStateChar()
12408
- hasMagic = true
12409
- pl = plEntry
12410
- // negation is (?:(?!js)[^/]*)
12411
- // The others are (?:<pattern>)<type>
12412
- re += pl.close
12413
- if (pl.type === '!') {
12414
- negativeLists.push(Object.assign(pl, { reEnd: re.length }))
12415
- }
12416
- continue
12417
- }
12418
-
12419
- case '|': {
12420
- const plEntry = patternListStack[patternListStack.length - 1]
12421
- if (inClass || !plEntry) {
12422
- re += '\\|'
12423
- continue
12424
- }
12425
-
12426
- clearStateChar()
12427
- re += '|'
12428
- // next subpattern can start with a dot?
12429
- if (plEntry.start === 0 && plEntry.type !== '!') {
12430
- dotTravAllowed = true
12431
- re += subPatternStart(pattern.slice(i + 1))
12432
- }
12433
- continue
12434
- }
12435
-
12436
- // these are mostly the same in regexp and glob
12437
- case '[':
12438
- // swallow any state-tracking char before the [
12439
- clearStateChar()
12440
-
12441
- if (inClass) {
12442
- re += '\\' + c
12443
- continue
12444
- }
12445
-
12446
- inClass = true
12447
- classStart = i
12448
- reClassStart = re.length
12449
- re += c
12450
- continue
12451
-
12452
- case ']':
12453
- // a right bracket shall lose its special
12454
- // meaning and represent itself in
12455
- // a bracket expression if it occurs
12456
- // first in the list. -- POSIX.2 2.8.3.2
12457
- if (i === classStart + 1 || !inClass) {
12458
- re += '\\' + c
12459
- continue
12460
- }
12461
-
12462
- // split where the last [ was, make sure we don't have
12463
- // an invalid re. if so, re-walk the contents of the
12464
- // would-be class to re-translate any characters that
12465
- // were passed through as-is
12466
- // TODO: It would probably be faster to determine this
12467
- // without a try/catch and a new RegExp, but it's tricky
12468
- // to do safely. For now, this is safe and works.
12469
- cs = pattern.substring(classStart + 1, i)
12470
- try {
12471
- RegExp('[' + braExpEscape(charUnescape(cs)) + ']')
12472
- // looks good, finish up the class.
12473
- re += c
12474
- } catch (er) {
12475
- // out of order ranges in JS are errors, but in glob syntax,
12476
- // they're just a range that matches nothing.
12477
- re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever
12478
- }
12479
- hasMagic = true
12480
- inClass = false
12481
- continue
12482
-
12483
- default:
12484
- // swallow any state char that wasn't consumed
12485
- clearStateChar()
12486
-
12487
- if (reSpecials[c] && !(c === '^' && inClass)) {
12488
- re += '\\'
12489
- }
12490
-
12491
- re += c
12492
- break
12493
-
12494
- } // switch
12495
- } // for
12496
-
12497
- // handle the case where we left a class open.
12498
- // "[abc" is valid, equivalent to "\[abc"
12499
- if (inClass) {
12500
- // split where the last [ was, and escape it
12501
- // this is a huge pita. We now have to re-walk
12502
- // the contents of the would-be class to re-translate
12503
- // any characters that were passed through as-is
12504
- cs = pattern.slice(classStart + 1)
12505
- sp = this.parse(cs, SUBPARSE)
12506
- re = re.substring(0, reClassStart) + '\\[' + sp[0]
12507
- hasMagic = hasMagic || sp[1]
12508
- }
12509
-
12510
- // handle the case where we had a +( thing at the *end*
12511
- // of the pattern.
12512
- // each pattern list stack adds 3 chars, and we need to go through
12513
- // and escape any | chars that were passed through as-is for the regexp.
12514
- // Go through and escape them, taking care not to double-escape any
12515
- // | chars that were already escaped.
12516
- for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
12517
- let tail
12518
- tail = re.slice(pl.reStart + pl.open.length)
12519
- this.debug('setting tail', re, pl)
12520
- // maybe some even number of \, then maybe 1 \, followed by a |
12521
- tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
12522
- /* istanbul ignore else - should already be done */
12523
- if (!$2) {
12524
- // the | isn't already escaped, so escape it.
12525
- $2 = '\\'
12526
- }
12527
-
12528
- // need to escape all those slashes *again*, without escaping the
12529
- // one that we need for escaping the | character. As it works out,
12530
- // escaping an even number of slashes can be done by simply repeating
12531
- // it exactly after itself. That's why this trick works.
12532
- //
12533
- // I am sorry that you have to see this.
12534
- return $1 + $1 + $2 + '|'
12535
- })
12536
-
12537
- this.debug('tail=%j\n %s', tail, tail, pl, re)
12538
- const t = pl.type === '*' ? star
12539
- : pl.type === '?' ? qmark
12540
- : '\\' + pl.type
12541
-
12542
- hasMagic = true
12543
- re = re.slice(0, pl.reStart) + t + '\\(' + tail
12544
- }
12545
-
12546
- // handle trailing things that only matter at the very end.
12547
- clearStateChar()
12548
- if (escaping) {
12549
- // trailing \\
12550
- re += '\\\\'
12551
- }
12552
-
12553
- // only need to apply the nodot start if the re starts with
12554
- // something that could conceivably capture a dot
12555
- const addPatternStart = addPatternStartSet[re.charAt(0)]
12556
-
12557
- // Hack to work around lack of negative lookbehind in JS
12558
- // A pattern like: *.!(x).!(y|z) needs to ensure that a name
12559
- // like 'a.xyz.yz' doesn't match. So, the first negative
12560
- // lookahead, has to look ALL the way ahead, to the end of
12561
- // the pattern.
12562
- for (let n = negativeLists.length - 1; n > -1; n--) {
12563
- const nl = negativeLists[n]
12564
-
12565
- const nlBefore = re.slice(0, nl.reStart)
12566
- const nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
12567
- let nlAfter = re.slice(nl.reEnd)
12568
- const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter
12569
-
12570
- // Handle nested stuff like *(*.js|!(*.json)), where open parens
12571
- // mean that we should *not* include the ) in the bit that is considered
12572
- // "after" the negated section.
12573
- const closeParensBefore = nlBefore.split(')').length
12574
- const openParensBefore = nlBefore.split('(').length - closeParensBefore
12575
- let cleanAfter = nlAfter
12576
- for (let i = 0; i < openParensBefore; i++) {
12577
- cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
12578
- }
12579
- nlAfter = cleanAfter
12580
-
12581
- const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\/)' : ''
12582
-
12583
- re = nlBefore + nlFirst + nlAfter + dollar + nlLast
12584
- }
12585
-
12586
- // if the re is not "" at this point, then we need to make sure
12587
- // it doesn't match against an empty path part.
12588
- // Otherwise a/* will match a/, which it should not.
12589
- if (re !== '' && hasMagic) {
12590
- re = '(?=.)' + re
12591
- }
12592
-
12593
- if (addPatternStart) {
12594
- re = patternStart() + re
12595
- }
12596
-
12597
- // parsing just a piece of a larger pattern.
12598
- if (isSub === SUBPARSE) {
12599
- return [re, hasMagic]
12600
- }
12601
-
12602
- // if it's nocase, and the lcase/uppercase don't match, it's magic
12603
- if (options.nocase && !hasMagic) {
12604
- hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()
12605
- }
12606
-
12607
- // skip the regexp for non-magical patterns
12608
- // unescape anything in it, though, so that it'll be
12609
- // an exact match against a file etc.
12610
- if (!hasMagic) {
12611
- return globUnescape(pattern)
12612
- }
12613
-
12614
- const flags = options.nocase ? 'i' : ''
12615
- try {
12616
- return Object.assign(new RegExp('^' + re + '$', flags), {
12617
- _glob: pattern,
12618
- _src: re,
12619
- })
12620
- } catch (er) /* istanbul ignore next - should be impossible */ {
12621
- // If it was an invalid regular expression, then it can't match
12622
- // anything. This trick looks for a character after the end of
12623
- // the string, which is of course impossible, except in multi-line
12624
- // mode, but it's not a /m regex.
12625
- return new RegExp('$.')
12626
- }
12627
- }
12628
-
12629
- makeRe () {
12630
- if (this.regexp || this.regexp === false) return this.regexp
12631
-
12632
- // at this point, this.set is a 2d array of partial
12633
- // pattern strings, or "**".
12634
- //
12635
- // It's better to use .match(). This function shouldn't
12636
- // be used, really, but it's pretty convenient sometimes,
12637
- // when you just want to work with a regex.
12638
- const set = this.set
12639
-
12640
- if (!set.length) {
12641
- this.regexp = false
12642
- return this.regexp
12643
- }
12644
- const options = this.options
12645
-
12646
- const twoStar = options.noglobstar ? star
12647
- : options.dot ? twoStarDot
12648
- : twoStarNoDot
12649
- const flags = options.nocase ? 'i' : ''
12650
-
12651
- // coalesce globstars and regexpify non-globstar patterns
12652
- // if it's the only item, then we just do one twoStar
12653
- // if it's the first, and there are more, prepend (\/|twoStar\/)? to next
12654
- // if it's the last, append (\/twoStar|) to previous
12655
- // if it's in the middle, append (\/|\/twoStar\/) to previous
12656
- // then filter out GLOBSTAR symbols
12657
- let re = set.map(pattern => {
12658
- pattern = pattern.map(p =>
12659
- typeof p === 'string' ? regExpEscape(p)
12660
- : p === GLOBSTAR ? GLOBSTAR
12661
- : p._src
12662
- ).reduce((set, p) => {
12663
- if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
12664
- set.push(p)
12665
- }
12666
- return set
12667
- }, [])
12668
- pattern.forEach((p, i) => {
12669
- if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) {
12670
- return
12671
- }
12672
- if (i === 0) {
12673
- if (pattern.length > 1) {
12674
- pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1]
12675
- } else {
12676
- pattern[i] = twoStar
12677
- }
12678
- } else if (i === pattern.length - 1) {
12679
- pattern[i-1] += '(?:\\\/|' + twoStar + ')?'
12680
- } else {
12681
- pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1]
12682
- pattern[i+1] = GLOBSTAR
12683
- }
12684
- })
12685
- return pattern.filter(p => p !== GLOBSTAR).join('/')
12686
- }).join('|')
12687
-
12688
- // must match entire pattern
12689
- // ending in a * or ** will make it less strict.
12690
- re = '^(?:' + re + ')$'
12691
-
12692
- // can match anything, as long as it's not this.
12693
- if (this.negate) re = '^(?!' + re + ').*$'
12694
-
12695
- try {
12696
- this.regexp = new RegExp(re, flags)
12697
- } catch (ex) /* istanbul ignore next - should be impossible */ {
12698
- this.regexp = false
12699
- }
12700
- return this.regexp
12701
- }
12702
-
12703
- match (f, partial = this.partial) {
12704
- this.debug('match', f, this.pattern)
12705
- // short-circuit in the case of busted things.
12706
- // comments, etc.
12707
- if (this.comment) return false
12708
- if (this.empty) return f === ''
12709
-
12710
- if (f === '/' && partial) return true
12711
-
12712
- const options = this.options
12713
-
12714
- // windows: need to use /, not \
12715
- if (path.sep !== '/') {
12716
- f = f.split(path.sep).join('/')
12717
- }
12718
-
12719
- // treat the test path as a set of pathparts.
12720
- f = f.split(slashSplit)
12721
- this.debug(this.pattern, 'split', f)
12722
-
12723
- // just ONE of the pattern sets in this.set needs to match
12724
- // in order for it to be valid. If negating, then just one
12725
- // match means that we have failed.
12726
- // Either way, return on the first hit.
12727
-
12728
- const set = this.set
12729
- this.debug(this.pattern, 'set', set)
12730
-
12731
- // Find the basename of the path by looking for the last non-empty segment
12732
- let filename
12733
- for (let i = f.length - 1; i >= 0; i--) {
12734
- filename = f[i]
12735
- if (filename) break
12736
- }
12737
-
12738
- for (let i = 0; i < set.length; i++) {
12739
- const pattern = set[i]
12740
- let file = f
12741
- if (options.matchBase && pattern.length === 1) {
12742
- file = [filename]
12743
- }
12744
- const hit = this.matchOne(file, pattern, partial)
12745
- if (hit) {
12746
- if (options.flipNegate) return true
12747
- return !this.negate
12748
- }
12749
- }
12750
-
12751
- // didn't get any hits. this is success if it's a negative
12752
- // pattern, failure otherwise.
12753
- if (options.flipNegate) return false
12754
- return this.negate
12755
- }
12756
-
12757
- static defaults (def) {
12758
- return minimatch.defaults(def).Minimatch
12759
- }
12760
- }
12761
-
12762
- minimatch.Minimatch = Minimatch
12763
-
12764
-
12765
10400
  /***/ }),
12766
10401
 
12767
10402
  /***/ 7231:
@@ -12934,55 +10569,6 @@ if (!globalThis.DOMException) {
12934
10569
  module.exports = globalThis.DOMException
12935
10570
 
12936
10571
 
12937
- /***/ }),
12938
-
12939
- /***/ 7992:
12940
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12941
-
12942
- var wrappy = __webpack_require__(4008)
12943
- module.exports = wrappy(once)
12944
- module.exports.strict = wrappy(onceStrict)
12945
-
12946
- once.proto = once(function () {
12947
- Object.defineProperty(Function.prototype, 'once', {
12948
- value: function () {
12949
- return once(this)
12950
- },
12951
- configurable: true
12952
- })
12953
-
12954
- Object.defineProperty(Function.prototype, 'onceStrict', {
12955
- value: function () {
12956
- return onceStrict(this)
12957
- },
12958
- configurable: true
12959
- })
12960
- })
12961
-
12962
- function once (fn) {
12963
- var f = function () {
12964
- if (f.called) return f.value
12965
- f.called = true
12966
- return f.value = fn.apply(this, arguments)
12967
- }
12968
- f.called = false
12969
- return f
12970
- }
12971
-
12972
- function onceStrict (fn) {
12973
- var f = function () {
12974
- if (f.called)
12975
- throw new Error(f.onceError)
12976
- f.called = true
12977
- return f.value = fn.apply(this, arguments)
12978
- }
12979
- var name = fn.name || 'Function wrapped with `once`'
12980
- f.onceError = name + " shouldn't be called more than once"
12981
- f.called = false
12982
- return f
12983
- }
12984
-
12985
-
12986
10572
  /***/ }),
12987
10573
 
12988
10574
  /***/ 7862:
@@ -41843,46 +39429,6 @@ module.exports = (string, columns, options) => {
41843
39429
  };
41844
39430
 
41845
39431
 
41846
- /***/ }),
41847
-
41848
- /***/ 4008:
41849
- /***/ ((module) => {
41850
-
41851
- // Returns a wrapper function that returns a wrapped callback
41852
- // The wrapper function should do some stuff, and return a
41853
- // presumably different callback function.
41854
- // This makes sure that own properties are retained, so that
41855
- // decorations and such are not lost along the way.
41856
- module.exports = wrappy
41857
- function wrappy (fn, cb) {
41858
- if (fn && cb) return wrappy(fn)(cb)
41859
-
41860
- if (typeof fn !== 'function')
41861
- throw new TypeError('need wrapper function')
41862
-
41863
- Object.keys(fn).forEach(function (k) {
41864
- wrapper[k] = fn[k]
41865
- })
41866
-
41867
- return wrapper
41868
-
41869
- function wrapper() {
41870
- var args = new Array(arguments.length)
41871
- for (var i = 0; i < args.length; i++) {
41872
- args[i] = arguments[i]
41873
- }
41874
- var ret = fn.apply(this, args)
41875
- var cb = args[args.length-1]
41876
- if (typeof ret === 'function' && ret !== cb) {
41877
- Object.keys(cb).forEach(function (k) {
41878
- ret[k] = cb[k]
41879
- })
41880
- }
41881
- return ret
41882
- }
41883
- }
41884
-
41885
-
41886
39432
  /***/ }),
41887
39433
 
41888
39434
  /***/ 6507:
@@ -84034,7 +81580,7 @@ var dist_cjs = __webpack_require__(4579);
84034
81580
  var is_module = __webpack_require__(1421);
84035
81581
  // EXTERNAL MODULE: external "util"
84036
81582
  var external_util_ = __webpack_require__(9023);
84037
- ;// ../../node_modules/.pnpm/@rollup+plugin-node-resolve@15.3.0_rollup@3.29.5/node_modules/@rollup/plugin-node-resolve/dist/es/index.js
81583
+ ;// ../../node_modules/.pnpm/@rollup+plugin-node-resolve@16.0.0_rollup@3.29.5/node_modules/@rollup/plugin-node-resolve/dist/es/index.js
84038
81584
 
84039
81585
 
84040
81586
 
@@ -84045,7 +81591,7 @@ var external_util_ = __webpack_require__(9023);
84045
81591
 
84046
81592
 
84047
81593
 
84048
- var version = "15.3.0";
81594
+ var version = "16.0.0";
84049
81595
  var peerDependencies = {
84050
81596
  rollup: "^2.78.0||^3.0.0||^4.0.0"
84051
81597
  };
@@ -85100,8 +82646,17 @@ function nodeResolve(opts = {}) {
85100
82646
 
85101
82647
  const options = { ...defaults, ...opts };
85102
82648
  const { extensions, jail, moduleDirectories, modulePaths, ignoreSideEffectsForRoot } = options;
85103
- const conditionsEsm = [...baseConditionsEsm, ...(options.exportConditions || [])];
85104
- const conditionsCjs = [...baseConditionsCjs, ...(options.exportConditions || [])];
82649
+ const exportConditions = options.exportConditions || [];
82650
+ const devProdCondition =
82651
+ exportConditions.includes('development') || exportConditions.includes('production')
82652
+ ? []
82653
+ : [
82654
+ false
82655
+ ? 0
82656
+ : 'production'
82657
+ ];
82658
+ const conditionsEsm = [...baseConditionsEsm, ...exportConditions, ...devProdCondition];
82659
+ const conditionsCjs = [...baseConditionsCjs, ...exportConditions, ...devProdCondition];
85105
82660
  const packageInfoCache = new Map();
85106
82661
  const idToPackageInfo = new Map();
85107
82662
  const mainFields = getMainFields(options);
@@ -85219,7 +82774,6 @@ function nodeResolve(opts = {}) {
85219
82774
  const warn = (...args) => context.warn(...args);
85220
82775
  const isRequire = custom && custom['node-resolve'] && custom['node-resolve'].isRequire;
85221
82776
  const exportConditions = isRequire ? conditionsCjs : conditionsEsm;
85222
-
85223
82777
  if (useBrowserOverrides && !exportConditions.includes('browser'))
85224
82778
  exportConditions.push('browser');
85225
82779
 
@@ -85340,7 +82894,7 @@ function nodeResolve(opts = {}) {
85340
82894
  return importee;
85341
82895
  }
85342
82896
  // ignore IDs with null character, these belong to other plugins
85343
- if (/\0/.test(importee)) return null;
82897
+ if (importee && importee.includes('\0')) return null;
85344
82898
 
85345
82899
  const { custom = {} } = resolveOptions;
85346
82900
  const { 'node-resolve': { resolved: alreadyResolved } = {} } = custom;
@@ -85348,7 +82902,7 @@ function nodeResolve(opts = {}) {
85348
82902
  return alreadyResolved;
85349
82903
  }
85350
82904
 
85351
- if (/\0/.test(importer)) {
82905
+ if (importer && importer.includes('\0')) {
85352
82906
  importer = undefined;
85353
82907
  }
85354
82908
 
@@ -85400,8 +82954,8 @@ function nodeResolve(opts = {}) {
85400
82954
 
85401
82955
  // EXTERNAL MODULE: ../../node_modules/.pnpm/commondir@1.0.1/node_modules/commondir/index.js
85402
82956
  var commondir = __webpack_require__(4462);
85403
- // EXTERNAL MODULE: ../../node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js
85404
- var glob = __webpack_require__(9011);
82957
+ // EXTERNAL MODULE: ../../node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/index.js
82958
+ var fdir_dist = __webpack_require__(4294);
85405
82959
  ;// ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
85406
82960
  const comma = ','.charCodeAt(0);
85407
82961
  const semicolon = ';'.charCodeAt(0);
@@ -87412,7 +84966,7 @@ function isReference(node, parent) {
87412
84966
 
87413
84967
  /* harmony default export */ const is_reference_es = (isReference);
87414
84968
 
87415
- ;// ../../node_modules/.pnpm/@rollup+plugin-commonjs@25.0.8_rollup@3.29.5/node_modules/@rollup/plugin-commonjs/dist/es/index.js
84969
+ ;// ../../node_modules/.pnpm/@rollup+plugin-commonjs@28.0.2_rollup@3.29.5/node_modules/@rollup/plugin-commonjs/dist/es/index.js
87416
84970
 
87417
84971
 
87418
84972
 
@@ -87422,7 +84976,7 @@ function isReference(node, parent) {
87422
84976
 
87423
84977
 
87424
84978
 
87425
- var es_version = "25.0.8";
84979
+ var es_version = "28.0.2";
87426
84980
  var es_peerDependencies = {
87427
84981
  rollup: "^2.68.0||^3.0.0||^4.0.0"
87428
84982
  };
@@ -87534,10 +85088,10 @@ function capitalize(name) {
87534
85088
 
87535
85089
  function getStrictRequiresFilter({ strictRequires }) {
87536
85090
  switch (strictRequires) {
87537
- case true:
87538
- return { strictRequiresFilter: () => true, detectCyclesAndConditional: false };
87539
85091
  // eslint-disable-next-line no-undefined
87540
85092
  case undefined:
85093
+ case true:
85094
+ return { strictRequiresFilter: () => true, detectCyclesAndConditional: false };
87541
85095
  case 'auto':
87542
85096
  case 'debug':
87543
85097
  case null:
@@ -87589,7 +85143,14 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
87589
85143
  isNegated
87590
85144
  ? dynamicRequireModules.delete(targetPath)
87591
85145
  : dynamicRequireModules.set(targetPath, resolvedPath);
87592
- for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {
85146
+ // eslint-disable-next-line new-cap
85147
+ for (const path of new fdir_dist.fdir()
85148
+ .withBasePath()
85149
+ .withDirs()
85150
+ .glob(isNegated ? pattern.substr(1) : pattern)
85151
+ .crawl()
85152
+ .sync()
85153
+ .sort((a, b) => a.localeCompare(b, 'en'))) {
87593
85154
  const resolvedPath = (0,external_path_.resolve)(path);
87594
85155
  const requirePath = normalizePathSlashes(resolvedPath);
87595
85156
  if (isDirectory(resolvedPath)) {
@@ -87740,12 +85301,19 @@ const isWrappedId = (id, suffix) => id.endsWith(suffix);
87740
85301
  const wrapId = (id, suffix) => `\0${id}${suffix}`;
87741
85302
  const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);
87742
85303
 
85304
+ // A proxy module when a module is required from non-wrapped CommonJS. Is different for ESM and CommonJS requires.
87743
85305
  const PROXY_SUFFIX = '?commonjs-proxy';
85306
+ // Indicates that a required module is wrapped commonjs and needs special handling.
87744
85307
  const WRAPPED_SUFFIX = '?commonjs-wrapped';
85308
+ // Indicates that a required module is external
87745
85309
  const EXTERNAL_SUFFIX = '?commonjs-external';
85310
+ // A helper module that contains the exports object of a module
87746
85311
  const EXPORTS_SUFFIX = '?commonjs-exports';
85312
+ // A helper module that contains the module object of a module, e.g. when module.exports is reassigned
87747
85313
  const MODULE_SUFFIX = '?commonjs-module';
85314
+ // A special proxy for CommonJS entry points
87748
85315
  const ENTRY_SUFFIX = '?commonjs-entry';
85316
+ // A proxy when wrapped ESM is required from CommonJS
87749
85317
  const ES_IMPORT_SUFFIX = '?commonjs-es-import';
87750
85318
 
87751
85319
  const DYNAMIC_MODULES_ID = '\0commonjs-dynamic-modules';
@@ -87858,26 +85426,28 @@ function getEntryProxy(id, defaultIsModuleExports, getModuleInfo, shebang) {
87858
85426
  }
87859
85427
  return shebang + code;
87860
85428
  }
87861
- const result = getEsImportProxy(id, defaultIsModuleExports);
85429
+ const result = getEsImportProxy(id, defaultIsModuleExports, true);
87862
85430
  return {
87863
85431
  ...result,
87864
85432
  code: shebang + result.code
87865
85433
  };
87866
85434
  }
87867
85435
 
87868
- function getEsImportProxy(id, defaultIsModuleExports) {
85436
+ function getEsImportProxy(id, defaultIsModuleExports, moduleSideEffects) {
87869
85437
  const name = getName(id);
87870
85438
  const exportsName = `${name}Exports`;
87871
85439
  const requireModule = `require${capitalize(name)}`;
87872
85440
  let code =
87873
85441
  `import { getDefaultExportFromCjs } from "${HELPERS_ID}";\n` +
87874
85442
  `import { __require as ${requireModule} } from ${JSON.stringify(id)};\n` +
87875
- `var ${exportsName} = ${requireModule}();\n` +
85443
+ `var ${exportsName} = ${moduleSideEffects ? '' : '/*@__PURE__*/ '}${requireModule}();\n` +
87876
85444
  `export { ${exportsName} as __moduleExports };`;
87877
85445
  if (defaultIsModuleExports === true) {
87878
85446
  code += `\nexport { ${exportsName} as default };`;
85447
+ } else if (defaultIsModuleExports === false) {
85448
+ code += `\nexport default ${exportsName}.default;`;
87879
85449
  } else {
87880
- code += `export default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`;
85450
+ code += `\nexport default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`;
87881
85451
  }
87882
85452
  return {
87883
85453
  code,
@@ -87932,11 +85502,7 @@ function getResolveId(extensions, isPossibleCjsId) {
87932
85502
  // All logic below is specific to ES imports.
87933
85503
  // Also, if we do not skip this logic for requires that are resolved while
87934
85504
  // transforming a commonjs file, it can easily lead to deadlocks.
87935
- if (
87936
- customOptions &&
87937
- customOptions['node-resolve'] &&
87938
- customOptions['node-resolve'].isRequire
87939
- ) {
85505
+ if (customOptions?.['node-resolve']?.isRequire) {
87940
85506
  return null;
87941
85507
  }
87942
85508
  const currentlyResolvingForParent = currentlyResolving.get(importer);
@@ -88220,13 +85786,14 @@ function getRequireResolver(extensions, detectCyclesAndConditional, currentlyRes
88220
85786
  // eslint-disable-next-line no-multi-assign
88221
85787
  const isCommonJS = (parentMeta.isRequiredCommonJS[dependencyId] =
88222
85788
  getTypeForFullyAnalyzedModule(dependencyId));
85789
+ const isWrappedCommonJS = isCommonJS === IS_WRAPPED_COMMONJS;
88223
85790
  fullyAnalyzedModules[dependencyId] = true;
88224
85791
  return {
85792
+ wrappedModuleSideEffects:
85793
+ isWrappedCommonJS && rollupContext.getModuleInfo(dependencyId).moduleSideEffects,
88225
85794
  source: sources[index].source,
88226
85795
  id: allowProxy
88227
- ? isCommonJS === IS_WRAPPED_COMMONJS
88228
- ? wrapId(dependencyId, WRAPPED_SUFFIX)
88229
- : wrapId(dependencyId, PROXY_SUFFIX)
85796
+ ? wrapId(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX)
88230
85797
  : dependencyId,
88231
85798
  isCommonJS
88232
85799
  };
@@ -88814,7 +86381,7 @@ function processRequireExpressions(
88814
86381
  magicString
88815
86382
  ) {
88816
86383
  const generateRequireName = getGenerateRequireName();
88817
- for (const { source, id: resolvedId, isCommonJS } of requireTargets) {
86384
+ for (const { source, id: resolvedId, isCommonJS, wrappedModuleSideEffects } of requireTargets) {
88818
86385
  const requires = requiresBySource[source];
88819
86386
  const name = generateRequireName(requires);
88820
86387
  let usesRequired = false;
@@ -88833,7 +86400,11 @@ function processRequireExpressions(
88833
86400
  } else if (canConvertRequire) {
88834
86401
  needsImport = true;
88835
86402
  if (isCommonJS === IS_WRAPPED_COMMONJS) {
88836
- magicString.overwrite(node.start, node.end, `${name}()`);
86403
+ magicString.overwrite(
86404
+ node.start,
86405
+ node.end,
86406
+ `${wrappedModuleSideEffects ? '' : '/*@__PURE__*/ '}${name}()`
86407
+ );
88837
86408
  } else if (usesReturnValue) {
88838
86409
  usesRequired = true;
88839
86410
  magicString.overwrite(node.start, node.end, name);
@@ -88940,6 +86511,7 @@ async function transformCommonjs(
88940
86511
  const topLevelAssignments = new Set();
88941
86512
  const topLevelDefineCompiledEsmExpressions = [];
88942
86513
  const replacedGlobal = [];
86514
+ const replacedThis = [];
88943
86515
  const replacedDynamicRequires = [];
88944
86516
  const importedVariables = new Set();
88945
86517
  const indentExclusionRanges = [];
@@ -89207,7 +86779,7 @@ async function transformCommonjs(
89207
86779
  if (lexicalDepth === 0 && !classBodyDepth) {
89208
86780
  uses.global = true;
89209
86781
  if (!ignoreGlobal) {
89210
- replacedGlobal.push(node);
86782
+ replacedThis.push(node);
89211
86783
  }
89212
86784
  }
89213
86785
  return;
@@ -89282,6 +86854,11 @@ async function transformCommonjs(
89282
86854
  storeName: true
89283
86855
  });
89284
86856
  }
86857
+ for (const node of replacedThis) {
86858
+ magicString.overwrite(node.start, node.end, exportsName, {
86859
+ storeName: true
86860
+ });
86861
+ }
89285
86862
  for (const node of replacedDynamicRequires) {
89286
86863
  magicString.overwrite(
89287
86864
  node.start,
@@ -89628,7 +87205,7 @@ function commonjs(options = {}) {
89628
87205
  }
89629
87206
  },
89630
87207
 
89631
- load(id) {
87208
+ async load(id) {
89632
87209
  if (id === HELPERS_ID) {
89633
87210
  return getHelpersModule();
89634
87211
  }
@@ -89674,7 +87251,11 @@ function commonjs(options = {}) {
89674
87251
 
89675
87252
  if (isWrappedId(id, ES_IMPORT_SUFFIX)) {
89676
87253
  const actualId = unwrapId(id, ES_IMPORT_SUFFIX);
89677
- return getEsImportProxy(actualId, getDefaultIsModuleExports(actualId));
87254
+ return getEsImportProxy(
87255
+ actualId,
87256
+ getDefaultIsModuleExports(actualId),
87257
+ (await this.load({ id: actualId })).moduleSideEffects
87258
+ );
89678
87259
  }
89679
87260
 
89680
87261
  if (id === DYNAMIC_MODULES_ID) {
@@ -89810,21 +87391,24 @@ function _build() {
89810
87391
  }
89811
87392
  _context2.prev = 9;
89812
87393
  _context2.next = 12;
89813
- return buildFiles(projectDir);
87394
+ return buildFiles(projectDir, "functions");
89814
87395
  case 12:
89815
- _context2.next = 17;
89816
- break;
87396
+ _context2.next = 14;
87397
+ return buildFiles(projectDir, "profiles");
89817
87398
  case 14:
89818
- _context2.prev = 14;
87399
+ _context2.next = 19;
87400
+ break;
87401
+ case 16:
87402
+ _context2.prev = 16;
89819
87403
  _context2.t0 = _context2["catch"](9);
89820
87404
  throw new Error("Some of the functions failed to compile. See details above. Last error: ".concat(_context2.t0.message || "unknown"));
89821
- case 17:
87405
+ case 19:
89822
87406
  console.log("".concat(chalk_code_highlight_b("Build finished.")));
89823
- case 18:
87407
+ case 20:
89824
87408
  case "end":
89825
87409
  return _context2.stop();
89826
87410
  }
89827
- }, _callee2, null, [[9, 14]]);
87411
+ }, _callee2, null, [[9, 16]]);
89828
87412
  }));
89829
87413
  return _build.apply(this, arguments);
89830
87414
  }
@@ -89876,78 +87460,85 @@ function _buildFiles() {
89876
87460
  dir = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : "";
89877
87461
  lastError = undefined;
89878
87462
  srcDir = external_path_default().resolve(projectDir, "src", dir);
87463
+ if ((0,external_fs_.existsSync)(srcDir)) {
87464
+ _context3.next = 6;
87465
+ break;
87466
+ }
87467
+ console.info("".concat(chalk_code_highlight_b(dir), " directory not found in ").concat(chalk_code_highlight_b(external_path_default().resolve(projectDir, "src"))));
87468
+ return _context3.abrupt("return");
87469
+ case 6:
89879
87470
  files = (0,external_fs_.readdirSync)(srcDir);
89880
87471
  if (!(files.length === 0)) {
89881
- _context3.next = 7;
87472
+ _context3.next = 10;
89882
87473
  break;
89883
87474
  }
89884
87475
  console.warn("No functions found in ".concat(chalk_code_highlight_b(srcDir), " directory"));
89885
87476
  return _context3.abrupt("return");
89886
- case 7:
87477
+ case 10:
89887
87478
  _iterator = build_createForOfIteratorHelper(files);
89888
- _context3.prev = 8;
87479
+ _context3.prev = 11;
89889
87480
  _iterator.s();
89890
- case 10:
87481
+ case 13:
89891
87482
  if ((_step = _iterator.n()).done) {
89892
- _context3.next = 33;
87483
+ _context3.next = 36;
89893
87484
  break;
89894
87485
  }
89895
87486
  file = _step.value;
89896
87487
  if (!(0,external_fs_.lstatSync)(external_path_default().resolve(srcDir, file)).isDirectory()) {
89897
- _context3.next = 22;
87488
+ _context3.next = 25;
89898
87489
  break;
89899
87490
  }
89900
- _context3.prev = 13;
89901
- _context3.next = 16;
87491
+ _context3.prev = 16;
87492
+ _context3.next = 19;
89902
87493
  return buildFiles(projectDir, external_path_default().join(dir, file));
89903
- case 16:
89904
- _context3.next = 21;
87494
+ case 19:
87495
+ _context3.next = 24;
89905
87496
  break;
89906
- case 18:
89907
- _context3.prev = 18;
89908
- _context3.t0 = _context3["catch"](13);
89909
- lastError = _context3.t0;
89910
87497
  case 21:
89911
- return _context3.abrupt("continue", 31);
89912
- case 22:
89913
- _context3.prev = 22;
89914
- _context3.next = 25;
89915
- return buildFile(projectDir, dir, file);
87498
+ _context3.prev = 21;
87499
+ _context3.t0 = _context3["catch"](16);
87500
+ lastError = _context3.t0;
87501
+ case 24:
87502
+ return _context3.abrupt("continue", 34);
89916
87503
  case 25:
89917
- _context3.next = 31;
87504
+ _context3.prev = 25;
87505
+ _context3.next = 28;
87506
+ return buildFile(projectDir, dir, file);
87507
+ case 28:
87508
+ _context3.next = 34;
89918
87509
  break;
89919
- case 27:
89920
- _context3.prev = 27;
89921
- _context3.t1 = _context3["catch"](22);
87510
+ case 30:
87511
+ _context3.prev = 30;
87512
+ _context3.t1 = _context3["catch"](25);
89922
87513
  console.error(["".concat(red("\u26A0"), " Function ").concat(chalk_code_highlight_b(file), " failed to compile: ").concat(red(_context3.t1 === null || _context3.t1 === void 0 ? void 0 : _context3.t1.message), ". See details below")].concat(build_toConsumableArray(((_context3.t1 === null || _context3.t1 === void 0 || (_e$stack = _context3.t1.stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")) || []).map(function (s) {
89923
87514
  return " ".concat(s);
89924
87515
  }))).filter(Boolean).join("\n"));
89925
87516
  lastError = _context3.t1;
89926
- case 31:
89927
- _context3.next = 10;
87517
+ case 34:
87518
+ _context3.next = 13;
89928
87519
  break;
89929
- case 33:
89930
- _context3.next = 38;
87520
+ case 36:
87521
+ _context3.next = 41;
89931
87522
  break;
89932
- case 35:
89933
- _context3.prev = 35;
89934
- _context3.t2 = _context3["catch"](8);
89935
- _iterator.e(_context3.t2);
89936
87523
  case 38:
89937
87524
  _context3.prev = 38;
89938
- _iterator.f();
89939
- return _context3.finish(38);
87525
+ _context3.t2 = _context3["catch"](11);
87526
+ _iterator.e(_context3.t2);
89940
87527
  case 41:
87528
+ _context3.prev = 41;
87529
+ _iterator.f();
87530
+ return _context3.finish(41);
87531
+ case 44:
89941
87532
  if (!lastError) {
89942
- _context3.next = 43;
87533
+ _context3.next = 46;
89943
87534
  break;
89944
87535
  }
89945
87536
  throw lastError;
89946
- case 43:
87537
+ case 46:
89947
87538
  case "end":
89948
87539
  return _context3.stop();
89949
87540
  }
89950
- }, _callee3, null, [[8, 35, 38, 41], [13, 18], [22, 27]]);
87541
+ }, _callee3, null, [[11, 38, 41, 44], [16, 21], [25, 30]]);
89951
87542
  }));
89952
87543
  return _buildFiles.apply(this, arguments);
89953
87544
  }