@forsakringskassan/vite-lib-config 5.14.1 → 5.15.1
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/api-extractor.mjs +141 -3123
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/vite.config.cjs +285 -3264
- package/dist/vite.config.mjs +283 -3262
- package/package.json +2 -2
package/dist/api-extractor.mjs
CHANGED
|
@@ -404,8 +404,8 @@ var require_ci_info = __commonJS({
|
|
|
404
404
|
var vendors = require_vendors();
|
|
405
405
|
var env = process.env;
|
|
406
406
|
Object.defineProperty(exports, "_vendors", {
|
|
407
|
-
value: vendors.map(function(
|
|
408
|
-
return
|
|
407
|
+
value: vendors.map(function(v) {
|
|
408
|
+
return v.constant;
|
|
409
409
|
})
|
|
410
410
|
});
|
|
411
411
|
exports.name = null;
|
|
@@ -443,12 +443,12 @@ var require_ci_info = __commonJS({
|
|
|
443
443
|
return env[obj.env] && env[obj.env].includes(obj.includes);
|
|
444
444
|
}
|
|
445
445
|
if ("any" in obj) {
|
|
446
|
-
return obj.any.some(function(
|
|
447
|
-
return !!env[
|
|
446
|
+
return obj.any.some(function(k) {
|
|
447
|
+
return !!env[k];
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
|
-
return Object.keys(obj).every(function(
|
|
451
|
-
return env[
|
|
450
|
+
return Object.keys(obj).every(function(k) {
|
|
451
|
+
return env[k] === obj[k];
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
function checkPR(vendor) {
|
|
@@ -539,12 +539,12 @@ var require_re = __commonJS({
|
|
|
539
539
|
} = require_constants();
|
|
540
540
|
var debug = require_debug();
|
|
541
541
|
exports = module.exports = {};
|
|
542
|
-
var
|
|
542
|
+
var re = exports.re = [];
|
|
543
543
|
var safeRe = exports.safeRe = [];
|
|
544
544
|
var src = exports.src = [];
|
|
545
545
|
var safeSrc = exports.safeSrc = [];
|
|
546
546
|
var t = exports.t = {};
|
|
547
|
-
var
|
|
547
|
+
var R = 0;
|
|
548
548
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
549
549
|
var safeRegexReplacements = [
|
|
550
550
|
["\\s", 1],
|
|
@@ -559,12 +559,12 @@ var require_re = __commonJS({
|
|
|
559
559
|
};
|
|
560
560
|
var createToken = (name, value, isGlobal) => {
|
|
561
561
|
const safe = makeSafeRegex(value);
|
|
562
|
-
const index =
|
|
562
|
+
const index = R++;
|
|
563
563
|
debug(name, index, value);
|
|
564
564
|
t[name] = index;
|
|
565
565
|
src[index] = value;
|
|
566
566
|
safeSrc[index] = safe;
|
|
567
|
-
|
|
567
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
568
568
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
569
569
|
};
|
|
570
570
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
@@ -666,7 +666,7 @@ var require_semver = __commonJS({
|
|
|
666
666
|
"use strict";
|
|
667
667
|
var debug = require_debug();
|
|
668
668
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
669
|
-
var { safeRe:
|
|
669
|
+
var { safeRe: re, t } = require_re();
|
|
670
670
|
var parseOptions = require_parse_options();
|
|
671
671
|
var { compareIdentifiers } = require_identifiers();
|
|
672
672
|
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
@@ -702,7 +702,7 @@ var require_semver = __commonJS({
|
|
|
702
702
|
this.options = options;
|
|
703
703
|
this.loose = !!options.loose;
|
|
704
704
|
this.includePrerelease = !!options.includePrerelease;
|
|
705
|
-
const m = version2.trim().match(options.loose ?
|
|
705
|
+
const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
706
706
|
if (!m) {
|
|
707
707
|
throw new TypeError(`Invalid Version: ${version2}`);
|
|
708
708
|
}
|
|
@@ -841,7 +841,7 @@ var require_semver = __commonJS({
|
|
|
841
841
|
throw new Error("invalid increment argument: identifier is empty");
|
|
842
842
|
}
|
|
843
843
|
if (identifier) {
|
|
844
|
-
const match = `-${identifier}`.match(this.options.loose ?
|
|
844
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
845
845
|
if (!match || match[1] !== identifier) {
|
|
846
846
|
throw new Error(`invalid identifier: ${identifier}`);
|
|
847
847
|
}
|
|
@@ -980,8 +980,8 @@ var require_valid = __commonJS({
|
|
|
980
980
|
"use strict";
|
|
981
981
|
var parse = require_parse();
|
|
982
982
|
var valid = (version2, options) => {
|
|
983
|
-
const
|
|
984
|
-
return
|
|
983
|
+
const v = parse(version2, options);
|
|
984
|
+
return v ? v.version : null;
|
|
985
985
|
};
|
|
986
986
|
module.exports = valid;
|
|
987
987
|
}
|
|
@@ -1180,8 +1180,8 @@ var require_gt = __commonJS({
|
|
|
1180
1180
|
"node_modules/semver/functions/gt.js"(exports, module) {
|
|
1181
1181
|
"use strict";
|
|
1182
1182
|
var compare = require_compare();
|
|
1183
|
-
var
|
|
1184
|
-
module.exports =
|
|
1183
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
1184
|
+
module.exports = gt;
|
|
1185
1185
|
}
|
|
1186
1186
|
});
|
|
1187
1187
|
|
|
@@ -1190,8 +1190,8 @@ var require_lt = __commonJS({
|
|
|
1190
1190
|
"node_modules/semver/functions/lt.js"(exports, module) {
|
|
1191
1191
|
"use strict";
|
|
1192
1192
|
var compare = require_compare();
|
|
1193
|
-
var
|
|
1194
|
-
module.exports =
|
|
1193
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
1194
|
+
module.exports = lt;
|
|
1195
1195
|
}
|
|
1196
1196
|
});
|
|
1197
1197
|
|
|
@@ -1241,9 +1241,9 @@ var require_cmp = __commonJS({
|
|
|
1241
1241
|
"use strict";
|
|
1242
1242
|
var eq = require_eq();
|
|
1243
1243
|
var neq = require_neq();
|
|
1244
|
-
var
|
|
1244
|
+
var gt = require_gt();
|
|
1245
1245
|
var gte = require_gte();
|
|
1246
|
-
var
|
|
1246
|
+
var lt = require_lt();
|
|
1247
1247
|
var lte = require_lte();
|
|
1248
1248
|
var cmp = (a, op, b, loose) => {
|
|
1249
1249
|
switch (op) {
|
|
@@ -1270,11 +1270,11 @@ var require_cmp = __commonJS({
|
|
|
1270
1270
|
case "!=":
|
|
1271
1271
|
return neq(a, b, loose);
|
|
1272
1272
|
case ">":
|
|
1273
|
-
return
|
|
1273
|
+
return gt(a, b, loose);
|
|
1274
1274
|
case ">=":
|
|
1275
1275
|
return gte(a, b, loose);
|
|
1276
1276
|
case "<":
|
|
1277
|
-
return
|
|
1277
|
+
return lt(a, b, loose);
|
|
1278
1278
|
case "<=":
|
|
1279
1279
|
return lte(a, b, loose);
|
|
1280
1280
|
default:
|
|
@@ -1291,7 +1291,7 @@ var require_coerce = __commonJS({
|
|
|
1291
1291
|
"use strict";
|
|
1292
1292
|
var SemVer = require_semver();
|
|
1293
1293
|
var parse = require_parse();
|
|
1294
|
-
var { safeRe:
|
|
1294
|
+
var { safeRe: re, t } = require_re();
|
|
1295
1295
|
var coerce = (version2, options) => {
|
|
1296
1296
|
if (version2 instanceof SemVer) {
|
|
1297
1297
|
return version2;
|
|
@@ -1305,9 +1305,9 @@ var require_coerce = __commonJS({
|
|
|
1305
1305
|
options = options || {};
|
|
1306
1306
|
let match = null;
|
|
1307
1307
|
if (!options.rtl) {
|
|
1308
|
-
match = version2.match(options.includePrerelease ?
|
|
1308
|
+
match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
1309
1309
|
} else {
|
|
1310
|
-
const coerceRtlRegex = options.includePrerelease ?
|
|
1310
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
1311
1311
|
let next;
|
|
1312
1312
|
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
1313
1313
|
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
@@ -1463,11 +1463,11 @@ var require_range = __commonJS({
|
|
|
1463
1463
|
this.formatted += "||";
|
|
1464
1464
|
}
|
|
1465
1465
|
const comps = this.set[i];
|
|
1466
|
-
for (let
|
|
1467
|
-
if (
|
|
1466
|
+
for (let k = 0; k < comps.length; k++) {
|
|
1467
|
+
if (k > 0) {
|
|
1468
1468
|
this.formatted += " ";
|
|
1469
1469
|
}
|
|
1470
|
-
this.formatted += comps[
|
|
1470
|
+
this.formatted += comps[k].toString().trim();
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
1473
|
}
|
|
@@ -1488,20 +1488,20 @@ var require_range = __commonJS({
|
|
|
1488
1488
|
return cached;
|
|
1489
1489
|
}
|
|
1490
1490
|
const loose = this.options.loose;
|
|
1491
|
-
const hr = loose ?
|
|
1491
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1492
1492
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1493
1493
|
debug("hyphen replace", range);
|
|
1494
|
-
range = range.replace(
|
|
1494
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1495
1495
|
debug("comparator trim", range);
|
|
1496
|
-
range = range.replace(
|
|
1496
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1497
1497
|
debug("tilde trim", range);
|
|
1498
|
-
range = range.replace(
|
|
1498
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1499
1499
|
debug("caret trim", range);
|
|
1500
1500
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1501
1501
|
if (loose) {
|
|
1502
1502
|
rangeList = rangeList.filter((comp) => {
|
|
1503
1503
|
debug("loose invalid filter", comp, this.options);
|
|
1504
|
-
return !!comp.match(
|
|
1504
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1505
1505
|
});
|
|
1506
1506
|
}
|
|
1507
1507
|
debug("range list", rangeList);
|
|
@@ -1562,7 +1562,7 @@ var require_range = __commonJS({
|
|
|
1562
1562
|
var debug = require_debug();
|
|
1563
1563
|
var SemVer = require_semver();
|
|
1564
1564
|
var {
|
|
1565
|
-
safeRe:
|
|
1565
|
+
safeRe: re,
|
|
1566
1566
|
src,
|
|
1567
1567
|
t,
|
|
1568
1568
|
comparatorTrimReplace,
|
|
@@ -1586,7 +1586,7 @@ var require_range = __commonJS({
|
|
|
1586
1586
|
return result;
|
|
1587
1587
|
};
|
|
1588
1588
|
var parseComparator = (comp, options) => {
|
|
1589
|
-
comp = comp.replace(
|
|
1589
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
1590
1590
|
debug("comp", comp, options);
|
|
1591
1591
|
comp = replaceCarets(comp, options);
|
|
1592
1592
|
debug("caret", comp);
|
|
@@ -1599,27 +1599,27 @@ var require_range = __commonJS({
|
|
|
1599
1599
|
return comp;
|
|
1600
1600
|
};
|
|
1601
1601
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1602
|
-
var invalidXRangeOrder = (
|
|
1602
|
+
var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
1603
1603
|
var replaceTildes = (comp, options) => {
|
|
1604
1604
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1605
1605
|
};
|
|
1606
1606
|
var replaceTilde = (comp, options) => {
|
|
1607
|
-
const r = options.loose ?
|
|
1607
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1608
1608
|
const z = options.includePrerelease ? "-0" : "";
|
|
1609
|
-
return comp.replace(r, (
|
|
1610
|
-
debug("tilde", comp,
|
|
1609
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1610
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
1611
1611
|
let ret;
|
|
1612
|
-
if (isX(
|
|
1612
|
+
if (isX(M)) {
|
|
1613
1613
|
ret = "";
|
|
1614
1614
|
} else if (isX(m)) {
|
|
1615
|
-
ret = `>=${
|
|
1615
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1616
1616
|
} else if (isX(p)) {
|
|
1617
|
-
ret = `>=${
|
|
1617
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1618
1618
|
} else if (pr) {
|
|
1619
1619
|
debug("replaceTilde pr", pr);
|
|
1620
|
-
ret = `>=${
|
|
1620
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1621
1621
|
} else {
|
|
1622
|
-
ret = `>=${
|
|
1622
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1623
1623
|
}
|
|
1624
1624
|
debug("tilde return", ret);
|
|
1625
1625
|
return ret;
|
|
@@ -1630,42 +1630,42 @@ var require_range = __commonJS({
|
|
|
1630
1630
|
};
|
|
1631
1631
|
var replaceCaret = (comp, options) => {
|
|
1632
1632
|
debug("caret", comp, options);
|
|
1633
|
-
const r = options.loose ?
|
|
1633
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1634
1634
|
const z = options.includePrerelease ? "-0" : "";
|
|
1635
|
-
return comp.replace(r, (
|
|
1636
|
-
debug("caret", comp,
|
|
1635
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1636
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1637
1637
|
let ret;
|
|
1638
|
-
if (isX(
|
|
1638
|
+
if (isX(M)) {
|
|
1639
1639
|
ret = "";
|
|
1640
1640
|
} else if (isX(m)) {
|
|
1641
|
-
ret = `>=${
|
|
1641
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1642
1642
|
} else if (isX(p)) {
|
|
1643
|
-
if (
|
|
1644
|
-
ret = `>=${
|
|
1643
|
+
if (M === "0") {
|
|
1644
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1645
1645
|
} else {
|
|
1646
|
-
ret = `>=${
|
|
1646
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1647
1647
|
}
|
|
1648
1648
|
} else if (pr) {
|
|
1649
1649
|
debug("replaceCaret pr", pr);
|
|
1650
|
-
if (
|
|
1650
|
+
if (M === "0") {
|
|
1651
1651
|
if (m === "0") {
|
|
1652
|
-
ret = `>=${
|
|
1652
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1653
1653
|
} else {
|
|
1654
|
-
ret = `>=${
|
|
1654
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1655
1655
|
}
|
|
1656
1656
|
} else {
|
|
1657
|
-
ret = `>=${
|
|
1657
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1658
1658
|
}
|
|
1659
1659
|
} else {
|
|
1660
1660
|
debug("no pr");
|
|
1661
|
-
if (
|
|
1661
|
+
if (M === "0") {
|
|
1662
1662
|
if (m === "0") {
|
|
1663
|
-
ret = `>=${
|
|
1663
|
+
ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
1664
1664
|
} else {
|
|
1665
|
-
ret = `>=${
|
|
1665
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1666
1666
|
}
|
|
1667
1667
|
} else {
|
|
1668
|
-
ret = `>=${
|
|
1668
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1669
1669
|
}
|
|
1670
1670
|
}
|
|
1671
1671
|
debug("caret return", ret);
|
|
@@ -1678,13 +1678,13 @@ var require_range = __commonJS({
|
|
|
1678
1678
|
};
|
|
1679
1679
|
var replaceXRange = (comp, options) => {
|
|
1680
1680
|
comp = comp.trim();
|
|
1681
|
-
const r = options.loose ?
|
|
1682
|
-
return comp.replace(r, (ret, gtlt,
|
|
1683
|
-
debug("xRange", comp, ret, gtlt,
|
|
1684
|
-
if (invalidXRangeOrder(
|
|
1681
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1682
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1683
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1684
|
+
if (invalidXRangeOrder(M, m, p)) {
|
|
1685
1685
|
return comp;
|
|
1686
1686
|
}
|
|
1687
|
-
const xM = isX(
|
|
1687
|
+
const xM = isX(M);
|
|
1688
1688
|
const xm = xM || isX(m);
|
|
1689
1689
|
const xp = xm || isX(p);
|
|
1690
1690
|
const anyX = xp;
|
|
@@ -1706,7 +1706,7 @@ var require_range = __commonJS({
|
|
|
1706
1706
|
if (gtlt === ">") {
|
|
1707
1707
|
gtlt = ">=";
|
|
1708
1708
|
if (xm) {
|
|
1709
|
-
|
|
1709
|
+
M = +M + 1;
|
|
1710
1710
|
m = 0;
|
|
1711
1711
|
p = 0;
|
|
1712
1712
|
} else {
|
|
@@ -1716,7 +1716,7 @@ var require_range = __commonJS({
|
|
|
1716
1716
|
} else if (gtlt === "<=") {
|
|
1717
1717
|
gtlt = "<";
|
|
1718
1718
|
if (xm) {
|
|
1719
|
-
|
|
1719
|
+
M = +M + 1;
|
|
1720
1720
|
} else {
|
|
1721
1721
|
m = +m + 1;
|
|
1722
1722
|
}
|
|
@@ -1724,11 +1724,11 @@ var require_range = __commonJS({
|
|
|
1724
1724
|
if (gtlt === "<") {
|
|
1725
1725
|
pr = "-0";
|
|
1726
1726
|
}
|
|
1727
|
-
ret = `${gtlt +
|
|
1727
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1728
1728
|
} else if (xm) {
|
|
1729
|
-
ret = `>=${
|
|
1729
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1730
1730
|
} else if (xp) {
|
|
1731
|
-
ret = `>=${
|
|
1731
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1732
1732
|
}
|
|
1733
1733
|
debug("xRange return", ret);
|
|
1734
1734
|
return ret;
|
|
@@ -1736,11 +1736,11 @@ var require_range = __commonJS({
|
|
|
1736
1736
|
};
|
|
1737
1737
|
var replaceStars = (comp, options) => {
|
|
1738
1738
|
debug("replaceStars", comp, options);
|
|
1739
|
-
return comp.trim().replace(
|
|
1739
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1740
1740
|
};
|
|
1741
1741
|
var replaceGTE0 = (comp, options) => {
|
|
1742
1742
|
debug("replaceGTE0", comp, options);
|
|
1743
|
-
return comp.trim().replace(
|
|
1743
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1744
1744
|
};
|
|
1745
1745
|
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1746
1746
|
if (isX(fM)) {
|
|
@@ -1826,7 +1826,7 @@ var require_comparator = __commonJS({
|
|
|
1826
1826
|
debug("comp", this);
|
|
1827
1827
|
}
|
|
1828
1828
|
parse(comp) {
|
|
1829
|
-
const r = this.options.loose ?
|
|
1829
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1830
1830
|
const m = comp.match(r);
|
|
1831
1831
|
if (!m) {
|
|
1832
1832
|
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
@@ -1900,7 +1900,7 @@ var require_comparator = __commonJS({
|
|
|
1900
1900
|
};
|
|
1901
1901
|
module.exports = Comparator;
|
|
1902
1902
|
var parseOptions = require_parse_options();
|
|
1903
|
-
var { safeRe:
|
|
1903
|
+
var { safeRe: re, t } = require_re();
|
|
1904
1904
|
var cmp = require_cmp();
|
|
1905
1905
|
var debug = require_debug();
|
|
1906
1906
|
var SemVer = require_semver();
|
|
@@ -1950,10 +1950,10 @@ var require_max_satisfying = __commonJS({
|
|
|
1950
1950
|
} catch (er) {
|
|
1951
1951
|
return null;
|
|
1952
1952
|
}
|
|
1953
|
-
versions.forEach((
|
|
1954
|
-
if (rangeObj.test(
|
|
1955
|
-
if (!max || maxSV.compare(
|
|
1956
|
-
max =
|
|
1953
|
+
versions.forEach((v) => {
|
|
1954
|
+
if (rangeObj.test(v)) {
|
|
1955
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1956
|
+
max = v;
|
|
1957
1957
|
maxSV = new SemVer(max, options);
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
@@ -1979,10 +1979,10 @@ var require_min_satisfying = __commonJS({
|
|
|
1979
1979
|
} catch (er) {
|
|
1980
1980
|
return null;
|
|
1981
1981
|
}
|
|
1982
|
-
versions.forEach((
|
|
1983
|
-
if (rangeObj.test(
|
|
1984
|
-
if (!min || minSV.compare(
|
|
1985
|
-
min =
|
|
1982
|
+
versions.forEach((v) => {
|
|
1983
|
+
if (rangeObj.test(v)) {
|
|
1984
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1985
|
+
min = v;
|
|
1986
1986
|
minSV = new SemVer(min, options);
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
@@ -1999,7 +1999,7 @@ var require_min_version = __commonJS({
|
|
|
1999
1999
|
"use strict";
|
|
2000
2000
|
var SemVer = require_semver();
|
|
2001
2001
|
var Range = require_range();
|
|
2002
|
-
var
|
|
2002
|
+
var gt = require_gt();
|
|
2003
2003
|
var minVersion = (range, loose) => {
|
|
2004
2004
|
range = new Range(range, loose);
|
|
2005
2005
|
let minver = new SemVer("0.0.0");
|
|
@@ -2027,7 +2027,7 @@ var require_min_version = __commonJS({
|
|
|
2027
2027
|
/* fallthrough */
|
|
2028
2028
|
case "":
|
|
2029
2029
|
case ">=":
|
|
2030
|
-
if (!setMin ||
|
|
2030
|
+
if (!setMin || gt(compver, setMin)) {
|
|
2031
2031
|
setMin = compver;
|
|
2032
2032
|
}
|
|
2033
2033
|
break;
|
|
@@ -2039,7 +2039,7 @@ var require_min_version = __commonJS({
|
|
|
2039
2039
|
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
2040
2040
|
}
|
|
2041
2041
|
});
|
|
2042
|
-
if (setMin && (!minver ||
|
|
2042
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
2043
2043
|
minver = setMin;
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
@@ -2077,8 +2077,8 @@ var require_outside = __commonJS({
|
|
|
2077
2077
|
var { ANY } = Comparator;
|
|
2078
2078
|
var Range = require_range();
|
|
2079
2079
|
var satisfies = require_satisfies();
|
|
2080
|
-
var
|
|
2081
|
-
var
|
|
2080
|
+
var gt = require_gt();
|
|
2081
|
+
var lt = require_lt();
|
|
2082
2082
|
var lte = require_lte();
|
|
2083
2083
|
var gte = require_gte();
|
|
2084
2084
|
var outside = (version2, range, hilo, options) => {
|
|
@@ -2087,16 +2087,16 @@ var require_outside = __commonJS({
|
|
|
2087
2087
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
2088
2088
|
switch (hilo) {
|
|
2089
2089
|
case ">":
|
|
2090
|
-
gtfn =
|
|
2090
|
+
gtfn = gt;
|
|
2091
2091
|
ltefn = lte;
|
|
2092
|
-
ltfn =
|
|
2092
|
+
ltfn = lt;
|
|
2093
2093
|
comp = ">";
|
|
2094
2094
|
ecomp = ">=";
|
|
2095
2095
|
break;
|
|
2096
2096
|
case "<":
|
|
2097
|
-
gtfn =
|
|
2097
|
+
gtfn = lt;
|
|
2098
2098
|
ltefn = gte;
|
|
2099
|
-
ltfn =
|
|
2099
|
+
ltfn = gt;
|
|
2100
2100
|
comp = "<";
|
|
2101
2101
|
ecomp = "<=";
|
|
2102
2102
|
break;
|
|
@@ -2181,8 +2181,8 @@ var require_simplify = __commonJS({
|
|
|
2181
2181
|
const set = [];
|
|
2182
2182
|
let first = null;
|
|
2183
2183
|
let prev = null;
|
|
2184
|
-
const
|
|
2185
|
-
for (const version2 of
|
|
2184
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
2185
|
+
for (const version2 of v) {
|
|
2186
2186
|
const included = satisfies(version2, range, options);
|
|
2187
2187
|
if (included) {
|
|
2188
2188
|
prev = version2;
|
|
@@ -2204,11 +2204,11 @@ var require_simplify = __commonJS({
|
|
|
2204
2204
|
for (const [min, max] of set) {
|
|
2205
2205
|
if (min === max) {
|
|
2206
2206
|
ranges.push(min);
|
|
2207
|
-
} else if (!max && min ===
|
|
2207
|
+
} else if (!max && min === v[0]) {
|
|
2208
2208
|
ranges.push("*");
|
|
2209
2209
|
} else if (!max) {
|
|
2210
2210
|
ranges.push(`>=${min}`);
|
|
2211
|
-
} else if (min ===
|
|
2211
|
+
} else if (min === v[0]) {
|
|
2212
2212
|
ranges.push(`<=${max}`);
|
|
2213
2213
|
} else {
|
|
2214
2214
|
ranges.push(`${min} - ${max}`);
|
|
@@ -2274,12 +2274,12 @@ var require_subset = __commonJS({
|
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
2276
|
const eqSet = /* @__PURE__ */ new Set();
|
|
2277
|
-
let
|
|
2277
|
+
let gt, lt;
|
|
2278
2278
|
for (const c of sub) {
|
|
2279
2279
|
if (c.operator === ">" || c.operator === ">=") {
|
|
2280
|
-
|
|
2280
|
+
gt = higherGT(gt, c, options);
|
|
2281
2281
|
} else if (c.operator === "<" || c.operator === "<=") {
|
|
2282
|
-
|
|
2282
|
+
lt = lowerLT(lt, c, options);
|
|
2283
2283
|
} else {
|
|
2284
2284
|
eqSet.add(c.semver);
|
|
2285
2285
|
}
|
|
@@ -2288,19 +2288,19 @@ var require_subset = __commonJS({
|
|
|
2288
2288
|
return null;
|
|
2289
2289
|
}
|
|
2290
2290
|
let gtltComp;
|
|
2291
|
-
if (
|
|
2292
|
-
gtltComp = compare(
|
|
2291
|
+
if (gt && lt) {
|
|
2292
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
2293
2293
|
if (gtltComp > 0) {
|
|
2294
2294
|
return null;
|
|
2295
|
-
} else if (gtltComp === 0 && (
|
|
2295
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
2296
2296
|
return null;
|
|
2297
2297
|
}
|
|
2298
2298
|
}
|
|
2299
2299
|
for (const eq of eqSet) {
|
|
2300
|
-
if (
|
|
2300
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
2301
2301
|
return null;
|
|
2302
2302
|
}
|
|
2303
|
-
if (
|
|
2303
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
2304
2304
|
return null;
|
|
2305
2305
|
}
|
|
2306
2306
|
for (const c of dom) {
|
|
@@ -2312,52 +2312,52 @@ var require_subset = __commonJS({
|
|
|
2312
2312
|
}
|
|
2313
2313
|
let higher, lower;
|
|
2314
2314
|
let hasDomLT, hasDomGT;
|
|
2315
|
-
let needDomLTPre =
|
|
2316
|
-
let needDomGTPre =
|
|
2317
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
|
|
2315
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
2316
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
2317
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
2318
2318
|
needDomLTPre = false;
|
|
2319
2319
|
}
|
|
2320
2320
|
for (const c of dom) {
|
|
2321
2321
|
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
2322
2322
|
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
2323
|
-
if (
|
|
2323
|
+
if (gt) {
|
|
2324
2324
|
if (needDomGTPre) {
|
|
2325
2325
|
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
2326
2326
|
needDomGTPre = false;
|
|
2327
2327
|
}
|
|
2328
2328
|
}
|
|
2329
2329
|
if (c.operator === ">" || c.operator === ">=") {
|
|
2330
|
-
higher = higherGT(
|
|
2331
|
-
if (higher === c && higher !==
|
|
2330
|
+
higher = higherGT(gt, c, options);
|
|
2331
|
+
if (higher === c && higher !== gt) {
|
|
2332
2332
|
return false;
|
|
2333
2333
|
}
|
|
2334
|
-
} else if (
|
|
2334
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) {
|
|
2335
2335
|
return false;
|
|
2336
2336
|
}
|
|
2337
2337
|
}
|
|
2338
|
-
if (
|
|
2338
|
+
if (lt) {
|
|
2339
2339
|
if (needDomLTPre) {
|
|
2340
2340
|
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
2341
2341
|
needDomLTPre = false;
|
|
2342
2342
|
}
|
|
2343
2343
|
}
|
|
2344
2344
|
if (c.operator === "<" || c.operator === "<=") {
|
|
2345
|
-
lower = lowerLT(
|
|
2346
|
-
if (lower === c && lower !==
|
|
2345
|
+
lower = lowerLT(lt, c, options);
|
|
2346
|
+
if (lower === c && lower !== lt) {
|
|
2347
2347
|
return false;
|
|
2348
2348
|
}
|
|
2349
|
-
} else if (
|
|
2349
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) {
|
|
2350
2350
|
return false;
|
|
2351
2351
|
}
|
|
2352
2352
|
}
|
|
2353
|
-
if (!c.operator && (
|
|
2353
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
2354
2354
|
return false;
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
|
-
if (
|
|
2357
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
2358
2358
|
return false;
|
|
2359
2359
|
}
|
|
2360
|
-
if (
|
|
2360
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
2361
2361
|
return false;
|
|
2362
2362
|
}
|
|
2363
2363
|
if (needDomGTPre || needDomLTPre) {
|
|
@@ -2406,8 +2406,8 @@ var require_semver2 = __commonJS({
|
|
|
2406
2406
|
var compareBuild = require_compare_build();
|
|
2407
2407
|
var sort = require_sort();
|
|
2408
2408
|
var rsort = require_rsort();
|
|
2409
|
-
var
|
|
2410
|
-
var
|
|
2409
|
+
var gt = require_gt();
|
|
2410
|
+
var lt = require_lt();
|
|
2411
2411
|
var eq = require_eq();
|
|
2412
2412
|
var neq = require_neq();
|
|
2413
2413
|
var gte = require_gte();
|
|
@@ -2445,8 +2445,8 @@ var require_semver2 = __commonJS({
|
|
|
2445
2445
|
compareBuild,
|
|
2446
2446
|
sort,
|
|
2447
2447
|
rsort,
|
|
2448
|
-
gt
|
|
2449
|
-
lt
|
|
2448
|
+
gt,
|
|
2449
|
+
lt,
|
|
2450
2450
|
eq,
|
|
2451
2451
|
neq,
|
|
2452
2452
|
gte,
|
|
@@ -2482,7 +2482,7 @@ var require_semver2 = __commonJS({
|
|
|
2482
2482
|
|
|
2483
2483
|
// src/api-extractor.ts
|
|
2484
2484
|
import { existsSync } from "node:fs";
|
|
2485
|
-
import
|
|
2485
|
+
import fs2 from "node:fs/promises";
|
|
2486
2486
|
import path3 from "node:path";
|
|
2487
2487
|
import { Extractor, ExtractorConfig } from "@microsoft/api-extractor";
|
|
2488
2488
|
|
|
@@ -2726,2990 +2726,6 @@ async function findUp(name, options = {}) {
|
|
|
2726
2726
|
return matches[0];
|
|
2727
2727
|
}
|
|
2728
2728
|
|
|
2729
|
-
// node_modules/glob/dist/esm/index.min.js
|
|
2730
|
-
import { fileURLToPath as Wi } from "node:url";
|
|
2731
|
-
import { posix as mi, win32 as re } from "node:path";
|
|
2732
|
-
import { fileURLToPath as gi } from "node:url";
|
|
2733
|
-
import { lstatSync as wi, readdir as yi, readdirSync as bi, readlinkSync as Si, realpathSync as Ei } from "fs";
|
|
2734
|
-
import * as xi from "node:fs";
|
|
2735
|
-
import { lstat as Ci, readdir as Ti, readlink as Ai, realpath as ki } from "node:fs/promises";
|
|
2736
|
-
import { EventEmitter as ee } from "node:events";
|
|
2737
|
-
import Pe from "node:stream";
|
|
2738
|
-
import { StringDecoder as ni } from "node:string_decoder";
|
|
2739
|
-
var Gt = (n7, t, e) => {
|
|
2740
|
-
let s = n7 instanceof RegExp ? ce(n7, e) : n7, i = t instanceof RegExp ? ce(t, e) : t, r = s !== null && i != null && ss(s, i, e);
|
|
2741
|
-
return r && { start: r[0], end: r[1], pre: e.slice(0, r[0]), body: e.slice(r[0] + s.length, r[1]), post: e.slice(r[1] + i.length) };
|
|
2742
|
-
};
|
|
2743
|
-
var ce = (n7, t) => {
|
|
2744
|
-
let e = t.match(n7);
|
|
2745
|
-
return e ? e[0] : null;
|
|
2746
|
-
};
|
|
2747
|
-
var ss = (n7, t, e) => {
|
|
2748
|
-
let s, i, r, o, h, a = e.indexOf(n7), l = e.indexOf(t, a + 1), u = a;
|
|
2749
|
-
if (a >= 0 && l > 0) {
|
|
2750
|
-
if (n7 === t) return [a, l];
|
|
2751
|
-
for (s = [], r = e.length; u >= 0 && !h; ) {
|
|
2752
|
-
if (u === a) s.push(u), a = e.indexOf(n7, u + 1);
|
|
2753
|
-
else if (s.length === 1) {
|
|
2754
|
-
let c = s.pop();
|
|
2755
|
-
c !== void 0 && (h = [c, l]);
|
|
2756
|
-
} else i = s.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t, u + 1);
|
|
2757
|
-
u = a < l && a >= 0 ? a : l;
|
|
2758
|
-
}
|
|
2759
|
-
s.length && o !== void 0 && (h = [r, o]);
|
|
2760
|
-
}
|
|
2761
|
-
return h;
|
|
2762
|
-
};
|
|
2763
|
-
var fe = "\0SLASH" + Math.random() + "\0";
|
|
2764
|
-
var ue = "\0OPEN" + Math.random() + "\0";
|
|
2765
|
-
var qt = "\0CLOSE" + Math.random() + "\0";
|
|
2766
|
-
var de = "\0COMMA" + Math.random() + "\0";
|
|
2767
|
-
var pe = "\0PERIOD" + Math.random() + "\0";
|
|
2768
|
-
var is = new RegExp(fe, "g");
|
|
2769
|
-
var rs = new RegExp(ue, "g");
|
|
2770
|
-
var ns = new RegExp(qt, "g");
|
|
2771
|
-
var os = new RegExp(de, "g");
|
|
2772
|
-
var hs = new RegExp(pe, "g");
|
|
2773
|
-
var as = /\\\\/g;
|
|
2774
|
-
var ls = /\\{/g;
|
|
2775
|
-
var cs = /\\}/g;
|
|
2776
|
-
var fs2 = /\\,/g;
|
|
2777
|
-
var us = /\\./g;
|
|
2778
|
-
var ds = 1e5;
|
|
2779
|
-
function Ht(n7) {
|
|
2780
|
-
return isNaN(n7) ? n7.charCodeAt(0) : parseInt(n7, 10);
|
|
2781
|
-
}
|
|
2782
|
-
function ps(n7) {
|
|
2783
|
-
return n7.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs2, de).replace(us, pe);
|
|
2784
|
-
}
|
|
2785
|
-
function ms(n7) {
|
|
2786
|
-
return n7.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os, ",").replace(hs, ".");
|
|
2787
|
-
}
|
|
2788
|
-
function me(n7) {
|
|
2789
|
-
if (!n7) return [""];
|
|
2790
|
-
let t = [], e = Gt("{", "}", n7);
|
|
2791
|
-
if (!e) return n7.split(",");
|
|
2792
|
-
let { pre: s, body: i, post: r } = e, o = s.split(",");
|
|
2793
|
-
o[o.length - 1] += "{" + i + "}";
|
|
2794
|
-
let h = me(r);
|
|
2795
|
-
return r.length && (o[o.length - 1] += h.shift(), o.push.apply(o, h)), t.push.apply(t, o), t;
|
|
2796
|
-
}
|
|
2797
|
-
function ge(n7, t = {}) {
|
|
2798
|
-
if (!n7) return [];
|
|
2799
|
-
let { max: e = ds } = t;
|
|
2800
|
-
return n7.slice(0, 2) === "{}" && (n7 = "\\{\\}" + n7.slice(2)), ht(ps(n7), e, true).map(ms);
|
|
2801
|
-
}
|
|
2802
|
-
function gs(n7) {
|
|
2803
|
-
return "{" + n7 + "}";
|
|
2804
|
-
}
|
|
2805
|
-
function ws(n7) {
|
|
2806
|
-
return /^-?0\d/.test(n7);
|
|
2807
|
-
}
|
|
2808
|
-
function ys(n7, t) {
|
|
2809
|
-
return n7 <= t;
|
|
2810
|
-
}
|
|
2811
|
-
function bs(n7, t) {
|
|
2812
|
-
return n7 >= t;
|
|
2813
|
-
}
|
|
2814
|
-
function ht(n7, t, e) {
|
|
2815
|
-
let s = [], i = Gt("{", "}", n7);
|
|
2816
|
-
if (!i) return [n7];
|
|
2817
|
-
let r = i.pre, o = i.post.length ? ht(i.post, t, false) : [""];
|
|
2818
|
-
if (/\$$/.test(i.pre)) for (let h = 0; h < o.length && h < t; h++) {
|
|
2819
|
-
let a = r + "{" + i.body + "}" + o[h];
|
|
2820
|
-
s.push(a);
|
|
2821
|
-
}
|
|
2822
|
-
else {
|
|
2823
|
-
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = h || a, u = i.body.indexOf(",") >= 0;
|
|
2824
|
-
if (!l && !u) return i.post.match(/,(?!,).*\}/) ? (n7 = i.pre + "{" + i.body + qt + i.post, ht(n7, t, true)) : [n7];
|
|
2825
|
-
let c;
|
|
2826
|
-
if (l) c = i.body.split(/\.\./);
|
|
2827
|
-
else if (c = me(i.body), c.length === 1 && c[0] !== void 0 && (c = ht(c[0], t, false).map(gs), c.length === 1)) return o.map((f) => i.pre + c[0] + f);
|
|
2828
|
-
let d;
|
|
2829
|
-
if (l && c[0] !== void 0 && c[1] !== void 0) {
|
|
2830
|
-
let f = Ht(c[0]), m = Ht(c[1]), p = Math.max(c[0].length, c[1].length), w = c.length === 3 && c[2] !== void 0 ? Math.abs(Ht(c[2])) : 1, g = ys;
|
|
2831
|
-
m < f && (w *= -1, g = bs);
|
|
2832
|
-
let E = c.some(ws);
|
|
2833
|
-
d = [];
|
|
2834
|
-
for (let y = f; g(y, m); y += w) {
|
|
2835
|
-
let b;
|
|
2836
|
-
if (a) b = String.fromCharCode(y), b === "\\" && (b = "");
|
|
2837
|
-
else if (b = String(y), E) {
|
|
2838
|
-
let z = p - b.length;
|
|
2839
|
-
if (z > 0) {
|
|
2840
|
-
let $ = new Array(z + 1).join("0");
|
|
2841
|
-
y < 0 ? b = "-" + $ + b.slice(1) : b = $ + b;
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
d.push(b);
|
|
2845
|
-
}
|
|
2846
|
-
} else {
|
|
2847
|
-
d = [];
|
|
2848
|
-
for (let f = 0; f < c.length; f++) d.push.apply(d, ht(c[f], t, false));
|
|
2849
|
-
}
|
|
2850
|
-
for (let f = 0; f < d.length; f++) for (let m = 0; m < o.length && s.length < t; m++) {
|
|
2851
|
-
let p = r + d[f] + o[m];
|
|
2852
|
-
(!e || l || p) && s.push(p);
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2855
|
-
return s;
|
|
2856
|
-
}
|
|
2857
|
-
var at = (n7) => {
|
|
2858
|
-
if (typeof n7 != "string") throw new TypeError("invalid pattern");
|
|
2859
|
-
if (n7.length > 65536) throw new TypeError("pattern is too long");
|
|
2860
|
-
};
|
|
2861
|
-
var Ss = { "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true], "[:alpha:]": ["\\p{L}\\p{Nl}", true], "[:ascii:]": ["\\x00-\\x7f", false], "[:blank:]": ["\\p{Zs}\\t", true], "[:cntrl:]": ["\\p{Cc}", true], "[:digit:]": ["\\p{Nd}", true], "[:graph:]": ["\\p{Z}\\p{C}", true, true], "[:lower:]": ["\\p{Ll}", true], "[:print:]": ["\\p{C}", true], "[:punct:]": ["\\p{P}", true], "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true], "[:upper:]": ["\\p{Lu}", true], "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true], "[:xdigit:]": ["A-Fa-f0-9", false] };
|
|
2862
|
-
var lt = (n7) => n7.replace(/[[\]\\-]/g, "\\$&");
|
|
2863
|
-
var Es = (n7) => n7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2864
|
-
var we = (n7) => n7.join("");
|
|
2865
|
-
var ye = (n7, t) => {
|
|
2866
|
-
let e = t;
|
|
2867
|
-
if (n7.charAt(e) !== "[") throw new Error("not in a brace expression");
|
|
2868
|
-
let s = [], i = [], r = e + 1, o = false, h = false, a = false, l = false, u = e, c = "";
|
|
2869
|
-
t: for (; r < n7.length; ) {
|
|
2870
|
-
let p = n7.charAt(r);
|
|
2871
|
-
if ((p === "!" || p === "^") && r === e + 1) {
|
|
2872
|
-
l = true, r++;
|
|
2873
|
-
continue;
|
|
2874
|
-
}
|
|
2875
|
-
if (p === "]" && o && !a) {
|
|
2876
|
-
u = r + 1;
|
|
2877
|
-
break;
|
|
2878
|
-
}
|
|
2879
|
-
if (o = true, p === "\\" && !a) {
|
|
2880
|
-
a = true, r++;
|
|
2881
|
-
continue;
|
|
2882
|
-
}
|
|
2883
|
-
if (p === "[" && !a) {
|
|
2884
|
-
for (let [w, [g, S, E]] of Object.entries(Ss)) if (n7.startsWith(w, r)) {
|
|
2885
|
-
if (c) return ["$.", false, n7.length - e, true];
|
|
2886
|
-
r += w.length, E ? i.push(g) : s.push(g), h = h || S;
|
|
2887
|
-
continue t;
|
|
2888
|
-
}
|
|
2889
|
-
}
|
|
2890
|
-
if (a = false, c) {
|
|
2891
|
-
p > c ? s.push(lt(c) + "-" + lt(p)) : p === c && s.push(lt(p)), c = "", r++;
|
|
2892
|
-
continue;
|
|
2893
|
-
}
|
|
2894
|
-
if (n7.startsWith("-]", r + 1)) {
|
|
2895
|
-
s.push(lt(p + "-")), r += 2;
|
|
2896
|
-
continue;
|
|
2897
|
-
}
|
|
2898
|
-
if (n7.startsWith("-", r + 1)) {
|
|
2899
|
-
c = p, r += 2;
|
|
2900
|
-
continue;
|
|
2901
|
-
}
|
|
2902
|
-
s.push(lt(p)), r++;
|
|
2903
|
-
}
|
|
2904
|
-
if (u < r) return ["", false, 0, false];
|
|
2905
|
-
if (!s.length && !i.length) return ["$.", false, n7.length - e, true];
|
|
2906
|
-
if (i.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l) {
|
|
2907
|
-
let p = s[0].length === 2 ? s[0].slice(-1) : s[0];
|
|
2908
|
-
return [Es(p), false, u - e, false];
|
|
2909
|
-
}
|
|
2910
|
-
let d = "[" + (l ? "^" : "") + we(s) + "]", f = "[" + (l ? "" : "^") + we(i) + "]";
|
|
2911
|
-
return [s.length && i.length ? "(" + d + "|" + f + ")" : s.length ? d : f, h, u - e, true];
|
|
2912
|
-
};
|
|
2913
|
-
var W = (n7, { windowsPathsNoEscape: t = false, magicalBraces: e = true } = {}) => e ? t ? n7.replace(/\[([^\/\\])\]/g, "$1") : n7.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t ? n7.replace(/\[([^\/\\{}])\]/g, "$1") : n7.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
2914
|
-
var xs = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
2915
|
-
var be = (n7) => xs.has(n7);
|
|
2916
|
-
var vs = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
2917
|
-
var Ct = "(?!\\.)";
|
|
2918
|
-
var Cs = /* @__PURE__ */ new Set(["[", "."]);
|
|
2919
|
-
var Ts = /* @__PURE__ */ new Set(["..", "."]);
|
|
2920
|
-
var As = new Set("().*{}+?[]^$\\!");
|
|
2921
|
-
var ks = (n7) => n7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2922
|
-
var Kt = "[^/]";
|
|
2923
|
-
var Se = Kt + "*?";
|
|
2924
|
-
var Ee = Kt + "+?";
|
|
2925
|
-
var Q = class n {
|
|
2926
|
-
type;
|
|
2927
|
-
#t;
|
|
2928
|
-
#s;
|
|
2929
|
-
#n = false;
|
|
2930
|
-
#r = [];
|
|
2931
|
-
#o;
|
|
2932
|
-
#S;
|
|
2933
|
-
#w;
|
|
2934
|
-
#c = false;
|
|
2935
|
-
#h;
|
|
2936
|
-
#u;
|
|
2937
|
-
#f = false;
|
|
2938
|
-
constructor(t, e, s = {}) {
|
|
2939
|
-
this.type = t, t && (this.#s = true), this.#o = e, this.#t = this.#o ? this.#o.#t : this, this.#h = this.#t === this ? s : this.#t.#h, this.#w = this.#t === this ? [] : this.#t.#w, t === "!" && !this.#t.#c && this.#w.push(this), this.#S = this.#o ? this.#o.#r.length : 0;
|
|
2940
|
-
}
|
|
2941
|
-
get hasMagic() {
|
|
2942
|
-
if (this.#s !== void 0) return this.#s;
|
|
2943
|
-
for (let t of this.#r) if (typeof t != "string" && (t.type || t.hasMagic)) return this.#s = true;
|
|
2944
|
-
return this.#s;
|
|
2945
|
-
}
|
|
2946
|
-
toString() {
|
|
2947
|
-
return this.#u !== void 0 ? this.#u : this.type ? this.#u = this.type + "(" + this.#r.map((t) => String(t)).join("|") + ")" : this.#u = this.#r.map((t) => String(t)).join("");
|
|
2948
|
-
}
|
|
2949
|
-
#a() {
|
|
2950
|
-
if (this !== this.#t) throw new Error("should only call on root");
|
|
2951
|
-
if (this.#c) return this;
|
|
2952
|
-
this.toString(), this.#c = true;
|
|
2953
|
-
let t;
|
|
2954
|
-
for (; t = this.#w.pop(); ) {
|
|
2955
|
-
if (t.type !== "!") continue;
|
|
2956
|
-
let e = t, s = e.#o;
|
|
2957
|
-
for (; s; ) {
|
|
2958
|
-
for (let i = e.#S + 1; !s.type && i < s.#r.length; i++) for (let r of t.#r) {
|
|
2959
|
-
if (typeof r == "string") throw new Error("string part in extglob AST??");
|
|
2960
|
-
r.copyIn(s.#r[i]);
|
|
2961
|
-
}
|
|
2962
|
-
e = s, s = e.#o;
|
|
2963
|
-
}
|
|
2964
|
-
}
|
|
2965
|
-
return this;
|
|
2966
|
-
}
|
|
2967
|
-
push(...t) {
|
|
2968
|
-
for (let e of t) if (e !== "") {
|
|
2969
|
-
if (typeof e != "string" && !(e instanceof n && e.#o === this)) throw new Error("invalid part: " + e);
|
|
2970
|
-
this.#r.push(e);
|
|
2971
|
-
}
|
|
2972
|
-
}
|
|
2973
|
-
toJSON() {
|
|
2974
|
-
let t = this.type === null ? this.#r.slice().map((e) => typeof e == "string" ? e : e.toJSON()) : [this.type, ...this.#r.map((e) => e.toJSON())];
|
|
2975
|
-
return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === this.#t || this.#t.#c && this.#o?.type === "!") && t.push({}), t;
|
|
2976
|
-
}
|
|
2977
|
-
isStart() {
|
|
2978
|
-
if (this.#t === this) return true;
|
|
2979
|
-
if (!this.#o?.isStart()) return false;
|
|
2980
|
-
if (this.#S === 0) return true;
|
|
2981
|
-
let t = this.#o;
|
|
2982
|
-
for (let e = 0; e < this.#S; e++) {
|
|
2983
|
-
let s = t.#r[e];
|
|
2984
|
-
if (!(s instanceof n && s.type === "!")) return false;
|
|
2985
|
-
}
|
|
2986
|
-
return true;
|
|
2987
|
-
}
|
|
2988
|
-
isEnd() {
|
|
2989
|
-
if (this.#t === this || this.#o?.type === "!") return true;
|
|
2990
|
-
if (!this.#o?.isEnd()) return false;
|
|
2991
|
-
if (!this.type) return this.#o?.isEnd();
|
|
2992
|
-
let t = this.#o ? this.#o.#r.length : 0;
|
|
2993
|
-
return this.#S === t - 1;
|
|
2994
|
-
}
|
|
2995
|
-
copyIn(t) {
|
|
2996
|
-
typeof t == "string" ? this.push(t) : this.push(t.clone(this));
|
|
2997
|
-
}
|
|
2998
|
-
clone(t) {
|
|
2999
|
-
let e = new n(this.type, t);
|
|
3000
|
-
for (let s of this.#r) e.copyIn(s);
|
|
3001
|
-
return e;
|
|
3002
|
-
}
|
|
3003
|
-
static #i(t, e, s, i) {
|
|
3004
|
-
let r = false, o = false, h = -1, a = false;
|
|
3005
|
-
if (e.type === null) {
|
|
3006
|
-
let f = s, m = "";
|
|
3007
|
-
for (; f < t.length; ) {
|
|
3008
|
-
let p = t.charAt(f++);
|
|
3009
|
-
if (r || p === "\\") {
|
|
3010
|
-
r = !r, m += p;
|
|
3011
|
-
continue;
|
|
3012
|
-
}
|
|
3013
|
-
if (o) {
|
|
3014
|
-
f === h + 1 ? (p === "^" || p === "!") && (a = true) : p === "]" && !(f === h + 2 && a) && (o = false), m += p;
|
|
3015
|
-
continue;
|
|
3016
|
-
} else if (p === "[") {
|
|
3017
|
-
o = true, h = f, a = false, m += p;
|
|
3018
|
-
continue;
|
|
3019
|
-
}
|
|
3020
|
-
if (!i.noext && be(p) && t.charAt(f) === "(") {
|
|
3021
|
-
e.push(m), m = "";
|
|
3022
|
-
let w = new n(p, e);
|
|
3023
|
-
f = n.#i(t, w, f, i), e.push(w);
|
|
3024
|
-
continue;
|
|
3025
|
-
}
|
|
3026
|
-
m += p;
|
|
3027
|
-
}
|
|
3028
|
-
return e.push(m), f;
|
|
3029
|
-
}
|
|
3030
|
-
let l = s + 1, u = new n(null, e), c = [], d = "";
|
|
3031
|
-
for (; l < t.length; ) {
|
|
3032
|
-
let f = t.charAt(l++);
|
|
3033
|
-
if (r || f === "\\") {
|
|
3034
|
-
r = !r, d += f;
|
|
3035
|
-
continue;
|
|
3036
|
-
}
|
|
3037
|
-
if (o) {
|
|
3038
|
-
l === h + 1 ? (f === "^" || f === "!") && (a = true) : f === "]" && !(l === h + 2 && a) && (o = false), d += f;
|
|
3039
|
-
continue;
|
|
3040
|
-
} else if (f === "[") {
|
|
3041
|
-
o = true, h = l, a = false, d += f;
|
|
3042
|
-
continue;
|
|
3043
|
-
}
|
|
3044
|
-
if (be(f) && t.charAt(l) === "(") {
|
|
3045
|
-
u.push(d), d = "";
|
|
3046
|
-
let m = new n(f, u);
|
|
3047
|
-
u.push(m), l = n.#i(t, m, l, i);
|
|
3048
|
-
continue;
|
|
3049
|
-
}
|
|
3050
|
-
if (f === "|") {
|
|
3051
|
-
u.push(d), d = "", c.push(u), u = new n(null, e);
|
|
3052
|
-
continue;
|
|
3053
|
-
}
|
|
3054
|
-
if (f === ")") return d === "" && e.#r.length === 0 && (e.#f = true), u.push(d), d = "", e.push(...c, u), l;
|
|
3055
|
-
d += f;
|
|
3056
|
-
}
|
|
3057
|
-
return e.type = null, e.#s = void 0, e.#r = [t.substring(s - 1)], l;
|
|
3058
|
-
}
|
|
3059
|
-
static fromGlob(t, e = {}) {
|
|
3060
|
-
let s = new n(null, void 0, e);
|
|
3061
|
-
return n.#i(t, s, 0, e), s;
|
|
3062
|
-
}
|
|
3063
|
-
toMMPattern() {
|
|
3064
|
-
if (this !== this.#t) return this.#t.toMMPattern();
|
|
3065
|
-
let t = this.toString(), [e, s, i, r] = this.toRegExpSource();
|
|
3066
|
-
if (!(i || this.#s || this.#h.nocase && !this.#h.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase())) return s;
|
|
3067
|
-
let h = (this.#h.nocase ? "i" : "") + (r ? "u" : "");
|
|
3068
|
-
return Object.assign(new RegExp(`^${e}$`, h), { _src: e, _glob: t });
|
|
3069
|
-
}
|
|
3070
|
-
get options() {
|
|
3071
|
-
return this.#h;
|
|
3072
|
-
}
|
|
3073
|
-
toRegExpSource(t) {
|
|
3074
|
-
let e = t ?? !!this.#h.dot;
|
|
3075
|
-
if (this.#t === this && this.#a(), !this.type) {
|
|
3076
|
-
let a = this.isStart() && this.isEnd() && !this.#r.some((f) => typeof f != "string"), l = this.#r.map((f) => {
|
|
3077
|
-
let [m, p, w, g] = typeof f == "string" ? n.#E(f, this.#s, a) : f.toRegExpSource(t);
|
|
3078
|
-
return this.#s = this.#s || w, this.#n = this.#n || g, m;
|
|
3079
|
-
}).join(""), u = "";
|
|
3080
|
-
if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && Ts.has(this.#r[0]))) {
|
|
3081
|
-
let m = Cs, p = e && m.has(l.charAt(0)) || l.startsWith("\\.") && m.has(l.charAt(2)) || l.startsWith("\\.\\.") && m.has(l.charAt(4)), w = !e && !t && m.has(l.charAt(0));
|
|
3082
|
-
u = p ? vs : w ? Ct : "";
|
|
3083
|
-
}
|
|
3084
|
-
let c = "";
|
|
3085
|
-
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c = "(?:$|\\/)"), [u + l + c, W(l), this.#s = !!this.#s, this.#n];
|
|
3086
|
-
}
|
|
3087
|
-
let s = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:", r = this.#d(e);
|
|
3088
|
-
if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
|
|
3089
|
-
let a = this.toString();
|
|
3090
|
-
return this.#r = [a], this.type = null, this.#s = void 0, [a, W(this.toString()), false, false];
|
|
3091
|
-
}
|
|
3092
|
-
let o = !s || t || e || !Ct ? "" : this.#d(true);
|
|
3093
|
-
o === r && (o = ""), o && (r = `(?:${r})(?:${o})*?`);
|
|
3094
|
-
let h = "";
|
|
3095
|
-
if (this.type === "!" && this.#f) h = (this.isStart() && !e ? Ct : "") + Ee;
|
|
3096
|
-
else {
|
|
3097
|
-
let a = this.type === "!" ? "))" + (this.isStart() && !e && !t ? Ct : "") + Se + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
|
|
3098
|
-
h = i + r + a;
|
|
3099
|
-
}
|
|
3100
|
-
return [h, W(r), this.#s = !!this.#s, this.#n];
|
|
3101
|
-
}
|
|
3102
|
-
#d(t) {
|
|
3103
|
-
return this.#r.map((e) => {
|
|
3104
|
-
if (typeof e == "string") throw new Error("string type in extglob ast??");
|
|
3105
|
-
let [s, i, r, o] = e.toRegExpSource(t);
|
|
3106
|
-
return this.#n = this.#n || o, s;
|
|
3107
|
-
}).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
|
|
3108
|
-
}
|
|
3109
|
-
static #E(t, e, s = false) {
|
|
3110
|
-
let i = false, r = "", o = false, h = false;
|
|
3111
|
-
for (let a = 0; a < t.length; a++) {
|
|
3112
|
-
let l = t.charAt(a);
|
|
3113
|
-
if (i) {
|
|
3114
|
-
i = false, r += (As.has(l) ? "\\" : "") + l;
|
|
3115
|
-
continue;
|
|
3116
|
-
}
|
|
3117
|
-
if (l === "*") {
|
|
3118
|
-
if (h) continue;
|
|
3119
|
-
h = true, r += s && /^[*]+$/.test(t) ? Ee : Se, e = true;
|
|
3120
|
-
continue;
|
|
3121
|
-
} else h = false;
|
|
3122
|
-
if (l === "\\") {
|
|
3123
|
-
a === t.length - 1 ? r += "\\\\" : i = true;
|
|
3124
|
-
continue;
|
|
3125
|
-
}
|
|
3126
|
-
if (l === "[") {
|
|
3127
|
-
let [u, c, d, f] = ye(t, a);
|
|
3128
|
-
if (d) {
|
|
3129
|
-
r += u, o = o || c, a += d - 1, e = e || f;
|
|
3130
|
-
continue;
|
|
3131
|
-
}
|
|
3132
|
-
}
|
|
3133
|
-
if (l === "?") {
|
|
3134
|
-
r += Kt, e = true;
|
|
3135
|
-
continue;
|
|
3136
|
-
}
|
|
3137
|
-
r += ks(l);
|
|
3138
|
-
}
|
|
3139
|
-
return [r, W(t), !!e, o];
|
|
3140
|
-
}
|
|
3141
|
-
};
|
|
3142
|
-
var tt = (n7, { windowsPathsNoEscape: t = false, magicalBraces: e = false } = {}) => e ? t ? n7.replace(/[?*()[\]{}]/g, "[$&]") : n7.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n7.replace(/[?*()[\]]/g, "[$&]") : n7.replace(/[?*()[\]\\]/g, "\\$&");
|
|
3143
|
-
var O = (n7, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? false : new D(t, e).match(n7));
|
|
3144
|
-
var Rs = /^\*+([^+@!?\*\[\(]*)$/;
|
|
3145
|
-
var Os = (n7) => (t) => !t.startsWith(".") && t.endsWith(n7);
|
|
3146
|
-
var Fs = (n7) => (t) => t.endsWith(n7);
|
|
3147
|
-
var Ds = (n7) => (n7 = n7.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(n7));
|
|
3148
|
-
var Ms = (n7) => (n7 = n7.toLowerCase(), (t) => t.toLowerCase().endsWith(n7));
|
|
3149
|
-
var Ns = /^\*+\.\*+$/;
|
|
3150
|
-
var _s = (n7) => !n7.startsWith(".") && n7.includes(".");
|
|
3151
|
-
var Ls = (n7) => n7 !== "." && n7 !== ".." && n7.includes(".");
|
|
3152
|
-
var Ws = /^\.\*+$/;
|
|
3153
|
-
var Ps = (n7) => n7 !== "." && n7 !== ".." && n7.startsWith(".");
|
|
3154
|
-
var js = /^\*+$/;
|
|
3155
|
-
var Is = (n7) => n7.length !== 0 && !n7.startsWith(".");
|
|
3156
|
-
var zs = (n7) => n7.length !== 0 && n7 !== "." && n7 !== "..";
|
|
3157
|
-
var Bs = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
3158
|
-
var Us = ([n7, t = ""]) => {
|
|
3159
|
-
let e = Ce([n7]);
|
|
3160
|
-
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
3161
|
-
};
|
|
3162
|
-
var $s = ([n7, t = ""]) => {
|
|
3163
|
-
let e = Te([n7]);
|
|
3164
|
-
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
3165
|
-
};
|
|
3166
|
-
var Gs = ([n7, t = ""]) => {
|
|
3167
|
-
let e = Te([n7]);
|
|
3168
|
-
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
3169
|
-
};
|
|
3170
|
-
var Hs = ([n7, t = ""]) => {
|
|
3171
|
-
let e = Ce([n7]);
|
|
3172
|
-
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
3173
|
-
};
|
|
3174
|
-
var Ce = ([n7]) => {
|
|
3175
|
-
let t = n7.length;
|
|
3176
|
-
return (e) => e.length === t && !e.startsWith(".");
|
|
3177
|
-
};
|
|
3178
|
-
var Te = ([n7]) => {
|
|
3179
|
-
let t = n7.length;
|
|
3180
|
-
return (e) => e.length === t && e !== "." && e !== "..";
|
|
3181
|
-
};
|
|
3182
|
-
var Ae = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
3183
|
-
var xe = { win32: { sep: "\\" }, posix: { sep: "/" } };
|
|
3184
|
-
var qs = Ae === "win32" ? xe.win32.sep : xe.posix.sep;
|
|
3185
|
-
O.sep = qs;
|
|
3186
|
-
var A = /* @__PURE__ */ Symbol("globstar **");
|
|
3187
|
-
O.GLOBSTAR = A;
|
|
3188
|
-
var Ks = "[^/]";
|
|
3189
|
-
var Vs = Ks + "*?";
|
|
3190
|
-
var Ys = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
3191
|
-
var Xs = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
3192
|
-
var Js = (n7, t = {}) => (e) => O(e, n7, t);
|
|
3193
|
-
O.filter = Js;
|
|
3194
|
-
var N = (n7, t = {}) => Object.assign({}, n7, t);
|
|
3195
|
-
var Zs = (n7) => {
|
|
3196
|
-
if (!n7 || typeof n7 != "object" || !Object.keys(n7).length) return O;
|
|
3197
|
-
let t = O;
|
|
3198
|
-
return Object.assign((s, i, r = {}) => t(s, i, N(n7, r)), { Minimatch: class extends t.Minimatch {
|
|
3199
|
-
constructor(i, r = {}) {
|
|
3200
|
-
super(i, N(n7, r));
|
|
3201
|
-
}
|
|
3202
|
-
static defaults(i) {
|
|
3203
|
-
return t.defaults(N(n7, i)).Minimatch;
|
|
3204
|
-
}
|
|
3205
|
-
}, AST: class extends t.AST {
|
|
3206
|
-
constructor(i, r, o = {}) {
|
|
3207
|
-
super(i, r, N(n7, o));
|
|
3208
|
-
}
|
|
3209
|
-
static fromGlob(i, r = {}) {
|
|
3210
|
-
return t.AST.fromGlob(i, N(n7, r));
|
|
3211
|
-
}
|
|
3212
|
-
}, unescape: (s, i = {}) => t.unescape(s, N(n7, i)), escape: (s, i = {}) => t.escape(s, N(n7, i)), filter: (s, i = {}) => t.filter(s, N(n7, i)), defaults: (s) => t.defaults(N(n7, s)), makeRe: (s, i = {}) => t.makeRe(s, N(n7, i)), braceExpand: (s, i = {}) => t.braceExpand(s, N(n7, i)), match: (s, i, r = {}) => t.match(s, i, N(n7, r)), sep: t.sep, GLOBSTAR: A });
|
|
3213
|
-
};
|
|
3214
|
-
O.defaults = Zs;
|
|
3215
|
-
var ke = (n7, t = {}) => (at(n7), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n7) ? [n7] : ge(n7, { max: t.braceExpandMax }));
|
|
3216
|
-
O.braceExpand = ke;
|
|
3217
|
-
var Qs = (n7, t = {}) => new D(n7, t).makeRe();
|
|
3218
|
-
O.makeRe = Qs;
|
|
3219
|
-
var ti = (n7, t, e = {}) => {
|
|
3220
|
-
let s = new D(t, e);
|
|
3221
|
-
return n7 = n7.filter((i) => s.match(i)), s.options.nonull && !n7.length && n7.push(t), n7;
|
|
3222
|
-
};
|
|
3223
|
-
O.match = ti;
|
|
3224
|
-
var ve = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
3225
|
-
var ei = (n7) => n7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
3226
|
-
var D = class {
|
|
3227
|
-
options;
|
|
3228
|
-
set;
|
|
3229
|
-
pattern;
|
|
3230
|
-
windowsPathsNoEscape;
|
|
3231
|
-
nonegate;
|
|
3232
|
-
negate;
|
|
3233
|
-
comment;
|
|
3234
|
-
empty;
|
|
3235
|
-
preserveMultipleSlashes;
|
|
3236
|
-
partial;
|
|
3237
|
-
globSet;
|
|
3238
|
-
globParts;
|
|
3239
|
-
nocase;
|
|
3240
|
-
isWindows;
|
|
3241
|
-
platform;
|
|
3242
|
-
windowsNoMagicRoot;
|
|
3243
|
-
regexp;
|
|
3244
|
-
constructor(t, e = {}) {
|
|
3245
|
-
at(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Ae, this.isWindows = this.platform === "win32";
|
|
3246
|
-
let s = "allowWindowsEscape";
|
|
3247
|
-
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e[s] === false, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = false, this.nonegate = !!e.nonegate, this.comment = false, this.empty = false, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
|
|
3248
|
-
}
|
|
3249
|
-
hasMagic() {
|
|
3250
|
-
if (this.options.magicalBraces && this.set.length > 1) return true;
|
|
3251
|
-
for (let t of this.set) for (let e of t) if (typeof e != "string") return true;
|
|
3252
|
-
return false;
|
|
3253
|
-
}
|
|
3254
|
-
debug(...t) {
|
|
3255
|
-
}
|
|
3256
|
-
make() {
|
|
3257
|
-
let t = this.pattern, e = this.options;
|
|
3258
|
-
if (!e.nocomment && t.charAt(0) === "#") {
|
|
3259
|
-
this.comment = true;
|
|
3260
|
-
return;
|
|
3261
|
-
}
|
|
3262
|
-
if (!t) {
|
|
3263
|
-
this.empty = true;
|
|
3264
|
-
return;
|
|
3265
|
-
}
|
|
3266
|
-
this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet);
|
|
3267
|
-
let s = this.globSet.map((r) => this.slashSplit(r));
|
|
3268
|
-
this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts);
|
|
3269
|
-
let i = this.globParts.map((r, o, h) => {
|
|
3270
|
-
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
3271
|
-
let a = r[0] === "" && r[1] === "" && (r[2] === "?" || !ve.test(r[2])) && !ve.test(r[3]), l = /^[a-z]:/i.test(r[0]);
|
|
3272
|
-
if (a) return [...r.slice(0, 4), ...r.slice(4).map((u) => this.parse(u))];
|
|
3273
|
-
if (l) return [r[0], ...r.slice(1).map((u) => this.parse(u))];
|
|
3274
|
-
}
|
|
3275
|
-
return r.map((a) => this.parse(a));
|
|
3276
|
-
});
|
|
3277
|
-
if (this.debug(this.pattern, i), this.set = i.filter((r) => r.indexOf(false) === -1), this.isWindows) for (let r = 0; r < this.set.length; r++) {
|
|
3278
|
-
let o = this.set[r];
|
|
3279
|
-
o[0] === "" && o[1] === "" && this.globParts[r][2] === "?" && typeof o[3] == "string" && /^[a-z]:$/i.test(o[3]) && (o[2] = "?");
|
|
3280
|
-
}
|
|
3281
|
-
this.debug(this.pattern, this.set);
|
|
3282
|
-
}
|
|
3283
|
-
preprocess(t) {
|
|
3284
|
-
if (this.options.noglobstar) for (let s = 0; s < t.length; s++) for (let i = 0; i < t[s].length; i++) t[s][i] === "**" && (t[s][i] = "*");
|
|
3285
|
-
let { optimizationLevel: e = 1 } = this.options;
|
|
3286
|
-
return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
|
|
3287
|
-
}
|
|
3288
|
-
adjascentGlobstarOptimize(t) {
|
|
3289
|
-
return t.map((e) => {
|
|
3290
|
-
let s = -1;
|
|
3291
|
-
for (; (s = e.indexOf("**", s + 1)) !== -1; ) {
|
|
3292
|
-
let i = s;
|
|
3293
|
-
for (; e[i + 1] === "**"; ) i++;
|
|
3294
|
-
i !== s && e.splice(s, i - s);
|
|
3295
|
-
}
|
|
3296
|
-
return e;
|
|
3297
|
-
});
|
|
3298
|
-
}
|
|
3299
|
-
levelOneOptimize(t) {
|
|
3300
|
-
return t.map((e) => (e = e.reduce((s, i) => {
|
|
3301
|
-
let r = s[s.length - 1];
|
|
3302
|
-
return i === "**" && r === "**" ? s : i === ".." && r && r !== ".." && r !== "." && r !== "**" ? (s.pop(), s) : (s.push(i), s);
|
|
3303
|
-
}, []), e.length === 0 ? [""] : e));
|
|
3304
|
-
}
|
|
3305
|
-
levelTwoFileOptimize(t) {
|
|
3306
|
-
Array.isArray(t) || (t = this.slashSplit(t));
|
|
3307
|
-
let e = false;
|
|
3308
|
-
do {
|
|
3309
|
-
if (e = false, !this.preserveMultipleSlashes) {
|
|
3310
|
-
for (let i = 1; i < t.length - 1; i++) {
|
|
3311
|
-
let r = t[i];
|
|
3312
|
-
i === 1 && r === "" && t[0] === "" || (r === "." || r === "") && (e = true, t.splice(i, 1), i--);
|
|
3313
|
-
}
|
|
3314
|
-
t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = true, t.pop());
|
|
3315
|
-
}
|
|
3316
|
-
let s = 0;
|
|
3317
|
-
for (; (s = t.indexOf("..", s + 1)) !== -1; ) {
|
|
3318
|
-
let i = t[s - 1];
|
|
3319
|
-
i && i !== "." && i !== ".." && i !== "**" && (e = true, t.splice(s - 1, 2), s -= 2);
|
|
3320
|
-
}
|
|
3321
|
-
} while (e);
|
|
3322
|
-
return t.length === 0 ? [""] : t;
|
|
3323
|
-
}
|
|
3324
|
-
firstPhasePreProcess(t) {
|
|
3325
|
-
let e = false;
|
|
3326
|
-
do {
|
|
3327
|
-
e = false;
|
|
3328
|
-
for (let s of t) {
|
|
3329
|
-
let i = -1;
|
|
3330
|
-
for (; (i = s.indexOf("**", i + 1)) !== -1; ) {
|
|
3331
|
-
let o = i;
|
|
3332
|
-
for (; s[o + 1] === "**"; ) o++;
|
|
3333
|
-
o > i && s.splice(i + 1, o - i);
|
|
3334
|
-
let h = s[i + 1], a = s[i + 2], l = s[i + 3];
|
|
3335
|
-
if (h !== ".." || !a || a === "." || a === ".." || !l || l === "." || l === "..") continue;
|
|
3336
|
-
e = true, s.splice(i, 1);
|
|
3337
|
-
let u = s.slice(0);
|
|
3338
|
-
u[i] = "**", t.push(u), i--;
|
|
3339
|
-
}
|
|
3340
|
-
if (!this.preserveMultipleSlashes) {
|
|
3341
|
-
for (let o = 1; o < s.length - 1; o++) {
|
|
3342
|
-
let h = s[o];
|
|
3343
|
-
o === 1 && h === "" && s[0] === "" || (h === "." || h === "") && (e = true, s.splice(o, 1), o--);
|
|
3344
|
-
}
|
|
3345
|
-
s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = true, s.pop());
|
|
3346
|
-
}
|
|
3347
|
-
let r = 0;
|
|
3348
|
-
for (; (r = s.indexOf("..", r + 1)) !== -1; ) {
|
|
3349
|
-
let o = s[r - 1];
|
|
3350
|
-
if (o && o !== "." && o !== ".." && o !== "**") {
|
|
3351
|
-
e = true;
|
|
3352
|
-
let a = r === 1 && s[r + 1] === "**" ? ["."] : [];
|
|
3353
|
-
s.splice(r - 1, 2, ...a), s.length === 0 && s.push(""), r -= 2;
|
|
3354
|
-
}
|
|
3355
|
-
}
|
|
3356
|
-
}
|
|
3357
|
-
} while (e);
|
|
3358
|
-
return t;
|
|
3359
|
-
}
|
|
3360
|
-
secondPhasePreProcess(t) {
|
|
3361
|
-
for (let e = 0; e < t.length - 1; e++) for (let s = e + 1; s < t.length; s++) {
|
|
3362
|
-
let i = this.partsMatch(t[e], t[s], !this.preserveMultipleSlashes);
|
|
3363
|
-
if (i) {
|
|
3364
|
-
t[e] = [], t[s] = i;
|
|
3365
|
-
break;
|
|
3366
|
-
}
|
|
3367
|
-
}
|
|
3368
|
-
return t.filter((e) => e.length);
|
|
3369
|
-
}
|
|
3370
|
-
partsMatch(t, e, s = false) {
|
|
3371
|
-
let i = 0, r = 0, o = [], h = "";
|
|
3372
|
-
for (; i < t.length && r < e.length; ) if (t[i] === e[r]) o.push(h === "b" ? e[r] : t[i]), i++, r++;
|
|
3373
|
-
else if (s && t[i] === "**" && e[r] === t[i + 1]) o.push(t[i]), i++;
|
|
3374
|
-
else if (s && e[r] === "**" && t[i] === e[r + 1]) o.push(e[r]), r++;
|
|
3375
|
-
else if (t[i] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") {
|
|
3376
|
-
if (h === "b") return false;
|
|
3377
|
-
h = "a", o.push(t[i]), i++, r++;
|
|
3378
|
-
} else if (e[r] === "*" && t[i] && (this.options.dot || !t[i].startsWith(".")) && t[i] !== "**") {
|
|
3379
|
-
if (h === "a") return false;
|
|
3380
|
-
h = "b", o.push(e[r]), i++, r++;
|
|
3381
|
-
} else return false;
|
|
3382
|
-
return t.length === e.length && o;
|
|
3383
|
-
}
|
|
3384
|
-
parseNegate() {
|
|
3385
|
-
if (this.nonegate) return;
|
|
3386
|
-
let t = this.pattern, e = false, s = 0;
|
|
3387
|
-
for (let i = 0; i < t.length && t.charAt(i) === "!"; i++) e = !e, s++;
|
|
3388
|
-
s && (this.pattern = t.slice(s)), this.negate = e;
|
|
3389
|
-
}
|
|
3390
|
-
matchOne(t, e, s = false) {
|
|
3391
|
-
let i = this.options;
|
|
3392
|
-
if (this.isWindows) {
|
|
3393
|
-
let p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), w = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), g = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), S = !g && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), E = w ? 3 : p ? 0 : void 0, y = S ? 3 : g ? 0 : void 0;
|
|
3394
|
-
if (typeof E == "number" && typeof y == "number") {
|
|
3395
|
-
let [b, z] = [t[E], e[y]];
|
|
3396
|
-
b.toLowerCase() === z.toLowerCase() && (e[y] = b, y > E ? e = e.slice(y) : E > y && (t = t.slice(E)));
|
|
3397
|
-
}
|
|
3398
|
-
}
|
|
3399
|
-
let { optimizationLevel: r = 1 } = this.options;
|
|
3400
|
-
r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
|
|
3401
|
-
for (var o = 0, h = 0, a = t.length, l = e.length; o < a && h < l; o++, h++) {
|
|
3402
|
-
this.debug("matchOne loop");
|
|
3403
|
-
var u = e[h], c = t[o];
|
|
3404
|
-
if (this.debug(e, u, c), u === false) return false;
|
|
3405
|
-
if (u === A) {
|
|
3406
|
-
this.debug("GLOBSTAR", [e, u, c]);
|
|
3407
|
-
var d = o, f = h + 1;
|
|
3408
|
-
if (f === l) {
|
|
3409
|
-
for (this.debug("** at the end"); o < a; o++) if (t[o] === "." || t[o] === ".." || !i.dot && t[o].charAt(0) === ".") return false;
|
|
3410
|
-
return true;
|
|
3411
|
-
}
|
|
3412
|
-
for (; d < a; ) {
|
|
3413
|
-
var m = t[d];
|
|
3414
|
-
if (this.debug(`
|
|
3415
|
-
globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) return this.debug("globstar found match!", d, a, m), true;
|
|
3416
|
-
if (m === "." || m === ".." || !i.dot && m.charAt(0) === ".") {
|
|
3417
|
-
this.debug("dot detected!", t, d, e, f);
|
|
3418
|
-
break;
|
|
3419
|
-
}
|
|
3420
|
-
this.debug("globstar swallow a segment, and continue"), d++;
|
|
3421
|
-
}
|
|
3422
|
-
return !!(s && (this.debug(`
|
|
3423
|
-
>>> no match, partial?`, t, d, e, f), d === a));
|
|
3424
|
-
}
|
|
3425
|
-
let p;
|
|
3426
|
-
if (typeof u == "string" ? (p = c === u, this.debug("string match", u, c, p)) : (p = u.test(c), this.debug("pattern match", u, c, p)), !p) return false;
|
|
3427
|
-
}
|
|
3428
|
-
if (o === a && h === l) return true;
|
|
3429
|
-
if (o === a) return s;
|
|
3430
|
-
if (h === l) return o === a - 1 && t[o] === "";
|
|
3431
|
-
throw new Error("wtf?");
|
|
3432
|
-
}
|
|
3433
|
-
braceExpand() {
|
|
3434
|
-
return ke(this.pattern, this.options);
|
|
3435
|
-
}
|
|
3436
|
-
parse(t) {
|
|
3437
|
-
at(t);
|
|
3438
|
-
let e = this.options;
|
|
3439
|
-
if (t === "**") return A;
|
|
3440
|
-
if (t === "") return "";
|
|
3441
|
-
let s, i = null;
|
|
3442
|
-
(s = t.match(js)) ? i = e.dot ? zs : Is : (s = t.match(Rs)) ? i = (e.nocase ? e.dot ? Ms : Ds : e.dot ? Fs : Os)(s[1]) : (s = t.match(Bs)) ? i = (e.nocase ? e.dot ? $s : Us : e.dot ? Gs : Hs)(s) : (s = t.match(Ns)) ? i = e.dot ? Ls : _s : (s = t.match(Ws)) && (i = Ps);
|
|
3443
|
-
let r = Q.fromGlob(t, this.options).toMMPattern();
|
|
3444
|
-
return i && typeof r == "object" && Reflect.defineProperty(r, "test", { value: i }), r;
|
|
3445
|
-
}
|
|
3446
|
-
makeRe() {
|
|
3447
|
-
if (this.regexp || this.regexp === false) return this.regexp;
|
|
3448
|
-
let t = this.set;
|
|
3449
|
-
if (!t.length) return this.regexp = false, this.regexp;
|
|
3450
|
-
let e = this.options, s = e.noglobstar ? Vs : e.dot ? Ys : Xs, i = new Set(e.nocase ? ["i"] : []), r = t.map((a) => {
|
|
3451
|
-
let l = a.map((c) => {
|
|
3452
|
-
if (c instanceof RegExp) for (let d of c.flags.split("")) i.add(d);
|
|
3453
|
-
return typeof c == "string" ? ei(c) : c === A ? A : c._src;
|
|
3454
|
-
});
|
|
3455
|
-
l.forEach((c, d) => {
|
|
3456
|
-
let f = l[d + 1], m = l[d - 1];
|
|
3457
|
-
c !== A || m === A || (m === void 0 ? f !== void 0 && f !== A ? l[d + 1] = "(?:\\/|" + s + "\\/)?" + f : l[d] = s : f === void 0 ? l[d - 1] = m + "(?:\\/|\\/" + s + ")?" : f !== A && (l[d - 1] = m + "(?:\\/|\\/" + s + "\\/)" + f, l[d + 1] = A));
|
|
3458
|
-
});
|
|
3459
|
-
let u = l.filter((c) => c !== A);
|
|
3460
|
-
if (this.partial && u.length >= 1) {
|
|
3461
|
-
let c = [];
|
|
3462
|
-
for (let d = 1; d <= u.length; d++) c.push(u.slice(0, d).join("/"));
|
|
3463
|
-
return "(?:" + c.join("|") + ")";
|
|
3464
|
-
}
|
|
3465
|
-
return u.join("/");
|
|
3466
|
-
}).join("|"), [o, h] = t.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
3467
|
-
r = "^" + o + r + h + "$", this.partial && (r = "^(?:\\/|" + o + r.slice(1, -1) + h + ")$"), this.negate && (r = "^(?!" + r + ").+$");
|
|
3468
|
-
try {
|
|
3469
|
-
this.regexp = new RegExp(r, [...i].join(""));
|
|
3470
|
-
} catch {
|
|
3471
|
-
this.regexp = false;
|
|
3472
|
-
}
|
|
3473
|
-
return this.regexp;
|
|
3474
|
-
}
|
|
3475
|
-
slashSplit(t) {
|
|
3476
|
-
return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
|
|
3477
|
-
}
|
|
3478
|
-
match(t, e = this.partial) {
|
|
3479
|
-
if (this.debug("match", t, this.pattern), this.comment) return false;
|
|
3480
|
-
if (this.empty) return t === "";
|
|
3481
|
-
if (t === "/" && e) return true;
|
|
3482
|
-
let s = this.options;
|
|
3483
|
-
this.isWindows && (t = t.split("\\").join("/"));
|
|
3484
|
-
let i = this.slashSplit(t);
|
|
3485
|
-
this.debug(this.pattern, "split", i);
|
|
3486
|
-
let r = this.set;
|
|
3487
|
-
this.debug(this.pattern, "set", r);
|
|
3488
|
-
let o = i[i.length - 1];
|
|
3489
|
-
if (!o) for (let h = i.length - 2; !o && h >= 0; h--) o = i[h];
|
|
3490
|
-
for (let h = 0; h < r.length; h++) {
|
|
3491
|
-
let a = r[h], l = i;
|
|
3492
|
-
if (s.matchBase && a.length === 1 && (l = [o]), this.matchOne(l, a, e)) return s.flipNegate ? true : !this.negate;
|
|
3493
|
-
}
|
|
3494
|
-
return s.flipNegate ? false : this.negate;
|
|
3495
|
-
}
|
|
3496
|
-
static defaults(t) {
|
|
3497
|
-
return O.defaults(t).Minimatch;
|
|
3498
|
-
}
|
|
3499
|
-
};
|
|
3500
|
-
O.AST = Q;
|
|
3501
|
-
O.Minimatch = D;
|
|
3502
|
-
O.escape = tt;
|
|
3503
|
-
O.unescape = W;
|
|
3504
|
-
var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
3505
|
-
var Oe = /* @__PURE__ */ new Set();
|
|
3506
|
-
var Vt = typeof process == "object" && process ? process : {};
|
|
3507
|
-
var Fe = (n7, t, e, s) => {
|
|
3508
|
-
typeof Vt.emitWarning == "function" ? Vt.emitWarning(n7, t, e, s) : console.error(`[${e}] ${t}: ${n7}`);
|
|
3509
|
-
};
|
|
3510
|
-
var At = globalThis.AbortController;
|
|
3511
|
-
var Re = globalThis.AbortSignal;
|
|
3512
|
-
if (typeof At > "u") {
|
|
3513
|
-
Re = class {
|
|
3514
|
-
onabort;
|
|
3515
|
-
_onabort = [];
|
|
3516
|
-
reason;
|
|
3517
|
-
aborted = false;
|
|
3518
|
-
addEventListener(e, s) {
|
|
3519
|
-
this._onabort.push(s);
|
|
3520
|
-
}
|
|
3521
|
-
}, At = class {
|
|
3522
|
-
constructor() {
|
|
3523
|
-
t();
|
|
3524
|
-
}
|
|
3525
|
-
signal = new Re();
|
|
3526
|
-
abort(e) {
|
|
3527
|
-
if (!this.signal.aborted) {
|
|
3528
|
-
this.signal.reason = e, this.signal.aborted = true;
|
|
3529
|
-
for (let s of this.signal._onabort) s(e);
|
|
3530
|
-
this.signal.onabort?.(e);
|
|
3531
|
-
}
|
|
3532
|
-
}
|
|
3533
|
-
};
|
|
3534
|
-
let n7 = Vt.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
3535
|
-
n7 && (n7 = false, Fe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
|
|
3536
|
-
};
|
|
3537
|
-
}
|
|
3538
|
-
var ii = (n7) => !Oe.has(n7);
|
|
3539
|
-
var q = (n7) => n7 && n7 === Math.floor(n7) && n7 > 0 && isFinite(n7);
|
|
3540
|
-
var De = (n7) => q(n7) ? n7 <= Math.pow(2, 8) ? Uint8Array : n7 <= Math.pow(2, 16) ? Uint16Array : n7 <= Math.pow(2, 32) ? Uint32Array : n7 <= Number.MAX_SAFE_INTEGER ? Tt : null : null;
|
|
3541
|
-
var Tt = class extends Array {
|
|
3542
|
-
constructor(n7) {
|
|
3543
|
-
super(n7), this.fill(0);
|
|
3544
|
-
}
|
|
3545
|
-
};
|
|
3546
|
-
var ri = class ct {
|
|
3547
|
-
heap;
|
|
3548
|
-
length;
|
|
3549
|
-
static #t = false;
|
|
3550
|
-
static create(t) {
|
|
3551
|
-
let e = De(t);
|
|
3552
|
-
if (!e) return [];
|
|
3553
|
-
ct.#t = true;
|
|
3554
|
-
let s = new ct(t, e);
|
|
3555
|
-
return ct.#t = false, s;
|
|
3556
|
-
}
|
|
3557
|
-
constructor(t, e) {
|
|
3558
|
-
if (!ct.#t) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
3559
|
-
this.heap = new e(t), this.length = 0;
|
|
3560
|
-
}
|
|
3561
|
-
push(t) {
|
|
3562
|
-
this.heap[this.length++] = t;
|
|
3563
|
-
}
|
|
3564
|
-
pop() {
|
|
3565
|
-
return this.heap[--this.length];
|
|
3566
|
-
}
|
|
3567
|
-
};
|
|
3568
|
-
var ft = class Me {
|
|
3569
|
-
#t;
|
|
3570
|
-
#s;
|
|
3571
|
-
#n;
|
|
3572
|
-
#r;
|
|
3573
|
-
#o;
|
|
3574
|
-
#S;
|
|
3575
|
-
#w;
|
|
3576
|
-
#c;
|
|
3577
|
-
get perf() {
|
|
3578
|
-
return this.#c;
|
|
3579
|
-
}
|
|
3580
|
-
ttl;
|
|
3581
|
-
ttlResolution;
|
|
3582
|
-
ttlAutopurge;
|
|
3583
|
-
updateAgeOnGet;
|
|
3584
|
-
updateAgeOnHas;
|
|
3585
|
-
allowStale;
|
|
3586
|
-
noDisposeOnSet;
|
|
3587
|
-
noUpdateTTL;
|
|
3588
|
-
maxEntrySize;
|
|
3589
|
-
sizeCalculation;
|
|
3590
|
-
noDeleteOnFetchRejection;
|
|
3591
|
-
noDeleteOnStaleGet;
|
|
3592
|
-
allowStaleOnFetchAbort;
|
|
3593
|
-
allowStaleOnFetchRejection;
|
|
3594
|
-
ignoreFetchAbort;
|
|
3595
|
-
#h;
|
|
3596
|
-
#u;
|
|
3597
|
-
#f;
|
|
3598
|
-
#a;
|
|
3599
|
-
#i;
|
|
3600
|
-
#d;
|
|
3601
|
-
#E;
|
|
3602
|
-
#b;
|
|
3603
|
-
#p;
|
|
3604
|
-
#R;
|
|
3605
|
-
#m;
|
|
3606
|
-
#C;
|
|
3607
|
-
#T;
|
|
3608
|
-
#g;
|
|
3609
|
-
#y;
|
|
3610
|
-
#x;
|
|
3611
|
-
#A;
|
|
3612
|
-
#e;
|
|
3613
|
-
#_;
|
|
3614
|
-
static unsafeExposeInternals(t) {
|
|
3615
|
-
return { starts: t.#T, ttls: t.#g, autopurgeTimers: t.#y, sizes: t.#C, keyMap: t.#f, keyList: t.#a, valList: t.#i, next: t.#d, prev: t.#E, get head() {
|
|
3616
|
-
return t.#b;
|
|
3617
|
-
}, get tail() {
|
|
3618
|
-
return t.#p;
|
|
3619
|
-
}, free: t.#R, isBackgroundFetch: (e) => t.#l(e), backgroundFetch: (e, s, i, r) => t.#U(e, s, i, r), moveToTail: (e) => t.#W(e), indexes: (e) => t.#F(e), rindexes: (e) => t.#D(e), isStale: (e) => t.#v(e) };
|
|
3620
|
-
}
|
|
3621
|
-
get max() {
|
|
3622
|
-
return this.#t;
|
|
3623
|
-
}
|
|
3624
|
-
get maxSize() {
|
|
3625
|
-
return this.#s;
|
|
3626
|
-
}
|
|
3627
|
-
get calculatedSize() {
|
|
3628
|
-
return this.#u;
|
|
3629
|
-
}
|
|
3630
|
-
get size() {
|
|
3631
|
-
return this.#h;
|
|
3632
|
-
}
|
|
3633
|
-
get fetchMethod() {
|
|
3634
|
-
return this.#S;
|
|
3635
|
-
}
|
|
3636
|
-
get memoMethod() {
|
|
3637
|
-
return this.#w;
|
|
3638
|
-
}
|
|
3639
|
-
get dispose() {
|
|
3640
|
-
return this.#n;
|
|
3641
|
-
}
|
|
3642
|
-
get onInsert() {
|
|
3643
|
-
return this.#r;
|
|
3644
|
-
}
|
|
3645
|
-
get disposeAfter() {
|
|
3646
|
-
return this.#o;
|
|
3647
|
-
}
|
|
3648
|
-
constructor(t) {
|
|
3649
|
-
let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a, dispose: l, onInsert: u, disposeAfter: c, noDisposeOnSet: d, noUpdateTTL: f, maxSize: m = 0, maxEntrySize: p = 0, sizeCalculation: w, fetchMethod: g, memoMethod: S, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y, allowStaleOnFetchRejection: b, allowStaleOnFetchAbort: z, ignoreFetchAbort: $, perf: J } = t;
|
|
3650
|
-
if (J !== void 0 && typeof J?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
3651
|
-
if (this.#c = J ?? si, e !== 0 && !q(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
3652
|
-
let Z = e ? De(e) : Array;
|
|
3653
|
-
if (!Z) throw new Error("invalid max value: " + e);
|
|
3654
|
-
if (this.#t = e, this.#s = m, this.maxEntrySize = p || this.#s, this.sizeCalculation = w, this.sizeCalculation) {
|
|
3655
|
-
if (!this.#s && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
3656
|
-
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
3657
|
-
}
|
|
3658
|
-
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
3659
|
-
if (this.#w = S, g !== void 0 && typeof g != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
3660
|
-
if (this.#S = g, this.#A = !!g, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new Z(e), this.#E = new Z(e), this.#b = 0, this.#p = 0, this.#R = ri.create(e), this.#h = 0, this.#u = 0, typeof l == "function" && (this.#n = l), typeof u == "function" && (this.#r = u), typeof c == "function" ? (this.#o = c, this.#m = []) : (this.#o = void 0, this.#m = void 0), this.#x = !!this.#n, this.#_ = !!this.#r, this.#e = !!this.#o, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!f, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!b, this.allowStaleOnFetchAbort = !!z, this.ignoreFetchAbort = !!$, this.maxEntrySize !== 0) {
|
|
3661
|
-
if (this.#s !== 0 && !q(this.#s)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
3662
|
-
if (!q(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
3663
|
-
this.#G();
|
|
3664
|
-
}
|
|
3665
|
-
if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!y, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = q(i) || i === 0 ? i : 1, this.ttlAutopurge = !!r, this.ttl = s || 0, this.ttl) {
|
|
3666
|
-
if (!q(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
3667
|
-
this.#M();
|
|
3668
|
-
}
|
|
3669
|
-
if (this.#t === 0 && this.ttl === 0 && this.#s === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
3670
|
-
if (!this.ttlAutopurge && !this.#t && !this.#s) {
|
|
3671
|
-
let $t = "LRU_CACHE_UNBOUNDED";
|
|
3672
|
-
ii($t) && (Oe.add($t), Fe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", $t, Me));
|
|
3673
|
-
}
|
|
3674
|
-
}
|
|
3675
|
-
getRemainingTTL(t) {
|
|
3676
|
-
return this.#f.has(t) ? 1 / 0 : 0;
|
|
3677
|
-
}
|
|
3678
|
-
#M() {
|
|
3679
|
-
let t = new Tt(this.#t), e = new Tt(this.#t);
|
|
3680
|
-
this.#g = t, this.#T = e;
|
|
3681
|
-
let s = this.ttlAutopurge ? new Array(this.#t) : void 0;
|
|
3682
|
-
this.#y = s, this.#j = (o, h, a = this.#c.now()) => {
|
|
3683
|
-
if (e[o] = h !== 0 ? a : 0, t[o] = h, s?.[o] && (clearTimeout(s[o]), s[o] = void 0), h !== 0 && s) {
|
|
3684
|
-
let l = setTimeout(() => {
|
|
3685
|
-
this.#v(o) && this.#O(this.#a[o], "expire");
|
|
3686
|
-
}, h + 1);
|
|
3687
|
-
l.unref && l.unref(), s[o] = l;
|
|
3688
|
-
}
|
|
3689
|
-
}, this.#k = (o) => {
|
|
3690
|
-
e[o] = t[o] !== 0 ? this.#c.now() : 0;
|
|
3691
|
-
}, this.#N = (o, h) => {
|
|
3692
|
-
if (t[h]) {
|
|
3693
|
-
let a = t[h], l = e[h];
|
|
3694
|
-
if (!a || !l) return;
|
|
3695
|
-
o.ttl = a, o.start = l, o.now = i || r();
|
|
3696
|
-
let u = o.now - l;
|
|
3697
|
-
o.remainingTTL = a - u;
|
|
3698
|
-
}
|
|
3699
|
-
};
|
|
3700
|
-
let i = 0, r = () => {
|
|
3701
|
-
let o = this.#c.now();
|
|
3702
|
-
if (this.ttlResolution > 0) {
|
|
3703
|
-
i = o;
|
|
3704
|
-
let h = setTimeout(() => i = 0, this.ttlResolution);
|
|
3705
|
-
h.unref && h.unref();
|
|
3706
|
-
}
|
|
3707
|
-
return o;
|
|
3708
|
-
};
|
|
3709
|
-
this.getRemainingTTL = (o) => {
|
|
3710
|
-
let h = this.#f.get(o);
|
|
3711
|
-
if (h === void 0) return 0;
|
|
3712
|
-
let a = t[h], l = e[h];
|
|
3713
|
-
if (!a || !l) return 1 / 0;
|
|
3714
|
-
let u = (i || r()) - l;
|
|
3715
|
-
return a - u;
|
|
3716
|
-
}, this.#v = (o) => {
|
|
3717
|
-
let h = e[o], a = t[o];
|
|
3718
|
-
return !!a && !!h && (i || r()) - h > a;
|
|
3719
|
-
};
|
|
3720
|
-
}
|
|
3721
|
-
#k = () => {
|
|
3722
|
-
};
|
|
3723
|
-
#N = () => {
|
|
3724
|
-
};
|
|
3725
|
-
#j = () => {
|
|
3726
|
-
};
|
|
3727
|
-
#v = () => false;
|
|
3728
|
-
#G() {
|
|
3729
|
-
let t = new Tt(this.#t);
|
|
3730
|
-
this.#u = 0, this.#C = t, this.#P = (e) => {
|
|
3731
|
-
this.#u -= t[e], t[e] = 0;
|
|
3732
|
-
}, this.#I = (e, s, i, r) => {
|
|
3733
|
-
if (this.#l(s)) return 0;
|
|
3734
|
-
if (!q(i)) if (r) {
|
|
3735
|
-
if (typeof r != "function") throw new TypeError("sizeCalculation must be a function");
|
|
3736
|
-
if (i = r(s, e), !q(i)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
3737
|
-
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
3738
|
-
return i;
|
|
3739
|
-
}, this.#L = (e, s, i) => {
|
|
3740
|
-
if (t[e] = s, this.#s) {
|
|
3741
|
-
let r = this.#s - t[e];
|
|
3742
|
-
for (; this.#u > r; ) this.#B(true);
|
|
3743
|
-
}
|
|
3744
|
-
this.#u += t[e], i && (i.entrySize = s, i.totalCalculatedSize = this.#u);
|
|
3745
|
-
};
|
|
3746
|
-
}
|
|
3747
|
-
#P = (t) => {
|
|
3748
|
-
};
|
|
3749
|
-
#L = (t, e, s) => {
|
|
3750
|
-
};
|
|
3751
|
-
#I = (t, e, s, i) => {
|
|
3752
|
-
if (s || i) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
3753
|
-
return 0;
|
|
3754
|
-
};
|
|
3755
|
-
*#F({ allowStale: t = this.allowStale } = {}) {
|
|
3756
|
-
if (this.#h) for (let e = this.#p; !(!this.#z(e) || ((t || !this.#v(e)) && (yield e), e === this.#b)); ) e = this.#E[e];
|
|
3757
|
-
}
|
|
3758
|
-
*#D({ allowStale: t = this.allowStale } = {}) {
|
|
3759
|
-
if (this.#h) for (let e = this.#b; !(!this.#z(e) || ((t || !this.#v(e)) && (yield e), e === this.#p)); ) e = this.#d[e];
|
|
3760
|
-
}
|
|
3761
|
-
#z(t) {
|
|
3762
|
-
return t !== void 0 && this.#f.get(this.#a[t]) === t;
|
|
3763
|
-
}
|
|
3764
|
-
*entries() {
|
|
3765
|
-
for (let t of this.#F()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]);
|
|
3766
|
-
}
|
|
3767
|
-
*rentries() {
|
|
3768
|
-
for (let t of this.#D()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]);
|
|
3769
|
-
}
|
|
3770
|
-
*keys() {
|
|
3771
|
-
for (let t of this.#F()) {
|
|
3772
|
-
let e = this.#a[t];
|
|
3773
|
-
e !== void 0 && !this.#l(this.#i[t]) && (yield e);
|
|
3774
|
-
}
|
|
3775
|
-
}
|
|
3776
|
-
*rkeys() {
|
|
3777
|
-
for (let t of this.#D()) {
|
|
3778
|
-
let e = this.#a[t];
|
|
3779
|
-
e !== void 0 && !this.#l(this.#i[t]) && (yield e);
|
|
3780
|
-
}
|
|
3781
|
-
}
|
|
3782
|
-
*values() {
|
|
3783
|
-
for (let t of this.#F()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]);
|
|
3784
|
-
}
|
|
3785
|
-
*rvalues() {
|
|
3786
|
-
for (let t of this.#D()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]);
|
|
3787
|
-
}
|
|
3788
|
-
[Symbol.iterator]() {
|
|
3789
|
-
return this.entries();
|
|
3790
|
-
}
|
|
3791
|
-
[Symbol.toStringTag] = "LRUCache";
|
|
3792
|
-
find(t, e = {}) {
|
|
3793
|
-
for (let s of this.#F()) {
|
|
3794
|
-
let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
3795
|
-
if (r !== void 0 && t(r, this.#a[s], this)) return this.get(this.#a[s], e);
|
|
3796
|
-
}
|
|
3797
|
-
}
|
|
3798
|
-
forEach(t, e = this) {
|
|
3799
|
-
for (let s of this.#F()) {
|
|
3800
|
-
let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
3801
|
-
r !== void 0 && t.call(e, r, this.#a[s], this);
|
|
3802
|
-
}
|
|
3803
|
-
}
|
|
3804
|
-
rforEach(t, e = this) {
|
|
3805
|
-
for (let s of this.#D()) {
|
|
3806
|
-
let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
3807
|
-
r !== void 0 && t.call(e, r, this.#a[s], this);
|
|
3808
|
-
}
|
|
3809
|
-
}
|
|
3810
|
-
purgeStale() {
|
|
3811
|
-
let t = false;
|
|
3812
|
-
for (let e of this.#D({ allowStale: true })) this.#v(e) && (this.#O(this.#a[e], "expire"), t = true);
|
|
3813
|
-
return t;
|
|
3814
|
-
}
|
|
3815
|
-
info(t) {
|
|
3816
|
-
let e = this.#f.get(t);
|
|
3817
|
-
if (e === void 0) return;
|
|
3818
|
-
let s = this.#i[e], i = this.#l(s) ? s.__staleWhileFetching : s;
|
|
3819
|
-
if (i === void 0) return;
|
|
3820
|
-
let r = { value: i };
|
|
3821
|
-
if (this.#g && this.#T) {
|
|
3822
|
-
let o = this.#g[e], h = this.#T[e];
|
|
3823
|
-
if (o && h) {
|
|
3824
|
-
let a = o - (this.#c.now() - h);
|
|
3825
|
-
r.ttl = a, r.start = Date.now();
|
|
3826
|
-
}
|
|
3827
|
-
}
|
|
3828
|
-
return this.#C && (r.size = this.#C[e]), r;
|
|
3829
|
-
}
|
|
3830
|
-
dump() {
|
|
3831
|
-
let t = [];
|
|
3832
|
-
for (let e of this.#F({ allowStale: true })) {
|
|
3833
|
-
let s = this.#a[e], i = this.#i[e], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
3834
|
-
if (r === void 0 || s === void 0) continue;
|
|
3835
|
-
let o = { value: r };
|
|
3836
|
-
if (this.#g && this.#T) {
|
|
3837
|
-
o.ttl = this.#g[e];
|
|
3838
|
-
let h = this.#c.now() - this.#T[e];
|
|
3839
|
-
o.start = Math.floor(Date.now() - h);
|
|
3840
|
-
}
|
|
3841
|
-
this.#C && (o.size = this.#C[e]), t.unshift([s, o]);
|
|
3842
|
-
}
|
|
3843
|
-
return t;
|
|
3844
|
-
}
|
|
3845
|
-
load(t) {
|
|
3846
|
-
this.clear();
|
|
3847
|
-
for (let [e, s] of t) {
|
|
3848
|
-
if (s.start) {
|
|
3849
|
-
let i = Date.now() - s.start;
|
|
3850
|
-
s.start = this.#c.now() - i;
|
|
3851
|
-
}
|
|
3852
|
-
this.set(e, s.value, s);
|
|
3853
|
-
}
|
|
3854
|
-
}
|
|
3855
|
-
set(t, e, s = {}) {
|
|
3856
|
-
if (e === void 0) return this.delete(t), this;
|
|
3857
|
-
let { ttl: i = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s, u = this.#I(t, e, s.size || 0, h);
|
|
3858
|
-
if (this.maxEntrySize && u > this.maxEntrySize) return a && (a.set = "miss", a.maxEntrySizeExceeded = true), this.#O(t, "set"), this;
|
|
3859
|
-
let c = this.#h === 0 ? void 0 : this.#f.get(t);
|
|
3860
|
-
if (c === void 0) c = this.#h === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#h === this.#t ? this.#B(false) : this.#h, this.#a[c] = t, this.#i[c] = e, this.#f.set(t, c), this.#d[this.#p] = c, this.#E[c] = this.#p, this.#p = c, this.#h++, this.#L(c, u, a), a && (a.set = "add"), l = false, this.#_ && this.#r?.(e, t, "add");
|
|
3861
|
-
else {
|
|
3862
|
-
this.#W(c);
|
|
3863
|
-
let d = this.#i[c];
|
|
3864
|
-
if (e !== d) {
|
|
3865
|
-
if (this.#A && this.#l(d)) {
|
|
3866
|
-
d.__abortController.abort(new Error("replaced"));
|
|
3867
|
-
let { __staleWhileFetching: f } = d;
|
|
3868
|
-
f !== void 0 && !o && (this.#x && this.#n?.(f, t, "set"), this.#e && this.#m?.push([f, t, "set"]));
|
|
3869
|
-
} else o || (this.#x && this.#n?.(d, t, "set"), this.#e && this.#m?.push([d, t, "set"]));
|
|
3870
|
-
if (this.#P(c), this.#L(c, u, a), this.#i[c] = e, a) {
|
|
3871
|
-
a.set = "replace";
|
|
3872
|
-
let f = d && this.#l(d) ? d.__staleWhileFetching : d;
|
|
3873
|
-
f !== void 0 && (a.oldValue = f);
|
|
3874
|
-
}
|
|
3875
|
-
} else a && (a.set = "update");
|
|
3876
|
-
this.#_ && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
3877
|
-
}
|
|
3878
|
-
if (i !== 0 && !this.#g && this.#M(), this.#g && (l || this.#j(c, i, r), a && this.#N(a, c)), !o && this.#e && this.#m) {
|
|
3879
|
-
let d = this.#m, f;
|
|
3880
|
-
for (; f = d?.shift(); ) this.#o?.(...f);
|
|
3881
|
-
}
|
|
3882
|
-
return this;
|
|
3883
|
-
}
|
|
3884
|
-
pop() {
|
|
3885
|
-
try {
|
|
3886
|
-
for (; this.#h; ) {
|
|
3887
|
-
let t = this.#i[this.#b];
|
|
3888
|
-
if (this.#B(true), this.#l(t)) {
|
|
3889
|
-
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
3890
|
-
} else if (t !== void 0) return t;
|
|
3891
|
-
}
|
|
3892
|
-
} finally {
|
|
3893
|
-
if (this.#e && this.#m) {
|
|
3894
|
-
let t = this.#m, e;
|
|
3895
|
-
for (; e = t?.shift(); ) this.#o?.(...e);
|
|
3896
|
-
}
|
|
3897
|
-
}
|
|
3898
|
-
}
|
|
3899
|
-
#B(t) {
|
|
3900
|
-
let e = this.#b, s = this.#a[e], i = this.#i[e];
|
|
3901
|
-
return this.#A && this.#l(i) ? i.__abortController.abort(new Error("evicted")) : (this.#x || this.#e) && (this.#x && this.#n?.(i, s, "evict"), this.#e && this.#m?.push([i, s, "evict"])), this.#P(e), this.#y?.[e] && (clearTimeout(this.#y[e]), this.#y[e] = void 0), t && (this.#a[e] = void 0, this.#i[e] = void 0, this.#R.push(e)), this.#h === 1 ? (this.#b = this.#p = 0, this.#R.length = 0) : this.#b = this.#d[e], this.#f.delete(s), this.#h--, e;
|
|
3902
|
-
}
|
|
3903
|
-
has(t, e = {}) {
|
|
3904
|
-
let { updateAgeOnHas: s = this.updateAgeOnHas, status: i } = e, r = this.#f.get(t);
|
|
3905
|
-
if (r !== void 0) {
|
|
3906
|
-
let o = this.#i[r];
|
|
3907
|
-
if (this.#l(o) && o.__staleWhileFetching === void 0) return false;
|
|
3908
|
-
if (this.#v(r)) i && (i.has = "stale", this.#N(i, r));
|
|
3909
|
-
else return s && this.#k(r), i && (i.has = "hit", this.#N(i, r)), true;
|
|
3910
|
-
} else i && (i.has = "miss");
|
|
3911
|
-
return false;
|
|
3912
|
-
}
|
|
3913
|
-
peek(t, e = {}) {
|
|
3914
|
-
let { allowStale: s = this.allowStale } = e, i = this.#f.get(t);
|
|
3915
|
-
if (i === void 0 || !s && this.#v(i)) return;
|
|
3916
|
-
let r = this.#i[i];
|
|
3917
|
-
return this.#l(r) ? r.__staleWhileFetching : r;
|
|
3918
|
-
}
|
|
3919
|
-
#U(t, e, s, i) {
|
|
3920
|
-
let r = e === void 0 ? void 0 : this.#i[e];
|
|
3921
|
-
if (this.#l(r)) return r;
|
|
3922
|
-
let o = new At(), { signal: h } = s;
|
|
3923
|
-
h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
|
|
3924
|
-
let a = { signal: o.signal, options: s, context: i }, l = (p, w = false) => {
|
|
3925
|
-
let { aborted: g } = o.signal, S = s.ignoreFetchAbort && p !== void 0, E = s.ignoreFetchAbort || !!(s.allowStaleOnFetchAbort && p !== void 0);
|
|
3926
|
-
if (s.status && (g && !w ? (s.status.fetchAborted = true, s.status.fetchError = o.signal.reason, S && (s.status.fetchAbortIgnored = true)) : s.status.fetchResolved = true), g && !S && !w) return c(o.signal.reason, E);
|
|
3927
|
-
let y = f, b = this.#i[e];
|
|
3928
|
-
return (b === f || S && w && b === void 0) && (p === void 0 ? y.__staleWhileFetching !== void 0 ? this.#i[e] = y.__staleWhileFetching : this.#O(t, "fetch") : (s.status && (s.status.fetchUpdated = true), this.set(t, p, a.options))), p;
|
|
3929
|
-
}, u = (p) => (s.status && (s.status.fetchRejected = true, s.status.fetchError = p), c(p, false)), c = (p, w) => {
|
|
3930
|
-
let { aborted: g } = o.signal, S = g && s.allowStaleOnFetchAbort, E = S || s.allowStaleOnFetchRejection, y = E || s.noDeleteOnFetchRejection, b = f;
|
|
3931
|
-
if (this.#i[e] === f && (!y || !w && b.__staleWhileFetching === void 0 ? this.#O(t, "fetch") : S || (this.#i[e] = b.__staleWhileFetching)), E) return s.status && b.__staleWhileFetching !== void 0 && (s.status.returnedStale = true), b.__staleWhileFetching;
|
|
3932
|
-
if (b.__returned === b) throw p;
|
|
3933
|
-
}, d = (p, w) => {
|
|
3934
|
-
let g = this.#S?.(t, r, a);
|
|
3935
|
-
g && g instanceof Promise && g.then((S) => p(S === void 0 ? void 0 : S), w), o.signal.addEventListener("abort", () => {
|
|
3936
|
-
(!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (S) => l(S, true)));
|
|
3937
|
-
});
|
|
3938
|
-
};
|
|
3939
|
-
s.status && (s.status.fetchDispatched = true);
|
|
3940
|
-
let f = new Promise(d).then(l, u), m = Object.assign(f, { __abortController: o, __staleWhileFetching: r, __returned: void 0 });
|
|
3941
|
-
return e === void 0 ? (this.set(t, m, { ...a.options, status: void 0 }), e = this.#f.get(t)) : this.#i[e] = m, m;
|
|
3942
|
-
}
|
|
3943
|
-
#l(t) {
|
|
3944
|
-
if (!this.#A) return false;
|
|
3945
|
-
let e = t;
|
|
3946
|
-
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof At;
|
|
3947
|
-
}
|
|
3948
|
-
async fetch(t, e = {}) {
|
|
3949
|
-
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: u = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: m = this.allowStaleOnFetchAbort, context: p, forceRefresh: w = false, status: g, signal: S } = e;
|
|
3950
|
-
if (!this.#A) return g && (g.fetch = "get"), this.get(t, { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, status: g });
|
|
3951
|
-
let E = { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, ttl: o, noDisposeOnSet: h, size: a, sizeCalculation: l, noUpdateTTL: u, noDeleteOnFetchRejection: c, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: m, ignoreFetchAbort: f, status: g, signal: S }, y = this.#f.get(t);
|
|
3952
|
-
if (y === void 0) {
|
|
3953
|
-
g && (g.fetch = "miss");
|
|
3954
|
-
let b = this.#U(t, y, E, p);
|
|
3955
|
-
return b.__returned = b;
|
|
3956
|
-
} else {
|
|
3957
|
-
let b = this.#i[y];
|
|
3958
|
-
if (this.#l(b)) {
|
|
3959
|
-
let Z = s && b.__staleWhileFetching !== void 0;
|
|
3960
|
-
return g && (g.fetch = "inflight", Z && (g.returnedStale = true)), Z ? b.__staleWhileFetching : b.__returned = b;
|
|
3961
|
-
}
|
|
3962
|
-
let z = this.#v(y);
|
|
3963
|
-
if (!w && !z) return g && (g.fetch = "hit"), this.#W(y), i && this.#k(y), g && this.#N(g, y), b;
|
|
3964
|
-
let $ = this.#U(t, y, E, p), J = $.__staleWhileFetching !== void 0 && s;
|
|
3965
|
-
return g && (g.fetch = z ? "stale" : "refresh", J && z && (g.returnedStale = true)), J ? $.__staleWhileFetching : $.__returned = $;
|
|
3966
|
-
}
|
|
3967
|
-
}
|
|
3968
|
-
async forceFetch(t, e = {}) {
|
|
3969
|
-
let s = await this.fetch(t, e);
|
|
3970
|
-
if (s === void 0) throw new Error("fetch() returned undefined");
|
|
3971
|
-
return s;
|
|
3972
|
-
}
|
|
3973
|
-
memo(t, e = {}) {
|
|
3974
|
-
let s = this.#w;
|
|
3975
|
-
if (!s) throw new Error("no memoMethod provided to constructor");
|
|
3976
|
-
let { context: i, forceRefresh: r, ...o } = e, h = this.get(t, o);
|
|
3977
|
-
if (!r && h !== void 0) return h;
|
|
3978
|
-
let a = s(t, h, { options: o, context: i });
|
|
3979
|
-
return this.set(t, a, o), a;
|
|
3980
|
-
}
|
|
3981
|
-
get(t, e = {}) {
|
|
3982
|
-
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, status: o } = e, h = this.#f.get(t);
|
|
3983
|
-
if (h !== void 0) {
|
|
3984
|
-
let a = this.#i[h], l = this.#l(a);
|
|
3985
|
-
return o && this.#N(o, h), this.#v(h) ? (o && (o.get = "stale"), l ? (o && s && a.__staleWhileFetching !== void 0 && (o.returnedStale = true), s ? a.__staleWhileFetching : void 0) : (r || this.#O(t, "expire"), o && s && (o.returnedStale = true), s ? a : void 0)) : (o && (o.get = "hit"), l ? a.__staleWhileFetching : (this.#W(h), i && this.#k(h), a));
|
|
3986
|
-
} else o && (o.get = "miss");
|
|
3987
|
-
}
|
|
3988
|
-
#$(t, e) {
|
|
3989
|
-
this.#E[e] = t, this.#d[t] = e;
|
|
3990
|
-
}
|
|
3991
|
-
#W(t) {
|
|
3992
|
-
t !== this.#p && (t === this.#b ? this.#b = this.#d[t] : this.#$(this.#E[t], this.#d[t]), this.#$(this.#p, t), this.#p = t);
|
|
3993
|
-
}
|
|
3994
|
-
delete(t) {
|
|
3995
|
-
return this.#O(t, "delete");
|
|
3996
|
-
}
|
|
3997
|
-
#O(t, e) {
|
|
3998
|
-
let s = false;
|
|
3999
|
-
if (this.#h !== 0) {
|
|
4000
|
-
let i = this.#f.get(t);
|
|
4001
|
-
if (i !== void 0) if (this.#y?.[i] && (clearTimeout(this.#y?.[i]), this.#y[i] = void 0), s = true, this.#h === 1) this.#H(e);
|
|
4002
|
-
else {
|
|
4003
|
-
this.#P(i);
|
|
4004
|
-
let r = this.#i[i];
|
|
4005
|
-
if (this.#l(r) ? r.__abortController.abort(new Error("deleted")) : (this.#x || this.#e) && (this.#x && this.#n?.(r, t, e), this.#e && this.#m?.push([r, t, e])), this.#f.delete(t), this.#a[i] = void 0, this.#i[i] = void 0, i === this.#p) this.#p = this.#E[i];
|
|
4006
|
-
else if (i === this.#b) this.#b = this.#d[i];
|
|
4007
|
-
else {
|
|
4008
|
-
let o = this.#E[i];
|
|
4009
|
-
this.#d[o] = this.#d[i];
|
|
4010
|
-
let h = this.#d[i];
|
|
4011
|
-
this.#E[h] = this.#E[i];
|
|
4012
|
-
}
|
|
4013
|
-
this.#h--, this.#R.push(i);
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
if (this.#e && this.#m?.length) {
|
|
4017
|
-
let i = this.#m, r;
|
|
4018
|
-
for (; r = i?.shift(); ) this.#o?.(...r);
|
|
4019
|
-
}
|
|
4020
|
-
return s;
|
|
4021
|
-
}
|
|
4022
|
-
clear() {
|
|
4023
|
-
return this.#H("delete");
|
|
4024
|
-
}
|
|
4025
|
-
#H(t) {
|
|
4026
|
-
for (let e of this.#D({ allowStale: true })) {
|
|
4027
|
-
let s = this.#i[e];
|
|
4028
|
-
if (this.#l(s)) s.__abortController.abort(new Error("deleted"));
|
|
4029
|
-
else {
|
|
4030
|
-
let i = this.#a[e];
|
|
4031
|
-
this.#x && this.#n?.(s, i, t), this.#e && this.#m?.push([s, i, t]);
|
|
4032
|
-
}
|
|
4033
|
-
}
|
|
4034
|
-
if (this.#f.clear(), this.#i.fill(void 0), this.#a.fill(void 0), this.#g && this.#T) {
|
|
4035
|
-
this.#g.fill(0), this.#T.fill(0);
|
|
4036
|
-
for (let e of this.#y ?? []) e !== void 0 && clearTimeout(e);
|
|
4037
|
-
this.#y?.fill(void 0);
|
|
4038
|
-
}
|
|
4039
|
-
if (this.#C && this.#C.fill(0), this.#b = 0, this.#p = 0, this.#R.length = 0, this.#u = 0, this.#h = 0, this.#e && this.#m) {
|
|
4040
|
-
let e = this.#m, s;
|
|
4041
|
-
for (; s = e?.shift(); ) this.#o?.(...s);
|
|
4042
|
-
}
|
|
4043
|
-
}
|
|
4044
|
-
};
|
|
4045
|
-
var Ne = typeof process == "object" && process ? process : { stdout: null, stderr: null };
|
|
4046
|
-
var oi = (n7) => !!n7 && typeof n7 == "object" && (n7 instanceof V || n7 instanceof Pe || hi(n7) || ai(n7));
|
|
4047
|
-
var hi = (n7) => !!n7 && typeof n7 == "object" && n7 instanceof ee && typeof n7.pipe == "function" && n7.pipe !== Pe.Writable.prototype.pipe;
|
|
4048
|
-
var ai = (n7) => !!n7 && typeof n7 == "object" && n7 instanceof ee && typeof n7.write == "function" && typeof n7.end == "function";
|
|
4049
|
-
var G = /* @__PURE__ */ Symbol("EOF");
|
|
4050
|
-
var H = /* @__PURE__ */ Symbol("maybeEmitEnd");
|
|
4051
|
-
var K = /* @__PURE__ */ Symbol("emittedEnd");
|
|
4052
|
-
var kt = /* @__PURE__ */ Symbol("emittingEnd");
|
|
4053
|
-
var ut = /* @__PURE__ */ Symbol("emittedError");
|
|
4054
|
-
var Rt = /* @__PURE__ */ Symbol("closed");
|
|
4055
|
-
var _e = /* @__PURE__ */ Symbol("read");
|
|
4056
|
-
var Ot = /* @__PURE__ */ Symbol("flush");
|
|
4057
|
-
var Le = /* @__PURE__ */ Symbol("flushChunk");
|
|
4058
|
-
var P = /* @__PURE__ */ Symbol("encoding");
|
|
4059
|
-
var et = /* @__PURE__ */ Symbol("decoder");
|
|
4060
|
-
var v = /* @__PURE__ */ Symbol("flowing");
|
|
4061
|
-
var dt = /* @__PURE__ */ Symbol("paused");
|
|
4062
|
-
var st = /* @__PURE__ */ Symbol("resume");
|
|
4063
|
-
var C = /* @__PURE__ */ Symbol("buffer");
|
|
4064
|
-
var F = /* @__PURE__ */ Symbol("pipes");
|
|
4065
|
-
var T = /* @__PURE__ */ Symbol("bufferLength");
|
|
4066
|
-
var Yt = /* @__PURE__ */ Symbol("bufferPush");
|
|
4067
|
-
var Ft = /* @__PURE__ */ Symbol("bufferShift");
|
|
4068
|
-
var k = /* @__PURE__ */ Symbol("objectMode");
|
|
4069
|
-
var x = /* @__PURE__ */ Symbol("destroyed");
|
|
4070
|
-
var Xt = /* @__PURE__ */ Symbol("error");
|
|
4071
|
-
var Jt = /* @__PURE__ */ Symbol("emitData");
|
|
4072
|
-
var We = /* @__PURE__ */ Symbol("emitEnd");
|
|
4073
|
-
var Zt = /* @__PURE__ */ Symbol("emitEnd2");
|
|
4074
|
-
var B = /* @__PURE__ */ Symbol("async");
|
|
4075
|
-
var Qt = /* @__PURE__ */ Symbol("abort");
|
|
4076
|
-
var Dt = /* @__PURE__ */ Symbol("aborted");
|
|
4077
|
-
var pt = /* @__PURE__ */ Symbol("signal");
|
|
4078
|
-
var Y = /* @__PURE__ */ Symbol("dataListeners");
|
|
4079
|
-
var M = /* @__PURE__ */ Symbol("discarded");
|
|
4080
|
-
var mt = (n7) => Promise.resolve().then(n7);
|
|
4081
|
-
var li = (n7) => n7();
|
|
4082
|
-
var ci = (n7) => n7 === "end" || n7 === "finish" || n7 === "prefinish";
|
|
4083
|
-
var fi = (n7) => n7 instanceof ArrayBuffer || !!n7 && typeof n7 == "object" && n7.constructor && n7.constructor.name === "ArrayBuffer" && n7.byteLength >= 0;
|
|
4084
|
-
var ui = (n7) => !Buffer.isBuffer(n7) && ArrayBuffer.isView(n7);
|
|
4085
|
-
var Mt = class {
|
|
4086
|
-
src;
|
|
4087
|
-
dest;
|
|
4088
|
-
opts;
|
|
4089
|
-
ondrain;
|
|
4090
|
-
constructor(t, e, s) {
|
|
4091
|
-
this.src = t, this.dest = e, this.opts = s, this.ondrain = () => t[st](), this.dest.on("drain", this.ondrain);
|
|
4092
|
-
}
|
|
4093
|
-
unpipe() {
|
|
4094
|
-
this.dest.removeListener("drain", this.ondrain);
|
|
4095
|
-
}
|
|
4096
|
-
proxyErrors(t) {
|
|
4097
|
-
}
|
|
4098
|
-
end() {
|
|
4099
|
-
this.unpipe(), this.opts.end && this.dest.end();
|
|
4100
|
-
}
|
|
4101
|
-
};
|
|
4102
|
-
var te = class extends Mt {
|
|
4103
|
-
unpipe() {
|
|
4104
|
-
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
4105
|
-
}
|
|
4106
|
-
constructor(t, e, s) {
|
|
4107
|
-
super(t, e, s), this.proxyErrors = (i) => this.dest.emit("error", i), t.on("error", this.proxyErrors);
|
|
4108
|
-
}
|
|
4109
|
-
};
|
|
4110
|
-
var di = (n7) => !!n7.objectMode;
|
|
4111
|
-
var pi = (n7) => !n7.objectMode && !!n7.encoding && n7.encoding !== "buffer";
|
|
4112
|
-
var V = class extends ee {
|
|
4113
|
-
[v] = false;
|
|
4114
|
-
[dt] = false;
|
|
4115
|
-
[F] = [];
|
|
4116
|
-
[C] = [];
|
|
4117
|
-
[k];
|
|
4118
|
-
[P];
|
|
4119
|
-
[B];
|
|
4120
|
-
[et];
|
|
4121
|
-
[G] = false;
|
|
4122
|
-
[K] = false;
|
|
4123
|
-
[kt] = false;
|
|
4124
|
-
[Rt] = false;
|
|
4125
|
-
[ut] = null;
|
|
4126
|
-
[T] = 0;
|
|
4127
|
-
[x] = false;
|
|
4128
|
-
[pt];
|
|
4129
|
-
[Dt] = false;
|
|
4130
|
-
[Y] = 0;
|
|
4131
|
-
[M] = false;
|
|
4132
|
-
writable = true;
|
|
4133
|
-
readable = true;
|
|
4134
|
-
constructor(...t) {
|
|
4135
|
-
let e = t[0] || {};
|
|
4136
|
-
if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
|
|
4137
|
-
di(e) ? (this[k] = true, this[P] = null) : pi(e) ? (this[P] = e.encoding, this[k] = false) : (this[k] = false, this[P] = null), this[B] = !!e.async, this[et] = this[P] ? new ni(this[P]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[C] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[F] });
|
|
4138
|
-
let { signal: s } = e;
|
|
4139
|
-
s && (this[pt] = s, s.aborted ? this[Qt]() : s.addEventListener("abort", () => this[Qt]()));
|
|
4140
|
-
}
|
|
4141
|
-
get bufferLength() {
|
|
4142
|
-
return this[T];
|
|
4143
|
-
}
|
|
4144
|
-
get encoding() {
|
|
4145
|
-
return this[P];
|
|
4146
|
-
}
|
|
4147
|
-
set encoding(t) {
|
|
4148
|
-
throw new Error("Encoding must be set at instantiation time");
|
|
4149
|
-
}
|
|
4150
|
-
setEncoding(t) {
|
|
4151
|
-
throw new Error("Encoding must be set at instantiation time");
|
|
4152
|
-
}
|
|
4153
|
-
get objectMode() {
|
|
4154
|
-
return this[k];
|
|
4155
|
-
}
|
|
4156
|
-
set objectMode(t) {
|
|
4157
|
-
throw new Error("objectMode must be set at instantiation time");
|
|
4158
|
-
}
|
|
4159
|
-
get async() {
|
|
4160
|
-
return this[B];
|
|
4161
|
-
}
|
|
4162
|
-
set async(t) {
|
|
4163
|
-
this[B] = this[B] || !!t;
|
|
4164
|
-
}
|
|
4165
|
-
[Qt]() {
|
|
4166
|
-
this[Dt] = true, this.emit("abort", this[pt]?.reason), this.destroy(this[pt]?.reason);
|
|
4167
|
-
}
|
|
4168
|
-
get aborted() {
|
|
4169
|
-
return this[Dt];
|
|
4170
|
-
}
|
|
4171
|
-
set aborted(t) {
|
|
4172
|
-
}
|
|
4173
|
-
write(t, e, s) {
|
|
4174
|
-
if (this[Dt]) return false;
|
|
4175
|
-
if (this[G]) throw new Error("write after end");
|
|
4176
|
-
if (this[x]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
4177
|
-
typeof e == "function" && (s = e, e = "utf8"), e || (e = "utf8");
|
|
4178
|
-
let i = this[B] ? mt : li;
|
|
4179
|
-
if (!this[k] && !Buffer.isBuffer(t)) {
|
|
4180
|
-
if (ui(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
4181
|
-
else if (fi(t)) t = Buffer.from(t);
|
|
4182
|
-
else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
4183
|
-
}
|
|
4184
|
-
return this[k] ? (this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i(s), this[v]) : t.length ? (typeof t == "string" && !(e === this[P] && !this[et]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[P] && (t = this[et].write(t)), this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i(s), this[v]) : (this[T] !== 0 && this.emit("readable"), s && i(s), this[v]);
|
|
4185
|
-
}
|
|
4186
|
-
read(t) {
|
|
4187
|
-
if (this[x]) return null;
|
|
4188
|
-
if (this[M] = false, this[T] === 0 || t === 0 || t && t > this[T]) return this[H](), null;
|
|
4189
|
-
this[k] && (t = null), this[C].length > 1 && !this[k] && (this[C] = [this[P] ? this[C].join("") : Buffer.concat(this[C], this[T])]);
|
|
4190
|
-
let e = this[_e](t || null, this[C][0]);
|
|
4191
|
-
return this[H](), e;
|
|
4192
|
-
}
|
|
4193
|
-
[_e](t, e) {
|
|
4194
|
-
if (this[k]) this[Ft]();
|
|
4195
|
-
else {
|
|
4196
|
-
let s = e;
|
|
4197
|
-
t === s.length || t === null ? this[Ft]() : typeof s == "string" ? (this[C][0] = s.slice(t), e = s.slice(0, t), this[T] -= t) : (this[C][0] = s.subarray(t), e = s.subarray(0, t), this[T] -= t);
|
|
4198
|
-
}
|
|
4199
|
-
return this.emit("data", e), !this[C].length && !this[G] && this.emit("drain"), e;
|
|
4200
|
-
}
|
|
4201
|
-
end(t, e, s) {
|
|
4202
|
-
return typeof t == "function" && (s = t, t = void 0), typeof e == "function" && (s = e, e = "utf8"), t !== void 0 && this.write(t, e), s && this.once("end", s), this[G] = true, this.writable = false, (this[v] || !this[dt]) && this[H](), this;
|
|
4203
|
-
}
|
|
4204
|
-
[st]() {
|
|
4205
|
-
this[x] || (!this[Y] && !this[F].length && (this[M] = true), this[dt] = false, this[v] = true, this.emit("resume"), this[C].length ? this[Ot]() : this[G] ? this[H]() : this.emit("drain"));
|
|
4206
|
-
}
|
|
4207
|
-
resume() {
|
|
4208
|
-
return this[st]();
|
|
4209
|
-
}
|
|
4210
|
-
pause() {
|
|
4211
|
-
this[v] = false, this[dt] = true, this[M] = false;
|
|
4212
|
-
}
|
|
4213
|
-
get destroyed() {
|
|
4214
|
-
return this[x];
|
|
4215
|
-
}
|
|
4216
|
-
get flowing() {
|
|
4217
|
-
return this[v];
|
|
4218
|
-
}
|
|
4219
|
-
get paused() {
|
|
4220
|
-
return this[dt];
|
|
4221
|
-
}
|
|
4222
|
-
[Yt](t) {
|
|
4223
|
-
this[k] ? this[T] += 1 : this[T] += t.length, this[C].push(t);
|
|
4224
|
-
}
|
|
4225
|
-
[Ft]() {
|
|
4226
|
-
return this[k] ? this[T] -= 1 : this[T] -= this[C][0].length, this[C].shift();
|
|
4227
|
-
}
|
|
4228
|
-
[Ot](t = false) {
|
|
4229
|
-
do
|
|
4230
|
-
;
|
|
4231
|
-
while (this[Le](this[Ft]()) && this[C].length);
|
|
4232
|
-
!t && !this[C].length && !this[G] && this.emit("drain");
|
|
4233
|
-
}
|
|
4234
|
-
[Le](t) {
|
|
4235
|
-
return this.emit("data", t), this[v];
|
|
4236
|
-
}
|
|
4237
|
-
pipe(t, e) {
|
|
4238
|
-
if (this[x]) return t;
|
|
4239
|
-
this[M] = false;
|
|
4240
|
-
let s = this[K];
|
|
4241
|
-
return e = e || {}, t === Ne.stdout || t === Ne.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, s ? e.end && t.end() : (this[F].push(e.proxyErrors ? new te(this, t, e) : new Mt(this, t, e)), this[B] ? mt(() => this[st]()) : this[st]()), t;
|
|
4242
|
-
}
|
|
4243
|
-
unpipe(t) {
|
|
4244
|
-
let e = this[F].find((s) => s.dest === t);
|
|
4245
|
-
e && (this[F].length === 1 ? (this[v] && this[Y] === 0 && (this[v] = false), this[F] = []) : this[F].splice(this[F].indexOf(e), 1), e.unpipe());
|
|
4246
|
-
}
|
|
4247
|
-
addListener(t, e) {
|
|
4248
|
-
return this.on(t, e);
|
|
4249
|
-
}
|
|
4250
|
-
on(t, e) {
|
|
4251
|
-
let s = super.on(t, e);
|
|
4252
|
-
if (t === "data") this[M] = false, this[Y]++, !this[F].length && !this[v] && this[st]();
|
|
4253
|
-
else if (t === "readable" && this[T] !== 0) super.emit("readable");
|
|
4254
|
-
else if (ci(t) && this[K]) super.emit(t), this.removeAllListeners(t);
|
|
4255
|
-
else if (t === "error" && this[ut]) {
|
|
4256
|
-
let i = e;
|
|
4257
|
-
this[B] ? mt(() => i.call(this, this[ut])) : i.call(this, this[ut]);
|
|
4258
|
-
}
|
|
4259
|
-
return s;
|
|
4260
|
-
}
|
|
4261
|
-
removeListener(t, e) {
|
|
4262
|
-
return this.off(t, e);
|
|
4263
|
-
}
|
|
4264
|
-
off(t, e) {
|
|
4265
|
-
let s = super.off(t, e);
|
|
4266
|
-
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M] && !this[F].length && (this[v] = false)), s;
|
|
4267
|
-
}
|
|
4268
|
-
removeAllListeners(t) {
|
|
4269
|
-
let e = super.removeAllListeners(t);
|
|
4270
|
-
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M] && !this[F].length && (this[v] = false)), e;
|
|
4271
|
-
}
|
|
4272
|
-
get emittedEnd() {
|
|
4273
|
-
return this[K];
|
|
4274
|
-
}
|
|
4275
|
-
[H]() {
|
|
4276
|
-
!this[kt] && !this[K] && !this[x] && this[C].length === 0 && this[G] && (this[kt] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Rt] && this.emit("close"), this[kt] = false);
|
|
4277
|
-
}
|
|
4278
|
-
emit(t, ...e) {
|
|
4279
|
-
let s = e[0];
|
|
4280
|
-
if (t !== "error" && t !== "close" && t !== x && this[x]) return false;
|
|
4281
|
-
if (t === "data") return !this[k] && !s ? false : this[B] ? (mt(() => this[Jt](s)), true) : this[Jt](s);
|
|
4282
|
-
if (t === "end") return this[We]();
|
|
4283
|
-
if (t === "close") {
|
|
4284
|
-
if (this[Rt] = true, !this[K] && !this[x]) return false;
|
|
4285
|
-
let r = super.emit("close");
|
|
4286
|
-
return this.removeAllListeners("close"), r;
|
|
4287
|
-
} else if (t === "error") {
|
|
4288
|
-
this[ut] = s, super.emit(Xt, s);
|
|
4289
|
-
let r = !this[pt] || this.listeners("error").length ? super.emit("error", s) : false;
|
|
4290
|
-
return this[H](), r;
|
|
4291
|
-
} else if (t === "resume") {
|
|
4292
|
-
let r = super.emit("resume");
|
|
4293
|
-
return this[H](), r;
|
|
4294
|
-
} else if (t === "finish" || t === "prefinish") {
|
|
4295
|
-
let r = super.emit(t);
|
|
4296
|
-
return this.removeAllListeners(t), r;
|
|
4297
|
-
}
|
|
4298
|
-
let i = super.emit(t, ...e);
|
|
4299
|
-
return this[H](), i;
|
|
4300
|
-
}
|
|
4301
|
-
[Jt](t) {
|
|
4302
|
-
for (let s of this[F]) s.dest.write(t) === false && this.pause();
|
|
4303
|
-
let e = this[M] ? false : super.emit("data", t);
|
|
4304
|
-
return this[H](), e;
|
|
4305
|
-
}
|
|
4306
|
-
[We]() {
|
|
4307
|
-
return this[K] ? false : (this[K] = true, this.readable = false, this[B] ? (mt(() => this[Zt]()), true) : this[Zt]());
|
|
4308
|
-
}
|
|
4309
|
-
[Zt]() {
|
|
4310
|
-
if (this[et]) {
|
|
4311
|
-
let e = this[et].end();
|
|
4312
|
-
if (e) {
|
|
4313
|
-
for (let s of this[F]) s.dest.write(e);
|
|
4314
|
-
this[M] || super.emit("data", e);
|
|
4315
|
-
}
|
|
4316
|
-
}
|
|
4317
|
-
for (let e of this[F]) e.end();
|
|
4318
|
-
let t = super.emit("end");
|
|
4319
|
-
return this.removeAllListeners("end"), t;
|
|
4320
|
-
}
|
|
4321
|
-
async collect() {
|
|
4322
|
-
let t = Object.assign([], { dataLength: 0 });
|
|
4323
|
-
this[k] || (t.dataLength = 0);
|
|
4324
|
-
let e = this.promise();
|
|
4325
|
-
return this.on("data", (s) => {
|
|
4326
|
-
t.push(s), this[k] || (t.dataLength += s.length);
|
|
4327
|
-
}), await e, t;
|
|
4328
|
-
}
|
|
4329
|
-
async concat() {
|
|
4330
|
-
if (this[k]) throw new Error("cannot concat in objectMode");
|
|
4331
|
-
let t = await this.collect();
|
|
4332
|
-
return this[P] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
4333
|
-
}
|
|
4334
|
-
async promise() {
|
|
4335
|
-
return new Promise((t, e) => {
|
|
4336
|
-
this.on(x, () => e(new Error("stream destroyed"))), this.on("error", (s) => e(s)), this.on("end", () => t());
|
|
4337
|
-
});
|
|
4338
|
-
}
|
|
4339
|
-
[Symbol.asyncIterator]() {
|
|
4340
|
-
this[M] = false;
|
|
4341
|
-
let t = false, e = async () => (this.pause(), t = true, { value: void 0, done: true });
|
|
4342
|
-
return { next: () => {
|
|
4343
|
-
if (t) return e();
|
|
4344
|
-
let i = this.read();
|
|
4345
|
-
if (i !== null) return Promise.resolve({ done: false, value: i });
|
|
4346
|
-
if (this[G]) return e();
|
|
4347
|
-
let r, o, h = (c) => {
|
|
4348
|
-
this.off("data", a), this.off("end", l), this.off(x, u), e(), o(c);
|
|
4349
|
-
}, a = (c) => {
|
|
4350
|
-
this.off("error", h), this.off("end", l), this.off(x, u), this.pause(), r({ value: c, done: !!this[G] });
|
|
4351
|
-
}, l = () => {
|
|
4352
|
-
this.off("error", h), this.off("data", a), this.off(x, u), e(), r({ done: true, value: void 0 });
|
|
4353
|
-
}, u = () => h(new Error("stream destroyed"));
|
|
4354
|
-
return new Promise((c, d) => {
|
|
4355
|
-
o = d, r = c, this.once(x, u), this.once("error", h), this.once("end", l), this.once("data", a);
|
|
4356
|
-
});
|
|
4357
|
-
}, throw: e, return: e, [Symbol.asyncIterator]() {
|
|
4358
|
-
return this;
|
|
4359
|
-
}, [Symbol.asyncDispose]: async () => {
|
|
4360
|
-
} };
|
|
4361
|
-
}
|
|
4362
|
-
[Symbol.iterator]() {
|
|
4363
|
-
this[M] = false;
|
|
4364
|
-
let t = false, e = () => (this.pause(), this.off(Xt, e), this.off(x, e), this.off("end", e), t = true, { done: true, value: void 0 }), s = () => {
|
|
4365
|
-
if (t) return e();
|
|
4366
|
-
let i = this.read();
|
|
4367
|
-
return i === null ? e() : { done: false, value: i };
|
|
4368
|
-
};
|
|
4369
|
-
return this.once("end", e), this.once(Xt, e), this.once(x, e), { next: s, throw: e, return: e, [Symbol.iterator]() {
|
|
4370
|
-
return this;
|
|
4371
|
-
}, [Symbol.dispose]: () => {
|
|
4372
|
-
} };
|
|
4373
|
-
}
|
|
4374
|
-
destroy(t) {
|
|
4375
|
-
if (this[x]) return t ? this.emit("error", t) : this.emit(x), this;
|
|
4376
|
-
this[x] = true, this[M] = true, this[C].length = 0, this[T] = 0;
|
|
4377
|
-
let e = this;
|
|
4378
|
-
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(x), this;
|
|
4379
|
-
}
|
|
4380
|
-
static get isStream() {
|
|
4381
|
-
return oi;
|
|
4382
|
-
}
|
|
4383
|
-
};
|
|
4384
|
-
var vi = Ei.native;
|
|
4385
|
-
var wt = { lstatSync: wi, readdir: yi, readdirSync: bi, readlinkSync: Si, realpathSync: vi, promises: { lstat: Ci, readdir: Ti, readlink: Ai, realpath: ki } };
|
|
4386
|
-
var Ue = (n7) => !n7 || n7 === wt || n7 === xi ? wt : { ...wt, ...n7, promises: { ...wt.promises, ...n7.promises || {} } };
|
|
4387
|
-
var $e = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
4388
|
-
var Ri = (n7) => n7.replace(/\//g, "\\").replace($e, "$1\\");
|
|
4389
|
-
var Oi = /[\\\/]/;
|
|
4390
|
-
var L = 0;
|
|
4391
|
-
var Ge = 1;
|
|
4392
|
-
var He = 2;
|
|
4393
|
-
var U = 4;
|
|
4394
|
-
var qe = 6;
|
|
4395
|
-
var Ke = 8;
|
|
4396
|
-
var X = 10;
|
|
4397
|
-
var Ve = 12;
|
|
4398
|
-
var _ = 15;
|
|
4399
|
-
var gt = ~_;
|
|
4400
|
-
var se = 16;
|
|
4401
|
-
var je = 32;
|
|
4402
|
-
var yt = 64;
|
|
4403
|
-
var j = 128;
|
|
4404
|
-
var Nt = 256;
|
|
4405
|
-
var Lt = 512;
|
|
4406
|
-
var Ie = yt | j | Lt;
|
|
4407
|
-
var Fi = 1023;
|
|
4408
|
-
var ie = (n7) => n7.isFile() ? Ke : n7.isDirectory() ? U : n7.isSymbolicLink() ? X : n7.isCharacterDevice() ? He : n7.isBlockDevice() ? qe : n7.isSocket() ? Ve : n7.isFIFO() ? Ge : L;
|
|
4409
|
-
var ze = new ft({ max: 2 ** 12 });
|
|
4410
|
-
var bt = (n7) => {
|
|
4411
|
-
let t = ze.get(n7);
|
|
4412
|
-
if (t) return t;
|
|
4413
|
-
let e = n7.normalize("NFKD");
|
|
4414
|
-
return ze.set(n7, e), e;
|
|
4415
|
-
};
|
|
4416
|
-
var Be = new ft({ max: 2 ** 12 });
|
|
4417
|
-
var _t = (n7) => {
|
|
4418
|
-
let t = Be.get(n7);
|
|
4419
|
-
if (t) return t;
|
|
4420
|
-
let e = bt(n7.toLowerCase());
|
|
4421
|
-
return Be.set(n7, e), e;
|
|
4422
|
-
};
|
|
4423
|
-
var Wt = class extends ft {
|
|
4424
|
-
constructor() {
|
|
4425
|
-
super({ max: 256 });
|
|
4426
|
-
}
|
|
4427
|
-
};
|
|
4428
|
-
var ne = class extends ft {
|
|
4429
|
-
constructor(t = 16 * 1024) {
|
|
4430
|
-
super({ maxSize: t, sizeCalculation: (e) => e.length + 1 });
|
|
4431
|
-
}
|
|
4432
|
-
};
|
|
4433
|
-
var Ye = /* @__PURE__ */ Symbol("PathScurry setAsCwd");
|
|
4434
|
-
var R = class {
|
|
4435
|
-
name;
|
|
4436
|
-
root;
|
|
4437
|
-
roots;
|
|
4438
|
-
parent;
|
|
4439
|
-
nocase;
|
|
4440
|
-
isCWD = false;
|
|
4441
|
-
#t;
|
|
4442
|
-
#s;
|
|
4443
|
-
get dev() {
|
|
4444
|
-
return this.#s;
|
|
4445
|
-
}
|
|
4446
|
-
#n;
|
|
4447
|
-
get mode() {
|
|
4448
|
-
return this.#n;
|
|
4449
|
-
}
|
|
4450
|
-
#r;
|
|
4451
|
-
get nlink() {
|
|
4452
|
-
return this.#r;
|
|
4453
|
-
}
|
|
4454
|
-
#o;
|
|
4455
|
-
get uid() {
|
|
4456
|
-
return this.#o;
|
|
4457
|
-
}
|
|
4458
|
-
#S;
|
|
4459
|
-
get gid() {
|
|
4460
|
-
return this.#S;
|
|
4461
|
-
}
|
|
4462
|
-
#w;
|
|
4463
|
-
get rdev() {
|
|
4464
|
-
return this.#w;
|
|
4465
|
-
}
|
|
4466
|
-
#c;
|
|
4467
|
-
get blksize() {
|
|
4468
|
-
return this.#c;
|
|
4469
|
-
}
|
|
4470
|
-
#h;
|
|
4471
|
-
get ino() {
|
|
4472
|
-
return this.#h;
|
|
4473
|
-
}
|
|
4474
|
-
#u;
|
|
4475
|
-
get size() {
|
|
4476
|
-
return this.#u;
|
|
4477
|
-
}
|
|
4478
|
-
#f;
|
|
4479
|
-
get blocks() {
|
|
4480
|
-
return this.#f;
|
|
4481
|
-
}
|
|
4482
|
-
#a;
|
|
4483
|
-
get atimeMs() {
|
|
4484
|
-
return this.#a;
|
|
4485
|
-
}
|
|
4486
|
-
#i;
|
|
4487
|
-
get mtimeMs() {
|
|
4488
|
-
return this.#i;
|
|
4489
|
-
}
|
|
4490
|
-
#d;
|
|
4491
|
-
get ctimeMs() {
|
|
4492
|
-
return this.#d;
|
|
4493
|
-
}
|
|
4494
|
-
#E;
|
|
4495
|
-
get birthtimeMs() {
|
|
4496
|
-
return this.#E;
|
|
4497
|
-
}
|
|
4498
|
-
#b;
|
|
4499
|
-
get atime() {
|
|
4500
|
-
return this.#b;
|
|
4501
|
-
}
|
|
4502
|
-
#p;
|
|
4503
|
-
get mtime() {
|
|
4504
|
-
return this.#p;
|
|
4505
|
-
}
|
|
4506
|
-
#R;
|
|
4507
|
-
get ctime() {
|
|
4508
|
-
return this.#R;
|
|
4509
|
-
}
|
|
4510
|
-
#m;
|
|
4511
|
-
get birthtime() {
|
|
4512
|
-
return this.#m;
|
|
4513
|
-
}
|
|
4514
|
-
#C;
|
|
4515
|
-
#T;
|
|
4516
|
-
#g;
|
|
4517
|
-
#y;
|
|
4518
|
-
#x;
|
|
4519
|
-
#A;
|
|
4520
|
-
#e;
|
|
4521
|
-
#_;
|
|
4522
|
-
#M;
|
|
4523
|
-
#k;
|
|
4524
|
-
get parentPath() {
|
|
4525
|
-
return (this.parent || this).fullpath();
|
|
4526
|
-
}
|
|
4527
|
-
get path() {
|
|
4528
|
-
return this.parentPath;
|
|
4529
|
-
}
|
|
4530
|
-
constructor(t, e = L, s, i, r, o, h) {
|
|
4531
|
-
this.name = t, this.#C = r ? _t(t) : bt(t), this.#e = e & Fi, this.nocase = r, this.roots = i, this.root = s || this, this.#_ = o, this.#g = h.fullpath, this.#x = h.relative, this.#A = h.relativePosix, this.parent = h.parent, this.parent ? this.#t = this.parent.#t : this.#t = Ue(h.fs);
|
|
4532
|
-
}
|
|
4533
|
-
depth() {
|
|
4534
|
-
return this.#T !== void 0 ? this.#T : this.parent ? this.#T = this.parent.depth() + 1 : this.#T = 0;
|
|
4535
|
-
}
|
|
4536
|
-
childrenCache() {
|
|
4537
|
-
return this.#_;
|
|
4538
|
-
}
|
|
4539
|
-
resolve(t) {
|
|
4540
|
-
if (!t) return this;
|
|
4541
|
-
let e = this.getRootString(t), i = t.substring(e.length).split(this.splitSep);
|
|
4542
|
-
return e ? this.getRoot(e).#N(i) : this.#N(i);
|
|
4543
|
-
}
|
|
4544
|
-
#N(t) {
|
|
4545
|
-
let e = this;
|
|
4546
|
-
for (let s of t) e = e.child(s);
|
|
4547
|
-
return e;
|
|
4548
|
-
}
|
|
4549
|
-
children() {
|
|
4550
|
-
let t = this.#_.get(this);
|
|
4551
|
-
if (t) return t;
|
|
4552
|
-
let e = Object.assign([], { provisional: 0 });
|
|
4553
|
-
return this.#_.set(this, e), this.#e &= ~se, e;
|
|
4554
|
-
}
|
|
4555
|
-
child(t, e) {
|
|
4556
|
-
if (t === "" || t === ".") return this;
|
|
4557
|
-
if (t === "..") return this.parent || this;
|
|
4558
|
-
let s = this.children(), i = this.nocase ? _t(t) : bt(t);
|
|
4559
|
-
for (let a of s) if (a.#C === i) return a;
|
|
4560
|
-
let r = this.parent ? this.sep : "", o = this.#g ? this.#g + r + t : void 0, h = this.newChild(t, L, { ...e, parent: this, fullpath: o });
|
|
4561
|
-
return this.canReaddir() || (h.#e |= j), s.push(h), h;
|
|
4562
|
-
}
|
|
4563
|
-
relative() {
|
|
4564
|
-
if (this.isCWD) return "";
|
|
4565
|
-
if (this.#x !== void 0) return this.#x;
|
|
4566
|
-
let t = this.name, e = this.parent;
|
|
4567
|
-
if (!e) return this.#x = this.name;
|
|
4568
|
-
let s = e.relative();
|
|
4569
|
-
return s + (!s || !e.parent ? "" : this.sep) + t;
|
|
4570
|
-
}
|
|
4571
|
-
relativePosix() {
|
|
4572
|
-
if (this.sep === "/") return this.relative();
|
|
4573
|
-
if (this.isCWD) return "";
|
|
4574
|
-
if (this.#A !== void 0) return this.#A;
|
|
4575
|
-
let t = this.name, e = this.parent;
|
|
4576
|
-
if (!e) return this.#A = this.fullpathPosix();
|
|
4577
|
-
let s = e.relativePosix();
|
|
4578
|
-
return s + (!s || !e.parent ? "" : "/") + t;
|
|
4579
|
-
}
|
|
4580
|
-
fullpath() {
|
|
4581
|
-
if (this.#g !== void 0) return this.#g;
|
|
4582
|
-
let t = this.name, e = this.parent;
|
|
4583
|
-
if (!e) return this.#g = this.name;
|
|
4584
|
-
let i = e.fullpath() + (e.parent ? this.sep : "") + t;
|
|
4585
|
-
return this.#g = i;
|
|
4586
|
-
}
|
|
4587
|
-
fullpathPosix() {
|
|
4588
|
-
if (this.#y !== void 0) return this.#y;
|
|
4589
|
-
if (this.sep === "/") return this.#y = this.fullpath();
|
|
4590
|
-
if (!this.parent) {
|
|
4591
|
-
let i = this.fullpath().replace(/\\/g, "/");
|
|
4592
|
-
return /^[a-z]:\//i.test(i) ? this.#y = `//?/${i}` : this.#y = i;
|
|
4593
|
-
}
|
|
4594
|
-
let t = this.parent, e = t.fullpathPosix(), s = e + (!e || !t.parent ? "" : "/") + this.name;
|
|
4595
|
-
return this.#y = s;
|
|
4596
|
-
}
|
|
4597
|
-
isUnknown() {
|
|
4598
|
-
return (this.#e & _) === L;
|
|
4599
|
-
}
|
|
4600
|
-
isType(t) {
|
|
4601
|
-
return this[`is${t}`]();
|
|
4602
|
-
}
|
|
4603
|
-
getType() {
|
|
4604
|
-
return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : this.isSocket() ? "Socket" : "Unknown";
|
|
4605
|
-
}
|
|
4606
|
-
isFile() {
|
|
4607
|
-
return (this.#e & _) === Ke;
|
|
4608
|
-
}
|
|
4609
|
-
isDirectory() {
|
|
4610
|
-
return (this.#e & _) === U;
|
|
4611
|
-
}
|
|
4612
|
-
isCharacterDevice() {
|
|
4613
|
-
return (this.#e & _) === He;
|
|
4614
|
-
}
|
|
4615
|
-
isBlockDevice() {
|
|
4616
|
-
return (this.#e & _) === qe;
|
|
4617
|
-
}
|
|
4618
|
-
isFIFO() {
|
|
4619
|
-
return (this.#e & _) === Ge;
|
|
4620
|
-
}
|
|
4621
|
-
isSocket() {
|
|
4622
|
-
return (this.#e & _) === Ve;
|
|
4623
|
-
}
|
|
4624
|
-
isSymbolicLink() {
|
|
4625
|
-
return (this.#e & X) === X;
|
|
4626
|
-
}
|
|
4627
|
-
lstatCached() {
|
|
4628
|
-
return this.#e & je ? this : void 0;
|
|
4629
|
-
}
|
|
4630
|
-
readlinkCached() {
|
|
4631
|
-
return this.#M;
|
|
4632
|
-
}
|
|
4633
|
-
realpathCached() {
|
|
4634
|
-
return this.#k;
|
|
4635
|
-
}
|
|
4636
|
-
readdirCached() {
|
|
4637
|
-
let t = this.children();
|
|
4638
|
-
return t.slice(0, t.provisional);
|
|
4639
|
-
}
|
|
4640
|
-
canReadlink() {
|
|
4641
|
-
if (this.#M) return true;
|
|
4642
|
-
if (!this.parent) return false;
|
|
4643
|
-
let t = this.#e & _;
|
|
4644
|
-
return !(t !== L && t !== X || this.#e & Nt || this.#e & j);
|
|
4645
|
-
}
|
|
4646
|
-
calledReaddir() {
|
|
4647
|
-
return !!(this.#e & se);
|
|
4648
|
-
}
|
|
4649
|
-
isENOENT() {
|
|
4650
|
-
return !!(this.#e & j);
|
|
4651
|
-
}
|
|
4652
|
-
isNamed(t) {
|
|
4653
|
-
return this.nocase ? this.#C === _t(t) : this.#C === bt(t);
|
|
4654
|
-
}
|
|
4655
|
-
async readlink() {
|
|
4656
|
-
let t = this.#M;
|
|
4657
|
-
if (t) return t;
|
|
4658
|
-
if (this.canReadlink() && this.parent) try {
|
|
4659
|
-
let e = await this.#t.promises.readlink(this.fullpath()), s = (await this.parent.realpath())?.resolve(e);
|
|
4660
|
-
if (s) return this.#M = s;
|
|
4661
|
-
} catch (e) {
|
|
4662
|
-
this.#D(e.code);
|
|
4663
|
-
return;
|
|
4664
|
-
}
|
|
4665
|
-
}
|
|
4666
|
-
readlinkSync() {
|
|
4667
|
-
let t = this.#M;
|
|
4668
|
-
if (t) return t;
|
|
4669
|
-
if (this.canReadlink() && this.parent) try {
|
|
4670
|
-
let e = this.#t.readlinkSync(this.fullpath()), s = this.parent.realpathSync()?.resolve(e);
|
|
4671
|
-
if (s) return this.#M = s;
|
|
4672
|
-
} catch (e) {
|
|
4673
|
-
this.#D(e.code);
|
|
4674
|
-
return;
|
|
4675
|
-
}
|
|
4676
|
-
}
|
|
4677
|
-
#j(t) {
|
|
4678
|
-
this.#e |= se;
|
|
4679
|
-
for (let e = t.provisional; e < t.length; e++) {
|
|
4680
|
-
let s = t[e];
|
|
4681
|
-
s && s.#v();
|
|
4682
|
-
}
|
|
4683
|
-
}
|
|
4684
|
-
#v() {
|
|
4685
|
-
this.#e & j || (this.#e = (this.#e | j) & gt, this.#G());
|
|
4686
|
-
}
|
|
4687
|
-
#G() {
|
|
4688
|
-
let t = this.children();
|
|
4689
|
-
t.provisional = 0;
|
|
4690
|
-
for (let e of t) e.#v();
|
|
4691
|
-
}
|
|
4692
|
-
#P() {
|
|
4693
|
-
this.#e |= Lt, this.#L();
|
|
4694
|
-
}
|
|
4695
|
-
#L() {
|
|
4696
|
-
if (this.#e & yt) return;
|
|
4697
|
-
let t = this.#e;
|
|
4698
|
-
(t & _) === U && (t &= gt), this.#e = t | yt, this.#G();
|
|
4699
|
-
}
|
|
4700
|
-
#I(t = "") {
|
|
4701
|
-
t === "ENOTDIR" || t === "EPERM" ? this.#L() : t === "ENOENT" ? this.#v() : this.children().provisional = 0;
|
|
4702
|
-
}
|
|
4703
|
-
#F(t = "") {
|
|
4704
|
-
t === "ENOTDIR" ? this.parent.#L() : t === "ENOENT" && this.#v();
|
|
4705
|
-
}
|
|
4706
|
-
#D(t = "") {
|
|
4707
|
-
let e = this.#e;
|
|
4708
|
-
e |= Nt, t === "ENOENT" && (e |= j), (t === "EINVAL" || t === "UNKNOWN") && (e &= gt), this.#e = e, t === "ENOTDIR" && this.parent && this.parent.#L();
|
|
4709
|
-
}
|
|
4710
|
-
#z(t, e) {
|
|
4711
|
-
return this.#U(t, e) || this.#B(t, e);
|
|
4712
|
-
}
|
|
4713
|
-
#B(t, e) {
|
|
4714
|
-
let s = ie(t), i = this.newChild(t.name, s, { parent: this }), r = i.#e & _;
|
|
4715
|
-
return r !== U && r !== X && r !== L && (i.#e |= yt), e.unshift(i), e.provisional++, i;
|
|
4716
|
-
}
|
|
4717
|
-
#U(t, e) {
|
|
4718
|
-
for (let s = e.provisional; s < e.length; s++) {
|
|
4719
|
-
let i = e[s];
|
|
4720
|
-
if ((this.nocase ? _t(t.name) : bt(t.name)) === i.#C) return this.#l(t, i, s, e);
|
|
4721
|
-
}
|
|
4722
|
-
}
|
|
4723
|
-
#l(t, e, s, i) {
|
|
4724
|
-
let r = e.name;
|
|
4725
|
-
return e.#e = e.#e & gt | ie(t), r !== t.name && (e.name = t.name), s !== i.provisional && (s === i.length - 1 ? i.pop() : i.splice(s, 1), i.unshift(e)), i.provisional++, e;
|
|
4726
|
-
}
|
|
4727
|
-
async lstat() {
|
|
4728
|
-
if ((this.#e & j) === 0) try {
|
|
4729
|
-
return this.#$(await this.#t.promises.lstat(this.fullpath())), this;
|
|
4730
|
-
} catch (t) {
|
|
4731
|
-
this.#F(t.code);
|
|
4732
|
-
}
|
|
4733
|
-
}
|
|
4734
|
-
lstatSync() {
|
|
4735
|
-
if ((this.#e & j) === 0) try {
|
|
4736
|
-
return this.#$(this.#t.lstatSync(this.fullpath())), this;
|
|
4737
|
-
} catch (t) {
|
|
4738
|
-
this.#F(t.code);
|
|
4739
|
-
}
|
|
4740
|
-
}
|
|
4741
|
-
#$(t) {
|
|
4742
|
-
let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: o, blocks: h, ctime: a, ctimeMs: l, dev: u, gid: c, ino: d, mode: f, mtime: m, mtimeMs: p, nlink: w, rdev: g, size: S, uid: E } = t;
|
|
4743
|
-
this.#b = e, this.#a = s, this.#m = i, this.#E = r, this.#c = o, this.#f = h, this.#R = a, this.#d = l, this.#s = u, this.#S = c, this.#h = d, this.#n = f, this.#p = m, this.#i = p, this.#r = w, this.#w = g, this.#u = S, this.#o = E;
|
|
4744
|
-
let y = ie(t);
|
|
4745
|
-
this.#e = this.#e & gt | y | je, y !== L && y !== U && y !== X && (this.#e |= yt);
|
|
4746
|
-
}
|
|
4747
|
-
#W = [];
|
|
4748
|
-
#O = false;
|
|
4749
|
-
#H(t) {
|
|
4750
|
-
this.#O = false;
|
|
4751
|
-
let e = this.#W.slice();
|
|
4752
|
-
this.#W.length = 0, e.forEach((s) => s(null, t));
|
|
4753
|
-
}
|
|
4754
|
-
readdirCB(t, e = false) {
|
|
4755
|
-
if (!this.canReaddir()) {
|
|
4756
|
-
e ? t(null, []) : queueMicrotask(() => t(null, []));
|
|
4757
|
-
return;
|
|
4758
|
-
}
|
|
4759
|
-
let s = this.children();
|
|
4760
|
-
if (this.calledReaddir()) {
|
|
4761
|
-
let r = s.slice(0, s.provisional);
|
|
4762
|
-
e ? t(null, r) : queueMicrotask(() => t(null, r));
|
|
4763
|
-
return;
|
|
4764
|
-
}
|
|
4765
|
-
if (this.#W.push(t), this.#O) return;
|
|
4766
|
-
this.#O = true;
|
|
4767
|
-
let i = this.fullpath();
|
|
4768
|
-
this.#t.readdir(i, { withFileTypes: true }, (r, o) => {
|
|
4769
|
-
if (r) this.#I(r.code), s.provisional = 0;
|
|
4770
|
-
else {
|
|
4771
|
-
for (let h of o) this.#z(h, s);
|
|
4772
|
-
this.#j(s);
|
|
4773
|
-
}
|
|
4774
|
-
this.#H(s.slice(0, s.provisional));
|
|
4775
|
-
});
|
|
4776
|
-
}
|
|
4777
|
-
#q;
|
|
4778
|
-
async readdir() {
|
|
4779
|
-
if (!this.canReaddir()) return [];
|
|
4780
|
-
let t = this.children();
|
|
4781
|
-
if (this.calledReaddir()) return t.slice(0, t.provisional);
|
|
4782
|
-
let e = this.fullpath();
|
|
4783
|
-
if (this.#q) await this.#q;
|
|
4784
|
-
else {
|
|
4785
|
-
let s = () => {
|
|
4786
|
-
};
|
|
4787
|
-
this.#q = new Promise((i) => s = i);
|
|
4788
|
-
try {
|
|
4789
|
-
for (let i of await this.#t.promises.readdir(e, { withFileTypes: true })) this.#z(i, t);
|
|
4790
|
-
this.#j(t);
|
|
4791
|
-
} catch (i) {
|
|
4792
|
-
this.#I(i.code), t.provisional = 0;
|
|
4793
|
-
}
|
|
4794
|
-
this.#q = void 0, s();
|
|
4795
|
-
}
|
|
4796
|
-
return t.slice(0, t.provisional);
|
|
4797
|
-
}
|
|
4798
|
-
readdirSync() {
|
|
4799
|
-
if (!this.canReaddir()) return [];
|
|
4800
|
-
let t = this.children();
|
|
4801
|
-
if (this.calledReaddir()) return t.slice(0, t.provisional);
|
|
4802
|
-
let e = this.fullpath();
|
|
4803
|
-
try {
|
|
4804
|
-
for (let s of this.#t.readdirSync(e, { withFileTypes: true })) this.#z(s, t);
|
|
4805
|
-
this.#j(t);
|
|
4806
|
-
} catch (s) {
|
|
4807
|
-
this.#I(s.code), t.provisional = 0;
|
|
4808
|
-
}
|
|
4809
|
-
return t.slice(0, t.provisional);
|
|
4810
|
-
}
|
|
4811
|
-
canReaddir() {
|
|
4812
|
-
if (this.#e & Ie) return false;
|
|
4813
|
-
let t = _ & this.#e;
|
|
4814
|
-
return t === L || t === U || t === X;
|
|
4815
|
-
}
|
|
4816
|
-
shouldWalk(t, e) {
|
|
4817
|
-
return (this.#e & U) === U && !(this.#e & Ie) && !t.has(this) && (!e || e(this));
|
|
4818
|
-
}
|
|
4819
|
-
async realpath() {
|
|
4820
|
-
if (this.#k) return this.#k;
|
|
4821
|
-
if (!((Lt | Nt | j) & this.#e)) try {
|
|
4822
|
-
let t = await this.#t.promises.realpath(this.fullpath());
|
|
4823
|
-
return this.#k = this.resolve(t);
|
|
4824
|
-
} catch {
|
|
4825
|
-
this.#P();
|
|
4826
|
-
}
|
|
4827
|
-
}
|
|
4828
|
-
realpathSync() {
|
|
4829
|
-
if (this.#k) return this.#k;
|
|
4830
|
-
if (!((Lt | Nt | j) & this.#e)) try {
|
|
4831
|
-
let t = this.#t.realpathSync(this.fullpath());
|
|
4832
|
-
return this.#k = this.resolve(t);
|
|
4833
|
-
} catch {
|
|
4834
|
-
this.#P();
|
|
4835
|
-
}
|
|
4836
|
-
}
|
|
4837
|
-
[Ye](t) {
|
|
4838
|
-
if (t === this) return;
|
|
4839
|
-
t.isCWD = false, this.isCWD = true;
|
|
4840
|
-
let e = /* @__PURE__ */ new Set([]), s = [], i = this;
|
|
4841
|
-
for (; i && i.parent; ) e.add(i), i.#x = s.join(this.sep), i.#A = s.join("/"), i = i.parent, s.push("..");
|
|
4842
|
-
for (i = t; i && i.parent && !e.has(i); ) i.#x = void 0, i.#A = void 0, i = i.parent;
|
|
4843
|
-
}
|
|
4844
|
-
};
|
|
4845
|
-
var Pt = class n2 extends R {
|
|
4846
|
-
sep = "\\";
|
|
4847
|
-
splitSep = Oi;
|
|
4848
|
-
constructor(t, e = L, s, i, r, o, h) {
|
|
4849
|
-
super(t, e, s, i, r, o, h);
|
|
4850
|
-
}
|
|
4851
|
-
newChild(t, e = L, s = {}) {
|
|
4852
|
-
return new n2(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
4853
|
-
}
|
|
4854
|
-
getRootString(t) {
|
|
4855
|
-
return re.parse(t).root;
|
|
4856
|
-
}
|
|
4857
|
-
getRoot(t) {
|
|
4858
|
-
if (t = Ri(t.toUpperCase()), t === this.root.name) return this.root;
|
|
4859
|
-
for (let [e, s] of Object.entries(this.roots)) if (this.sameRoot(t, e)) return this.roots[t] = s;
|
|
4860
|
-
return this.roots[t] = new it(t, this).root;
|
|
4861
|
-
}
|
|
4862
|
-
sameRoot(t, e = this.root.name) {
|
|
4863
|
-
return t = t.toUpperCase().replace(/\//g, "\\").replace($e, "$1\\"), t === e;
|
|
4864
|
-
}
|
|
4865
|
-
};
|
|
4866
|
-
var jt = class n3 extends R {
|
|
4867
|
-
splitSep = "/";
|
|
4868
|
-
sep = "/";
|
|
4869
|
-
constructor(t, e = L, s, i, r, o, h) {
|
|
4870
|
-
super(t, e, s, i, r, o, h);
|
|
4871
|
-
}
|
|
4872
|
-
getRootString(t) {
|
|
4873
|
-
return t.startsWith("/") ? "/" : "";
|
|
4874
|
-
}
|
|
4875
|
-
getRoot(t) {
|
|
4876
|
-
return this.root;
|
|
4877
|
-
}
|
|
4878
|
-
newChild(t, e = L, s = {}) {
|
|
4879
|
-
return new n3(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
4880
|
-
}
|
|
4881
|
-
};
|
|
4882
|
-
var It = class {
|
|
4883
|
-
root;
|
|
4884
|
-
rootPath;
|
|
4885
|
-
roots;
|
|
4886
|
-
cwd;
|
|
4887
|
-
#t;
|
|
4888
|
-
#s;
|
|
4889
|
-
#n;
|
|
4890
|
-
nocase;
|
|
4891
|
-
#r;
|
|
4892
|
-
constructor(t = process.cwd(), e, s, { nocase: i, childrenCacheSize: r = 16 * 1024, fs: o = wt } = {}) {
|
|
4893
|
-
this.#r = Ue(o), (t instanceof URL || t.startsWith("file://")) && (t = gi(t));
|
|
4894
|
-
let h = e.resolve(t);
|
|
4895
|
-
this.roots = /* @__PURE__ */ Object.create(null), this.rootPath = this.parseRootPath(h), this.#t = new Wt(), this.#s = new Wt(), this.#n = new ne(r);
|
|
4896
|
-
let a = h.substring(this.rootPath.length).split(s);
|
|
4897
|
-
if (a.length === 1 && !a[0] && a.pop(), i === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor");
|
|
4898
|
-
this.nocase = i, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root;
|
|
4899
|
-
let l = this.root, u = a.length - 1, c = e.sep, d = this.rootPath, f = false;
|
|
4900
|
-
for (let m of a) {
|
|
4901
|
-
let p = u--;
|
|
4902
|
-
l = l.child(m, { relative: new Array(p).fill("..").join(c), relativePosix: new Array(p).fill("..").join("/"), fullpath: d += (f ? "" : c) + m }), f = true;
|
|
4903
|
-
}
|
|
4904
|
-
this.cwd = l;
|
|
4905
|
-
}
|
|
4906
|
-
depth(t = this.cwd) {
|
|
4907
|
-
return typeof t == "string" && (t = this.cwd.resolve(t)), t.depth();
|
|
4908
|
-
}
|
|
4909
|
-
childrenCache() {
|
|
4910
|
-
return this.#n;
|
|
4911
|
-
}
|
|
4912
|
-
resolve(...t) {
|
|
4913
|
-
let e = "";
|
|
4914
|
-
for (let r = t.length - 1; r >= 0; r--) {
|
|
4915
|
-
let o = t[r];
|
|
4916
|
-
if (!(!o || o === ".") && (e = e ? `${o}/${e}` : o, this.isAbsolute(o))) break;
|
|
4917
|
-
}
|
|
4918
|
-
let s = this.#t.get(e);
|
|
4919
|
-
if (s !== void 0) return s;
|
|
4920
|
-
let i = this.cwd.resolve(e).fullpath();
|
|
4921
|
-
return this.#t.set(e, i), i;
|
|
4922
|
-
}
|
|
4923
|
-
resolvePosix(...t) {
|
|
4924
|
-
let e = "";
|
|
4925
|
-
for (let r = t.length - 1; r >= 0; r--) {
|
|
4926
|
-
let o = t[r];
|
|
4927
|
-
if (!(!o || o === ".") && (e = e ? `${o}/${e}` : o, this.isAbsolute(o))) break;
|
|
4928
|
-
}
|
|
4929
|
-
let s = this.#s.get(e);
|
|
4930
|
-
if (s !== void 0) return s;
|
|
4931
|
-
let i = this.cwd.resolve(e).fullpathPosix();
|
|
4932
|
-
return this.#s.set(e, i), i;
|
|
4933
|
-
}
|
|
4934
|
-
relative(t = this.cwd) {
|
|
4935
|
-
return typeof t == "string" && (t = this.cwd.resolve(t)), t.relative();
|
|
4936
|
-
}
|
|
4937
|
-
relativePosix(t = this.cwd) {
|
|
4938
|
-
return typeof t == "string" && (t = this.cwd.resolve(t)), t.relativePosix();
|
|
4939
|
-
}
|
|
4940
|
-
basename(t = this.cwd) {
|
|
4941
|
-
return typeof t == "string" && (t = this.cwd.resolve(t)), t.name;
|
|
4942
|
-
}
|
|
4943
|
-
dirname(t = this.cwd) {
|
|
4944
|
-
return typeof t == "string" && (t = this.cwd.resolve(t)), (t.parent || t).fullpath();
|
|
4945
|
-
}
|
|
4946
|
-
async readdir(t = this.cwd, e = { withFileTypes: true }) {
|
|
4947
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
4948
|
-
let { withFileTypes: s } = e;
|
|
4949
|
-
if (t.canReaddir()) {
|
|
4950
|
-
let i = await t.readdir();
|
|
4951
|
-
return s ? i : i.map((r) => r.name);
|
|
4952
|
-
} else return [];
|
|
4953
|
-
}
|
|
4954
|
-
readdirSync(t = this.cwd, e = { withFileTypes: true }) {
|
|
4955
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
4956
|
-
let { withFileTypes: s = true } = e;
|
|
4957
|
-
return t.canReaddir() ? s ? t.readdirSync() : t.readdirSync().map((i) => i.name) : [];
|
|
4958
|
-
}
|
|
4959
|
-
async lstat(t = this.cwd) {
|
|
4960
|
-
return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstat();
|
|
4961
|
-
}
|
|
4962
|
-
lstatSync(t = this.cwd) {
|
|
4963
|
-
return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstatSync();
|
|
4964
|
-
}
|
|
4965
|
-
async readlink(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) {
|
|
4966
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
4967
|
-
let s = await t.readlink();
|
|
4968
|
-
return e ? s : s?.fullpath();
|
|
4969
|
-
}
|
|
4970
|
-
readlinkSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) {
|
|
4971
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
4972
|
-
let s = t.readlinkSync();
|
|
4973
|
-
return e ? s : s?.fullpath();
|
|
4974
|
-
}
|
|
4975
|
-
async realpath(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) {
|
|
4976
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
4977
|
-
let s = await t.realpath();
|
|
4978
|
-
return e ? s : s?.fullpath();
|
|
4979
|
-
}
|
|
4980
|
-
realpathSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: false }) {
|
|
4981
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
4982
|
-
let s = t.realpathSync();
|
|
4983
|
-
return e ? s : s?.fullpath();
|
|
4984
|
-
}
|
|
4985
|
-
async walk(t = this.cwd, e = {}) {
|
|
4986
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
4987
|
-
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = [];
|
|
4988
|
-
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
4989
|
-
let a = /* @__PURE__ */ new Set(), l = (c, d) => {
|
|
4990
|
-
a.add(c), c.readdirCB((f, m) => {
|
|
4991
|
-
if (f) return d(f);
|
|
4992
|
-
let p = m.length;
|
|
4993
|
-
if (!p) return d();
|
|
4994
|
-
let w = () => {
|
|
4995
|
-
--p === 0 && d();
|
|
4996
|
-
};
|
|
4997
|
-
for (let g of m) (!r || r(g)) && h.push(s ? g : g.fullpath()), i && g.isSymbolicLink() ? g.realpath().then((S) => S?.isUnknown() ? S.lstat() : S).then((S) => S?.shouldWalk(a, o) ? l(S, w) : w()) : g.shouldWalk(a, o) ? l(g, w) : w();
|
|
4998
|
-
}, true);
|
|
4999
|
-
}, u = t;
|
|
5000
|
-
return new Promise((c, d) => {
|
|
5001
|
-
l(u, (f) => {
|
|
5002
|
-
if (f) return d(f);
|
|
5003
|
-
c(h);
|
|
5004
|
-
});
|
|
5005
|
-
});
|
|
5006
|
-
}
|
|
5007
|
-
walkSync(t = this.cwd, e = {}) {
|
|
5008
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
5009
|
-
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = [];
|
|
5010
|
-
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
5011
|
-
let a = /* @__PURE__ */ new Set([t]);
|
|
5012
|
-
for (let l of a) {
|
|
5013
|
-
let u = l.readdirSync();
|
|
5014
|
-
for (let c of u) {
|
|
5015
|
-
(!r || r(c)) && h.push(s ? c : c.fullpath());
|
|
5016
|
-
let d = c;
|
|
5017
|
-
if (c.isSymbolicLink()) {
|
|
5018
|
-
if (!(i && (d = c.realpathSync()))) continue;
|
|
5019
|
-
d.isUnknown() && d.lstatSync();
|
|
5020
|
-
}
|
|
5021
|
-
d.shouldWalk(a, o) && a.add(d);
|
|
5022
|
-
}
|
|
5023
|
-
}
|
|
5024
|
-
return h;
|
|
5025
|
-
}
|
|
5026
|
-
[Symbol.asyncIterator]() {
|
|
5027
|
-
return this.iterate();
|
|
5028
|
-
}
|
|
5029
|
-
iterate(t = this.cwd, e = {}) {
|
|
5030
|
-
return typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd), this.stream(t, e)[Symbol.asyncIterator]();
|
|
5031
|
-
}
|
|
5032
|
-
[Symbol.iterator]() {
|
|
5033
|
-
return this.iterateSync();
|
|
5034
|
-
}
|
|
5035
|
-
*iterateSync(t = this.cwd, e = {}) {
|
|
5036
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
5037
|
-
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e;
|
|
5038
|
-
(!r || r(t)) && (yield s ? t : t.fullpath());
|
|
5039
|
-
let h = /* @__PURE__ */ new Set([t]);
|
|
5040
|
-
for (let a of h) {
|
|
5041
|
-
let l = a.readdirSync();
|
|
5042
|
-
for (let u of l) {
|
|
5043
|
-
(!r || r(u)) && (yield s ? u : u.fullpath());
|
|
5044
|
-
let c = u;
|
|
5045
|
-
if (u.isSymbolicLink()) {
|
|
5046
|
-
if (!(i && (c = u.realpathSync()))) continue;
|
|
5047
|
-
c.isUnknown() && c.lstatSync();
|
|
5048
|
-
}
|
|
5049
|
-
c.shouldWalk(h, o) && h.add(c);
|
|
5050
|
-
}
|
|
5051
|
-
}
|
|
5052
|
-
}
|
|
5053
|
-
stream(t = this.cwd, e = {}) {
|
|
5054
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
5055
|
-
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true });
|
|
5056
|
-
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
5057
|
-
let a = /* @__PURE__ */ new Set(), l = [t], u = 0, c = () => {
|
|
5058
|
-
let d = false;
|
|
5059
|
-
for (; !d; ) {
|
|
5060
|
-
let f = l.shift();
|
|
5061
|
-
if (!f) {
|
|
5062
|
-
u === 0 && h.end();
|
|
5063
|
-
return;
|
|
5064
|
-
}
|
|
5065
|
-
u++, a.add(f);
|
|
5066
|
-
let m = (w, g, S = false) => {
|
|
5067
|
-
if (w) return h.emit("error", w);
|
|
5068
|
-
if (i && !S) {
|
|
5069
|
-
let E = [];
|
|
5070
|
-
for (let y of g) y.isSymbolicLink() && E.push(y.realpath().then((b) => b?.isUnknown() ? b.lstat() : b));
|
|
5071
|
-
if (E.length) {
|
|
5072
|
-
Promise.all(E).then(() => m(null, g, true));
|
|
5073
|
-
return;
|
|
5074
|
-
}
|
|
5075
|
-
}
|
|
5076
|
-
for (let E of g) E && (!r || r(E)) && (h.write(s ? E : E.fullpath()) || (d = true));
|
|
5077
|
-
u--;
|
|
5078
|
-
for (let E of g) {
|
|
5079
|
-
let y = E.realpathCached() || E;
|
|
5080
|
-
y.shouldWalk(a, o) && l.push(y);
|
|
5081
|
-
}
|
|
5082
|
-
d && !h.flowing ? h.once("drain", c) : p || c();
|
|
5083
|
-
}, p = true;
|
|
5084
|
-
f.readdirCB(m, true), p = false;
|
|
5085
|
-
}
|
|
5086
|
-
};
|
|
5087
|
-
return c(), h;
|
|
5088
|
-
}
|
|
5089
|
-
streamSync(t = this.cwd, e = {}) {
|
|
5090
|
-
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
5091
|
-
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true }), a = /* @__PURE__ */ new Set();
|
|
5092
|
-
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
5093
|
-
let l = [t], u = 0, c = () => {
|
|
5094
|
-
let d = false;
|
|
5095
|
-
for (; !d; ) {
|
|
5096
|
-
let f = l.shift();
|
|
5097
|
-
if (!f) {
|
|
5098
|
-
u === 0 && h.end();
|
|
5099
|
-
return;
|
|
5100
|
-
}
|
|
5101
|
-
u++, a.add(f);
|
|
5102
|
-
let m = f.readdirSync();
|
|
5103
|
-
for (let p of m) (!r || r(p)) && (h.write(s ? p : p.fullpath()) || (d = true));
|
|
5104
|
-
u--;
|
|
5105
|
-
for (let p of m) {
|
|
5106
|
-
let w = p;
|
|
5107
|
-
if (p.isSymbolicLink()) {
|
|
5108
|
-
if (!(i && (w = p.realpathSync()))) continue;
|
|
5109
|
-
w.isUnknown() && w.lstatSync();
|
|
5110
|
-
}
|
|
5111
|
-
w.shouldWalk(a, o) && l.push(w);
|
|
5112
|
-
}
|
|
5113
|
-
}
|
|
5114
|
-
d && !h.flowing && h.once("drain", c);
|
|
5115
|
-
};
|
|
5116
|
-
return c(), h;
|
|
5117
|
-
}
|
|
5118
|
-
chdir(t = this.cwd) {
|
|
5119
|
-
let e = this.cwd;
|
|
5120
|
-
this.cwd = typeof t == "string" ? this.cwd.resolve(t) : t, this.cwd[Ye](e);
|
|
5121
|
-
}
|
|
5122
|
-
};
|
|
5123
|
-
var it = class extends It {
|
|
5124
|
-
sep = "\\";
|
|
5125
|
-
constructor(t = process.cwd(), e = {}) {
|
|
5126
|
-
let { nocase: s = true } = e;
|
|
5127
|
-
super(t, re, "\\", { ...e, nocase: s }), this.nocase = s;
|
|
5128
|
-
for (let i = this.cwd; i; i = i.parent) i.nocase = this.nocase;
|
|
5129
|
-
}
|
|
5130
|
-
parseRootPath(t) {
|
|
5131
|
-
return re.parse(t).root.toUpperCase();
|
|
5132
|
-
}
|
|
5133
|
-
newRoot(t) {
|
|
5134
|
-
return new Pt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t });
|
|
5135
|
-
}
|
|
5136
|
-
isAbsolute(t) {
|
|
5137
|
-
return t.startsWith("/") || t.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(t);
|
|
5138
|
-
}
|
|
5139
|
-
};
|
|
5140
|
-
var rt = class extends It {
|
|
5141
|
-
sep = "/";
|
|
5142
|
-
constructor(t = process.cwd(), e = {}) {
|
|
5143
|
-
let { nocase: s = false } = e;
|
|
5144
|
-
super(t, mi, "/", { ...e, nocase: s }), this.nocase = s;
|
|
5145
|
-
}
|
|
5146
|
-
parseRootPath(t) {
|
|
5147
|
-
return "/";
|
|
5148
|
-
}
|
|
5149
|
-
newRoot(t) {
|
|
5150
|
-
return new jt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t });
|
|
5151
|
-
}
|
|
5152
|
-
isAbsolute(t) {
|
|
5153
|
-
return t.startsWith("/");
|
|
5154
|
-
}
|
|
5155
|
-
};
|
|
5156
|
-
var St = class extends rt {
|
|
5157
|
-
constructor(t = process.cwd(), e = {}) {
|
|
5158
|
-
let { nocase: s = true } = e;
|
|
5159
|
-
super(t, { ...e, nocase: s });
|
|
5160
|
-
}
|
|
5161
|
-
};
|
|
5162
|
-
var Cr = process.platform === "win32" ? Pt : jt;
|
|
5163
|
-
var Xe = process.platform === "win32" ? it : process.platform === "darwin" ? St : rt;
|
|
5164
|
-
var Di = (n7) => n7.length >= 1;
|
|
5165
|
-
var Mi = (n7) => n7.length >= 1;
|
|
5166
|
-
var Ni = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
5167
|
-
var nt = class n4 {
|
|
5168
|
-
#t;
|
|
5169
|
-
#s;
|
|
5170
|
-
#n;
|
|
5171
|
-
length;
|
|
5172
|
-
#r;
|
|
5173
|
-
#o;
|
|
5174
|
-
#S;
|
|
5175
|
-
#w;
|
|
5176
|
-
#c;
|
|
5177
|
-
#h;
|
|
5178
|
-
#u = true;
|
|
5179
|
-
constructor(t, e, s, i) {
|
|
5180
|
-
if (!Di(t)) throw new TypeError("empty pattern list");
|
|
5181
|
-
if (!Mi(e)) throw new TypeError("empty glob list");
|
|
5182
|
-
if (e.length !== t.length) throw new TypeError("mismatched pattern list and glob list lengths");
|
|
5183
|
-
if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range");
|
|
5184
|
-
if (this.#t = t, this.#s = e, this.#n = s, this.#r = i, this.#n === 0) {
|
|
5185
|
-
if (this.isUNC()) {
|
|
5186
|
-
let [r, o, h, a, ...l] = this.#t, [u, c, d, f, ...m] = this.#s;
|
|
5187
|
-
l[0] === "" && (l.shift(), m.shift());
|
|
5188
|
-
let p = [r, o, h, a, ""].join("/"), w = [u, c, d, f, ""].join("/");
|
|
5189
|
-
this.#t = [p, ...l], this.#s = [w, ...m], this.length = this.#t.length;
|
|
5190
|
-
} else if (this.isDrive() || this.isAbsolute()) {
|
|
5191
|
-
let [r, ...o] = this.#t, [h, ...a] = this.#s;
|
|
5192
|
-
o[0] === "" && (o.shift(), a.shift());
|
|
5193
|
-
let l = r + "/", u = h + "/";
|
|
5194
|
-
this.#t = [l, ...o], this.#s = [u, ...a], this.length = this.#t.length;
|
|
5195
|
-
}
|
|
5196
|
-
}
|
|
5197
|
-
}
|
|
5198
|
-
[Ni]() {
|
|
5199
|
-
return "Pattern <" + this.#s.slice(this.#n).join("/") + ">";
|
|
5200
|
-
}
|
|
5201
|
-
pattern() {
|
|
5202
|
-
return this.#t[this.#n];
|
|
5203
|
-
}
|
|
5204
|
-
isString() {
|
|
5205
|
-
return typeof this.#t[this.#n] == "string";
|
|
5206
|
-
}
|
|
5207
|
-
isGlobstar() {
|
|
5208
|
-
return this.#t[this.#n] === A;
|
|
5209
|
-
}
|
|
5210
|
-
isRegExp() {
|
|
5211
|
-
return this.#t[this.#n] instanceof RegExp;
|
|
5212
|
-
}
|
|
5213
|
-
globString() {
|
|
5214
|
-
return this.#S = this.#S || (this.#n === 0 ? this.isAbsolute() ? this.#s[0] + this.#s.slice(1).join("/") : this.#s.join("/") : this.#s.slice(this.#n).join("/"));
|
|
5215
|
-
}
|
|
5216
|
-
hasMore() {
|
|
5217
|
-
return this.length > this.#n + 1;
|
|
5218
|
-
}
|
|
5219
|
-
rest() {
|
|
5220
|
-
return this.#o !== void 0 ? this.#o : this.hasMore() ? (this.#o = new n4(this.#t, this.#s, this.#n + 1, this.#r), this.#o.#h = this.#h, this.#o.#c = this.#c, this.#o.#w = this.#w, this.#o) : this.#o = null;
|
|
5221
|
-
}
|
|
5222
|
-
isUNC() {
|
|
5223
|
-
let t = this.#t;
|
|
5224
|
-
return this.#c !== void 0 ? this.#c : this.#c = this.#r === "win32" && this.#n === 0 && t[0] === "" && t[1] === "" && typeof t[2] == "string" && !!t[2] && typeof t[3] == "string" && !!t[3];
|
|
5225
|
-
}
|
|
5226
|
-
isDrive() {
|
|
5227
|
-
let t = this.#t;
|
|
5228
|
-
return this.#w !== void 0 ? this.#w : this.#w = this.#r === "win32" && this.#n === 0 && this.length > 1 && typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]);
|
|
5229
|
-
}
|
|
5230
|
-
isAbsolute() {
|
|
5231
|
-
let t = this.#t;
|
|
5232
|
-
return this.#h !== void 0 ? this.#h : this.#h = t[0] === "" && t.length > 1 || this.isDrive() || this.isUNC();
|
|
5233
|
-
}
|
|
5234
|
-
root() {
|
|
5235
|
-
let t = this.#t[0];
|
|
5236
|
-
return typeof t == "string" && this.isAbsolute() && this.#n === 0 ? t : "";
|
|
5237
|
-
}
|
|
5238
|
-
checkFollowGlobstar() {
|
|
5239
|
-
return !(this.#n === 0 || !this.isGlobstar() || !this.#u);
|
|
5240
|
-
}
|
|
5241
|
-
markFollowGlobstar() {
|
|
5242
|
-
return this.#n === 0 || !this.isGlobstar() || !this.#u ? false : (this.#u = false, true);
|
|
5243
|
-
}
|
|
5244
|
-
};
|
|
5245
|
-
var _i = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux";
|
|
5246
|
-
var ot = class {
|
|
5247
|
-
relative;
|
|
5248
|
-
relativeChildren;
|
|
5249
|
-
absolute;
|
|
5250
|
-
absoluteChildren;
|
|
5251
|
-
platform;
|
|
5252
|
-
mmopts;
|
|
5253
|
-
constructor(t, { nobrace: e, nocase: s, noext: i, noglobstar: r, platform: o = _i }) {
|
|
5254
|
-
this.relative = [], this.absolute = [], this.relativeChildren = [], this.absoluteChildren = [], this.platform = o, this.mmopts = { dot: true, nobrace: e, nocase: s, noext: i, noglobstar: r, optimizationLevel: 2, platform: o, nocomment: true, nonegate: true };
|
|
5255
|
-
for (let h of t) this.add(h);
|
|
5256
|
-
}
|
|
5257
|
-
add(t) {
|
|
5258
|
-
let e = new D(t, this.mmopts);
|
|
5259
|
-
for (let s = 0; s < e.set.length; s++) {
|
|
5260
|
-
let i = e.set[s], r = e.globParts[s];
|
|
5261
|
-
if (!i || !r) throw new Error("invalid pattern object");
|
|
5262
|
-
for (; i[0] === "." && r[0] === "."; ) i.shift(), r.shift();
|
|
5263
|
-
let o = new nt(i, r, 0, this.platform), h = new D(o.globString(), this.mmopts), a = r[r.length - 1] === "**", l = o.isAbsolute();
|
|
5264
|
-
l ? this.absolute.push(h) : this.relative.push(h), a && (l ? this.absoluteChildren.push(h) : this.relativeChildren.push(h));
|
|
5265
|
-
}
|
|
5266
|
-
}
|
|
5267
|
-
ignored(t) {
|
|
5268
|
-
let e = t.fullpath(), s = `${e}/`, i = t.relative() || ".", r = `${i}/`;
|
|
5269
|
-
for (let o of this.relative) if (o.match(i) || o.match(r)) return true;
|
|
5270
|
-
for (let o of this.absolute) if (o.match(e) || o.match(s)) return true;
|
|
5271
|
-
return false;
|
|
5272
|
-
}
|
|
5273
|
-
childrenIgnored(t) {
|
|
5274
|
-
let e = t.fullpath() + "/", s = (t.relative() || ".") + "/";
|
|
5275
|
-
for (let i of this.relativeChildren) if (i.match(s)) return true;
|
|
5276
|
-
for (let i of this.absoluteChildren) if (i.match(e)) return true;
|
|
5277
|
-
return false;
|
|
5278
|
-
}
|
|
5279
|
-
};
|
|
5280
|
-
var oe = class n5 {
|
|
5281
|
-
store;
|
|
5282
|
-
constructor(t = /* @__PURE__ */ new Map()) {
|
|
5283
|
-
this.store = t;
|
|
5284
|
-
}
|
|
5285
|
-
copy() {
|
|
5286
|
-
return new n5(new Map(this.store));
|
|
5287
|
-
}
|
|
5288
|
-
hasWalked(t, e) {
|
|
5289
|
-
return this.store.get(t.fullpath())?.has(e.globString());
|
|
5290
|
-
}
|
|
5291
|
-
storeWalked(t, e) {
|
|
5292
|
-
let s = t.fullpath(), i = this.store.get(s);
|
|
5293
|
-
i ? i.add(e.globString()) : this.store.set(s, /* @__PURE__ */ new Set([e.globString()]));
|
|
5294
|
-
}
|
|
5295
|
-
};
|
|
5296
|
-
var he = class {
|
|
5297
|
-
store = /* @__PURE__ */ new Map();
|
|
5298
|
-
add(t, e, s) {
|
|
5299
|
-
let i = (e ? 2 : 0) | (s ? 1 : 0), r = this.store.get(t);
|
|
5300
|
-
this.store.set(t, r === void 0 ? i : i & r);
|
|
5301
|
-
}
|
|
5302
|
-
entries() {
|
|
5303
|
-
return [...this.store.entries()].map(([t, e]) => [t, !!(e & 2), !!(e & 1)]);
|
|
5304
|
-
}
|
|
5305
|
-
};
|
|
5306
|
-
var ae = class {
|
|
5307
|
-
store = /* @__PURE__ */ new Map();
|
|
5308
|
-
add(t, e) {
|
|
5309
|
-
if (!t.canReaddir()) return;
|
|
5310
|
-
let s = this.store.get(t);
|
|
5311
|
-
s ? s.find((i) => i.globString() === e.globString()) || s.push(e) : this.store.set(t, [e]);
|
|
5312
|
-
}
|
|
5313
|
-
get(t) {
|
|
5314
|
-
let e = this.store.get(t);
|
|
5315
|
-
if (!e) throw new Error("attempting to walk unknown path");
|
|
5316
|
-
return e;
|
|
5317
|
-
}
|
|
5318
|
-
entries() {
|
|
5319
|
-
return this.keys().map((t) => [t, this.store.get(t)]);
|
|
5320
|
-
}
|
|
5321
|
-
keys() {
|
|
5322
|
-
return [...this.store.keys()].filter((t) => t.canReaddir());
|
|
5323
|
-
}
|
|
5324
|
-
};
|
|
5325
|
-
var Et = class n6 {
|
|
5326
|
-
hasWalkedCache;
|
|
5327
|
-
matches = new he();
|
|
5328
|
-
subwalks = new ae();
|
|
5329
|
-
patterns;
|
|
5330
|
-
follow;
|
|
5331
|
-
dot;
|
|
5332
|
-
opts;
|
|
5333
|
-
constructor(t, e) {
|
|
5334
|
-
this.opts = t, this.follow = !!t.follow, this.dot = !!t.dot, this.hasWalkedCache = e ? e.copy() : new oe();
|
|
5335
|
-
}
|
|
5336
|
-
processPatterns(t, e) {
|
|
5337
|
-
this.patterns = e;
|
|
5338
|
-
let s = e.map((i) => [t, i]);
|
|
5339
|
-
for (let [i, r] of s) {
|
|
5340
|
-
this.hasWalkedCache.storeWalked(i, r);
|
|
5341
|
-
let o = r.root(), h = r.isAbsolute() && this.opts.absolute !== false;
|
|
5342
|
-
if (o) {
|
|
5343
|
-
i = i.resolve(o === "/" && this.opts.root !== void 0 ? this.opts.root : o);
|
|
5344
|
-
let c = r.rest();
|
|
5345
|
-
if (c) r = c;
|
|
5346
|
-
else {
|
|
5347
|
-
this.matches.add(i, true, false);
|
|
5348
|
-
continue;
|
|
5349
|
-
}
|
|
5350
|
-
}
|
|
5351
|
-
if (i.isENOENT()) continue;
|
|
5352
|
-
let a, l, u = false;
|
|
5353
|
-
for (; typeof (a = r.pattern()) == "string" && (l = r.rest()); ) i = i.resolve(a), r = l, u = true;
|
|
5354
|
-
if (a = r.pattern(), l = r.rest(), u) {
|
|
5355
|
-
if (this.hasWalkedCache.hasWalked(i, r)) continue;
|
|
5356
|
-
this.hasWalkedCache.storeWalked(i, r);
|
|
5357
|
-
}
|
|
5358
|
-
if (typeof a == "string") {
|
|
5359
|
-
let c = a === ".." || a === "" || a === ".";
|
|
5360
|
-
this.matches.add(i.resolve(a), h, c);
|
|
5361
|
-
continue;
|
|
5362
|
-
} else if (a === A) {
|
|
5363
|
-
(!i.isSymbolicLink() || this.follow || r.checkFollowGlobstar()) && this.subwalks.add(i, r);
|
|
5364
|
-
let c = l?.pattern(), d = l?.rest();
|
|
5365
|
-
if (!l || (c === "" || c === ".") && !d) this.matches.add(i, h, c === "" || c === ".");
|
|
5366
|
-
else if (c === "..") {
|
|
5367
|
-
let f = i.parent || i;
|
|
5368
|
-
d ? this.hasWalkedCache.hasWalked(f, d) || this.subwalks.add(f, d) : this.matches.add(f, h, true);
|
|
5369
|
-
}
|
|
5370
|
-
} else a instanceof RegExp && this.subwalks.add(i, r);
|
|
5371
|
-
}
|
|
5372
|
-
return this;
|
|
5373
|
-
}
|
|
5374
|
-
subwalkTargets() {
|
|
5375
|
-
return this.subwalks.keys();
|
|
5376
|
-
}
|
|
5377
|
-
child() {
|
|
5378
|
-
return new n6(this.opts, this.hasWalkedCache);
|
|
5379
|
-
}
|
|
5380
|
-
filterEntries(t, e) {
|
|
5381
|
-
let s = this.subwalks.get(t), i = this.child();
|
|
5382
|
-
for (let r of e) for (let o of s) {
|
|
5383
|
-
let h = o.isAbsolute(), a = o.pattern(), l = o.rest();
|
|
5384
|
-
a === A ? i.testGlobstar(r, o, l, h) : a instanceof RegExp ? i.testRegExp(r, a, l, h) : i.testString(r, a, l, h);
|
|
5385
|
-
}
|
|
5386
|
-
return i;
|
|
5387
|
-
}
|
|
5388
|
-
testGlobstar(t, e, s, i) {
|
|
5389
|
-
if ((this.dot || !t.name.startsWith(".")) && (e.hasMore() || this.matches.add(t, i, false), t.canReaddir() && (this.follow || !t.isSymbolicLink() ? this.subwalks.add(t, e) : t.isSymbolicLink() && (s && e.checkFollowGlobstar() ? this.subwalks.add(t, s) : e.markFollowGlobstar() && this.subwalks.add(t, e)))), s) {
|
|
5390
|
-
let r = s.pattern();
|
|
5391
|
-
if (typeof r == "string" && r !== ".." && r !== "" && r !== ".") this.testString(t, r, s.rest(), i);
|
|
5392
|
-
else if (r === "..") {
|
|
5393
|
-
let o = t.parent || t;
|
|
5394
|
-
this.subwalks.add(o, s);
|
|
5395
|
-
} else r instanceof RegExp && this.testRegExp(t, r, s.rest(), i);
|
|
5396
|
-
}
|
|
5397
|
-
}
|
|
5398
|
-
testRegExp(t, e, s, i) {
|
|
5399
|
-
e.test(t.name) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, false));
|
|
5400
|
-
}
|
|
5401
|
-
testString(t, e, s, i) {
|
|
5402
|
-
t.isNamed(e) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, false));
|
|
5403
|
-
}
|
|
5404
|
-
};
|
|
5405
|
-
var Li = (n7, t) => typeof n7 == "string" ? new ot([n7], t) : Array.isArray(n7) ? new ot(n7, t) : n7;
|
|
5406
|
-
var zt = class {
|
|
5407
|
-
path;
|
|
5408
|
-
patterns;
|
|
5409
|
-
opts;
|
|
5410
|
-
seen = /* @__PURE__ */ new Set();
|
|
5411
|
-
paused = false;
|
|
5412
|
-
aborted = false;
|
|
5413
|
-
#t = [];
|
|
5414
|
-
#s;
|
|
5415
|
-
#n;
|
|
5416
|
-
signal;
|
|
5417
|
-
maxDepth;
|
|
5418
|
-
includeChildMatches;
|
|
5419
|
-
constructor(t, e, s) {
|
|
5420
|
-
if (this.patterns = t, this.path = e, this.opts = s, this.#n = !s.posix && s.platform === "win32" ? "\\" : "/", this.includeChildMatches = s.includeChildMatches !== false, (s.ignore || !this.includeChildMatches) && (this.#s = Li(s.ignore ?? [], s), !this.includeChildMatches && typeof this.#s.add != "function")) {
|
|
5421
|
-
let i = "cannot ignore child matches, ignore lacks add() method.";
|
|
5422
|
-
throw new Error(i);
|
|
5423
|
-
}
|
|
5424
|
-
this.maxDepth = s.maxDepth || 1 / 0, s.signal && (this.signal = s.signal, this.signal.addEventListener("abort", () => {
|
|
5425
|
-
this.#t.length = 0;
|
|
5426
|
-
}));
|
|
5427
|
-
}
|
|
5428
|
-
#r(t) {
|
|
5429
|
-
return this.seen.has(t) || !!this.#s?.ignored?.(t);
|
|
5430
|
-
}
|
|
5431
|
-
#o(t) {
|
|
5432
|
-
return !!this.#s?.childrenIgnored?.(t);
|
|
5433
|
-
}
|
|
5434
|
-
pause() {
|
|
5435
|
-
this.paused = true;
|
|
5436
|
-
}
|
|
5437
|
-
resume() {
|
|
5438
|
-
if (this.signal?.aborted) return;
|
|
5439
|
-
this.paused = false;
|
|
5440
|
-
let t;
|
|
5441
|
-
for (; !this.paused && (t = this.#t.shift()); ) t();
|
|
5442
|
-
}
|
|
5443
|
-
onResume(t) {
|
|
5444
|
-
this.signal?.aborted || (this.paused ? this.#t.push(t) : t());
|
|
5445
|
-
}
|
|
5446
|
-
async matchCheck(t, e) {
|
|
5447
|
-
if (e && this.opts.nodir) return;
|
|
5448
|
-
let s;
|
|
5449
|
-
if (this.opts.realpath) {
|
|
5450
|
-
if (s = t.realpathCached() || await t.realpath(), !s) return;
|
|
5451
|
-
t = s;
|
|
5452
|
-
}
|
|
5453
|
-
let r = t.isUnknown() || this.opts.stat ? await t.lstat() : t;
|
|
5454
|
-
if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) {
|
|
5455
|
-
let o = await r.realpath();
|
|
5456
|
-
o && (o.isUnknown() || this.opts.stat) && await o.lstat();
|
|
5457
|
-
}
|
|
5458
|
-
return this.matchCheckTest(r, e);
|
|
5459
|
-
}
|
|
5460
|
-
matchCheckTest(t, e) {
|
|
5461
|
-
return t && (this.maxDepth === 1 / 0 || t.depth() <= this.maxDepth) && (!e || t.canReaddir()) && (!this.opts.nodir || !t.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !t.isSymbolicLink() || !t.realpathCached()?.isDirectory()) && !this.#r(t) ? t : void 0;
|
|
5462
|
-
}
|
|
5463
|
-
matchCheckSync(t, e) {
|
|
5464
|
-
if (e && this.opts.nodir) return;
|
|
5465
|
-
let s;
|
|
5466
|
-
if (this.opts.realpath) {
|
|
5467
|
-
if (s = t.realpathCached() || t.realpathSync(), !s) return;
|
|
5468
|
-
t = s;
|
|
5469
|
-
}
|
|
5470
|
-
let r = t.isUnknown() || this.opts.stat ? t.lstatSync() : t;
|
|
5471
|
-
if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) {
|
|
5472
|
-
let o = r.realpathSync();
|
|
5473
|
-
o && (o?.isUnknown() || this.opts.stat) && o.lstatSync();
|
|
5474
|
-
}
|
|
5475
|
-
return this.matchCheckTest(r, e);
|
|
5476
|
-
}
|
|
5477
|
-
matchFinish(t, e) {
|
|
5478
|
-
if (this.#r(t)) return;
|
|
5479
|
-
if (!this.includeChildMatches && this.#s?.add) {
|
|
5480
|
-
let r = `${t.relativePosix()}/**`;
|
|
5481
|
-
this.#s.add(r);
|
|
5482
|
-
}
|
|
5483
|
-
let s = this.opts.absolute === void 0 ? e : this.opts.absolute;
|
|
5484
|
-
this.seen.add(t);
|
|
5485
|
-
let i = this.opts.mark && t.isDirectory() ? this.#n : "";
|
|
5486
|
-
if (this.opts.withFileTypes) this.matchEmit(t);
|
|
5487
|
-
else if (s) {
|
|
5488
|
-
let r = this.opts.posix ? t.fullpathPosix() : t.fullpath();
|
|
5489
|
-
this.matchEmit(r + i);
|
|
5490
|
-
} else {
|
|
5491
|
-
let r = this.opts.posix ? t.relativePosix() : t.relative(), o = this.opts.dotRelative && !r.startsWith(".." + this.#n) ? "." + this.#n : "";
|
|
5492
|
-
this.matchEmit(r ? o + r + i : "." + i);
|
|
5493
|
-
}
|
|
5494
|
-
}
|
|
5495
|
-
async match(t, e, s) {
|
|
5496
|
-
let i = await this.matchCheck(t, s);
|
|
5497
|
-
i && this.matchFinish(i, e);
|
|
5498
|
-
}
|
|
5499
|
-
matchSync(t, e, s) {
|
|
5500
|
-
let i = this.matchCheckSync(t, s);
|
|
5501
|
-
i && this.matchFinish(i, e);
|
|
5502
|
-
}
|
|
5503
|
-
walkCB(t, e, s) {
|
|
5504
|
-
this.signal?.aborted && s(), this.walkCB2(t, e, new Et(this.opts), s);
|
|
5505
|
-
}
|
|
5506
|
-
walkCB2(t, e, s, i) {
|
|
5507
|
-
if (this.#o(t)) return i();
|
|
5508
|
-
if (this.signal?.aborted && i(), this.paused) {
|
|
5509
|
-
this.onResume(() => this.walkCB2(t, e, s, i));
|
|
5510
|
-
return;
|
|
5511
|
-
}
|
|
5512
|
-
s.processPatterns(t, e);
|
|
5513
|
-
let r = 1, o = () => {
|
|
5514
|
-
--r === 0 && i();
|
|
5515
|
-
};
|
|
5516
|
-
for (let [h, a, l] of s.matches.entries()) this.#r(h) || (r++, this.match(h, a, l).then(() => o()));
|
|
5517
|
-
for (let h of s.subwalkTargets()) {
|
|
5518
|
-
if (this.maxDepth !== 1 / 0 && h.depth() >= this.maxDepth) continue;
|
|
5519
|
-
r++;
|
|
5520
|
-
let a = h.readdirCached();
|
|
5521
|
-
h.calledReaddir() ? this.walkCB3(h, a, s, o) : h.readdirCB((l, u) => this.walkCB3(h, u, s, o), true);
|
|
5522
|
-
}
|
|
5523
|
-
o();
|
|
5524
|
-
}
|
|
5525
|
-
walkCB3(t, e, s, i) {
|
|
5526
|
-
s = s.filterEntries(t, e);
|
|
5527
|
-
let r = 1, o = () => {
|
|
5528
|
-
--r === 0 && i();
|
|
5529
|
-
};
|
|
5530
|
-
for (let [h, a, l] of s.matches.entries()) this.#r(h) || (r++, this.match(h, a, l).then(() => o()));
|
|
5531
|
-
for (let [h, a] of s.subwalks.entries()) r++, this.walkCB2(h, a, s.child(), o);
|
|
5532
|
-
o();
|
|
5533
|
-
}
|
|
5534
|
-
walkCBSync(t, e, s) {
|
|
5535
|
-
this.signal?.aborted && s(), this.walkCB2Sync(t, e, new Et(this.opts), s);
|
|
5536
|
-
}
|
|
5537
|
-
walkCB2Sync(t, e, s, i) {
|
|
5538
|
-
if (this.#o(t)) return i();
|
|
5539
|
-
if (this.signal?.aborted && i(), this.paused) {
|
|
5540
|
-
this.onResume(() => this.walkCB2Sync(t, e, s, i));
|
|
5541
|
-
return;
|
|
5542
|
-
}
|
|
5543
|
-
s.processPatterns(t, e);
|
|
5544
|
-
let r = 1, o = () => {
|
|
5545
|
-
--r === 0 && i();
|
|
5546
|
-
};
|
|
5547
|
-
for (let [h, a, l] of s.matches.entries()) this.#r(h) || this.matchSync(h, a, l);
|
|
5548
|
-
for (let h of s.subwalkTargets()) {
|
|
5549
|
-
if (this.maxDepth !== 1 / 0 && h.depth() >= this.maxDepth) continue;
|
|
5550
|
-
r++;
|
|
5551
|
-
let a = h.readdirSync();
|
|
5552
|
-
this.walkCB3Sync(h, a, s, o);
|
|
5553
|
-
}
|
|
5554
|
-
o();
|
|
5555
|
-
}
|
|
5556
|
-
walkCB3Sync(t, e, s, i) {
|
|
5557
|
-
s = s.filterEntries(t, e);
|
|
5558
|
-
let r = 1, o = () => {
|
|
5559
|
-
--r === 0 && i();
|
|
5560
|
-
};
|
|
5561
|
-
for (let [h, a, l] of s.matches.entries()) this.#r(h) || this.matchSync(h, a, l);
|
|
5562
|
-
for (let [h, a] of s.subwalks.entries()) r++, this.walkCB2Sync(h, a, s.child(), o);
|
|
5563
|
-
o();
|
|
5564
|
-
}
|
|
5565
|
-
};
|
|
5566
|
-
var xt = class extends zt {
|
|
5567
|
-
matches = /* @__PURE__ */ new Set();
|
|
5568
|
-
constructor(t, e, s) {
|
|
5569
|
-
super(t, e, s);
|
|
5570
|
-
}
|
|
5571
|
-
matchEmit(t) {
|
|
5572
|
-
this.matches.add(t);
|
|
5573
|
-
}
|
|
5574
|
-
async walk() {
|
|
5575
|
-
if (this.signal?.aborted) throw this.signal.reason;
|
|
5576
|
-
return this.path.isUnknown() && await this.path.lstat(), await new Promise((t, e) => {
|
|
5577
|
-
this.walkCB(this.path, this.patterns, () => {
|
|
5578
|
-
this.signal?.aborted ? e(this.signal.reason) : t(this.matches);
|
|
5579
|
-
});
|
|
5580
|
-
}), this.matches;
|
|
5581
|
-
}
|
|
5582
|
-
walkSync() {
|
|
5583
|
-
if (this.signal?.aborted) throw this.signal.reason;
|
|
5584
|
-
return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => {
|
|
5585
|
-
if (this.signal?.aborted) throw this.signal.reason;
|
|
5586
|
-
}), this.matches;
|
|
5587
|
-
}
|
|
5588
|
-
};
|
|
5589
|
-
var vt = class extends zt {
|
|
5590
|
-
results;
|
|
5591
|
-
constructor(t, e, s) {
|
|
5592
|
-
super(t, e, s), this.results = new V({ signal: this.signal, objectMode: true }), this.results.on("drain", () => this.resume()), this.results.on("resume", () => this.resume());
|
|
5593
|
-
}
|
|
5594
|
-
matchEmit(t) {
|
|
5595
|
-
this.results.write(t), this.results.flowing || this.pause();
|
|
5596
|
-
}
|
|
5597
|
-
stream() {
|
|
5598
|
-
let t = this.path;
|
|
5599
|
-
return t.isUnknown() ? t.lstat().then(() => {
|
|
5600
|
-
this.walkCB(t, this.patterns, () => this.results.end());
|
|
5601
|
-
}) : this.walkCB(t, this.patterns, () => this.results.end()), this.results;
|
|
5602
|
-
}
|
|
5603
|
-
streamSync() {
|
|
5604
|
-
return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => this.results.end()), this.results;
|
|
5605
|
-
}
|
|
5606
|
-
};
|
|
5607
|
-
var Pi = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux";
|
|
5608
|
-
var I = class {
|
|
5609
|
-
absolute;
|
|
5610
|
-
cwd;
|
|
5611
|
-
root;
|
|
5612
|
-
dot;
|
|
5613
|
-
dotRelative;
|
|
5614
|
-
follow;
|
|
5615
|
-
ignore;
|
|
5616
|
-
magicalBraces;
|
|
5617
|
-
mark;
|
|
5618
|
-
matchBase;
|
|
5619
|
-
maxDepth;
|
|
5620
|
-
nobrace;
|
|
5621
|
-
nocase;
|
|
5622
|
-
nodir;
|
|
5623
|
-
noext;
|
|
5624
|
-
noglobstar;
|
|
5625
|
-
pattern;
|
|
5626
|
-
platform;
|
|
5627
|
-
realpath;
|
|
5628
|
-
scurry;
|
|
5629
|
-
stat;
|
|
5630
|
-
signal;
|
|
5631
|
-
windowsPathsNoEscape;
|
|
5632
|
-
withFileTypes;
|
|
5633
|
-
includeChildMatches;
|
|
5634
|
-
opts;
|
|
5635
|
-
patterns;
|
|
5636
|
-
constructor(t, e) {
|
|
5637
|
-
if (!e) throw new TypeError("glob options required");
|
|
5638
|
-
if (this.withFileTypes = !!e.withFileTypes, this.signal = e.signal, this.follow = !!e.follow, this.dot = !!e.dot, this.dotRelative = !!e.dotRelative, this.nodir = !!e.nodir, this.mark = !!e.mark, e.cwd ? (e.cwd instanceof URL || e.cwd.startsWith("file://")) && (e.cwd = Wi(e.cwd)) : this.cwd = "", this.cwd = e.cwd || "", this.root = e.root, this.magicalBraces = !!e.magicalBraces, this.nobrace = !!e.nobrace, this.noext = !!e.noext, this.realpath = !!e.realpath, this.absolute = e.absolute, this.includeChildMatches = e.includeChildMatches !== false, this.noglobstar = !!e.noglobstar, this.matchBase = !!e.matchBase, this.maxDepth = typeof e.maxDepth == "number" ? e.maxDepth : 1 / 0, this.stat = !!e.stat, this.ignore = e.ignore, this.withFileTypes && this.absolute !== void 0) throw new Error("cannot set absolute and withFileTypes:true");
|
|
5639
|
-
if (typeof t == "string" && (t = [t]), this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === false, this.windowsPathsNoEscape && (t = t.map((a) => a.replace(/\\/g, "/"))), this.matchBase) {
|
|
5640
|
-
if (e.noglobstar) throw new TypeError("base matching requires globstar");
|
|
5641
|
-
t = t.map((a) => a.includes("/") ? a : `./**/${a}`);
|
|
5642
|
-
}
|
|
5643
|
-
if (this.pattern = t, this.platform = e.platform || Pi, this.opts = { ...e, platform: this.platform }, e.scurry) {
|
|
5644
|
-
if (this.scurry = e.scurry, e.nocase !== void 0 && e.nocase !== e.scurry.nocase) throw new Error("nocase option contradicts provided scurry option");
|
|
5645
|
-
} else {
|
|
5646
|
-
let a = e.platform === "win32" ? it : e.platform === "darwin" ? St : e.platform ? rt : Xe;
|
|
5647
|
-
this.scurry = new a(this.cwd, { nocase: e.nocase, fs: e.fs });
|
|
5648
|
-
}
|
|
5649
|
-
this.nocase = this.scurry.nocase;
|
|
5650
|
-
let s = this.platform === "darwin" || this.platform === "win32", i = { braceExpandMax: 1e4, ...e, dot: this.dot, matchBase: this.matchBase, nobrace: this.nobrace, nocase: this.nocase, nocaseMagicOnly: s, nocomment: true, noext: this.noext, nonegate: true, optimizationLevel: 2, platform: this.platform, windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }, r = this.pattern.map((a) => new D(a, i)), [o, h] = r.reduce((a, l) => (a[0].push(...l.set), a[1].push(...l.globParts), a), [[], []]);
|
|
5651
|
-
this.patterns = o.map((a, l) => {
|
|
5652
|
-
let u = h[l];
|
|
5653
|
-
if (!u) throw new Error("invalid pattern object");
|
|
5654
|
-
return new nt(a, u, 0, this.platform);
|
|
5655
|
-
});
|
|
5656
|
-
}
|
|
5657
|
-
async walk() {
|
|
5658
|
-
return [...await new xt(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).walk()];
|
|
5659
|
-
}
|
|
5660
|
-
walkSync() {
|
|
5661
|
-
return [...new xt(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).walkSync()];
|
|
5662
|
-
}
|
|
5663
|
-
stream() {
|
|
5664
|
-
return new vt(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).stream();
|
|
5665
|
-
}
|
|
5666
|
-
streamSync() {
|
|
5667
|
-
return new vt(this.patterns, this.scurry.cwd, { ...this.opts, maxDepth: this.maxDepth !== 1 / 0 ? this.maxDepth + this.scurry.cwd.depth() : 1 / 0, platform: this.platform, nocase: this.nocase, includeChildMatches: this.includeChildMatches }).streamSync();
|
|
5668
|
-
}
|
|
5669
|
-
iterateSync() {
|
|
5670
|
-
return this.streamSync()[Symbol.iterator]();
|
|
5671
|
-
}
|
|
5672
|
-
[Symbol.iterator]() {
|
|
5673
|
-
return this.iterateSync();
|
|
5674
|
-
}
|
|
5675
|
-
iterate() {
|
|
5676
|
-
return this.stream()[Symbol.asyncIterator]();
|
|
5677
|
-
}
|
|
5678
|
-
[Symbol.asyncIterator]() {
|
|
5679
|
-
return this.iterate();
|
|
5680
|
-
}
|
|
5681
|
-
};
|
|
5682
|
-
var le = (n7, t = {}) => {
|
|
5683
|
-
Array.isArray(n7) || (n7 = [n7]);
|
|
5684
|
-
for (let e of n7) if (new D(e, t).hasMagic()) return true;
|
|
5685
|
-
return false;
|
|
5686
|
-
};
|
|
5687
|
-
function Bt(n7, t = {}) {
|
|
5688
|
-
return new I(n7, t).streamSync();
|
|
5689
|
-
}
|
|
5690
|
-
function Qe(n7, t = {}) {
|
|
5691
|
-
return new I(n7, t).stream();
|
|
5692
|
-
}
|
|
5693
|
-
function ts(n7, t = {}) {
|
|
5694
|
-
return new I(n7, t).walkSync();
|
|
5695
|
-
}
|
|
5696
|
-
async function Je(n7, t = {}) {
|
|
5697
|
-
return new I(n7, t).walk();
|
|
5698
|
-
}
|
|
5699
|
-
function Ut(n7, t = {}) {
|
|
5700
|
-
return new I(n7, t).iterateSync();
|
|
5701
|
-
}
|
|
5702
|
-
function es(n7, t = {}) {
|
|
5703
|
-
return new I(n7, t).iterate();
|
|
5704
|
-
}
|
|
5705
|
-
var ji = Bt;
|
|
5706
|
-
var Ii = Object.assign(Qe, { sync: Bt });
|
|
5707
|
-
var zi = Ut;
|
|
5708
|
-
var Bi = Object.assign(es, { sync: Ut });
|
|
5709
|
-
var Ui = Object.assign(ts, { stream: Bt, iterate: Ut });
|
|
5710
|
-
var Ze = Object.assign(Je, { glob: Je, globSync: ts, sync: Ui, globStream: Qe, stream: Ii, globStreamSync: Bt, streamSync: ji, globIterate: es, iterate: Bi, globIterateSync: Ut, iterateSync: zi, Glob: I, hasMagic: le, escape: tt, unescape: W });
|
|
5711
|
-
Ze.glob = Ze;
|
|
5712
|
-
|
|
5713
2729
|
// src/api-extractor.ts
|
|
5714
2730
|
var import_is_ci = __toESM(require_is_ci());
|
|
5715
2731
|
|
|
@@ -5807,13 +2823,13 @@ function createDedent(options) {
|
|
|
5807
2823
|
result = result.trim();
|
|
5808
2824
|
}
|
|
5809
2825
|
if (escapeSpecialCharacters) {
|
|
5810
|
-
result = result.replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\v/g, "\v").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\0/g, "\0").replace(/\\x([\da-fA-F]{2})/g, (
|
|
2826
|
+
result = result.replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\v/g, "\v").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\0/g, "\0").replace(/\\x([\da-fA-F]{2})/g, (_, h) => String.fromCharCode(parseInt(h, 16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g, (_, h) => String.fromCodePoint(parseInt(h, 16))).replace(/\\u([\da-fA-F]{4})/g, (_, h) => String.fromCharCode(parseInt(h, 16)));
|
|
5811
2827
|
}
|
|
5812
2828
|
if (typeof Bun !== "undefined") {
|
|
5813
2829
|
result = result.replace(
|
|
5814
2830
|
// Matches e.g. \\u{1f60a} or \\u5F1F
|
|
5815
2831
|
/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,
|
|
5816
|
-
(
|
|
2832
|
+
(_, braced, unbraced) => {
|
|
5817
2833
|
var _ref;
|
|
5818
2834
|
const hex = (_ref = braced !== null && braced !== void 0 ? braced : unbraced) !== null && _ref !== void 0 ? _ref : "";
|
|
5819
2835
|
return String.fromCodePoint(parseInt(hex, 16));
|
|
@@ -5842,8 +2858,8 @@ function extractAugmentations(content) {
|
|
|
5842
2858
|
const matches = content.matchAll(
|
|
5843
2859
|
/^declare (?:module\s*"([^"]+)"|global)\s*\{([\s\S]+?)^\}/gm
|
|
5844
2860
|
);
|
|
5845
|
-
return Array.from(matches, (
|
|
5846
|
-
const [withDeclaration, name = "", withoutDeclaration] =
|
|
2861
|
+
return Array.from(matches, (it) => {
|
|
2862
|
+
const [withDeclaration, name = "", withoutDeclaration] = it;
|
|
5847
2863
|
if (name.startsWith(".")) {
|
|
5848
2864
|
const exported = withoutDeclaration.replaceAll(
|
|
5849
2865
|
/^(\s*)interface/g,
|
|
@@ -5858,7 +2874,7 @@ function extractAugmentations(content) {
|
|
|
5858
2874
|
// src/api-extractor.ts
|
|
5859
2875
|
async function getConfigFiles(configFiles) {
|
|
5860
2876
|
if (configFiles.length > 0) {
|
|
5861
|
-
return
|
|
2877
|
+
return await Array.fromAsync(fs2.glob(configFiles));
|
|
5862
2878
|
}
|
|
5863
2879
|
const result = await findUp("api-extractor.json");
|
|
5864
2880
|
return result ? [result] : [];
|
|
@@ -5871,7 +2887,7 @@ async function findReferencedFiles(filename, visited) {
|
|
|
5871
2887
|
return;
|
|
5872
2888
|
}
|
|
5873
2889
|
visited.add(filename);
|
|
5874
|
-
const content = await
|
|
2890
|
+
const content = await fs2.readFile(filename, "utf8");
|
|
5875
2891
|
const matches = content.matchAll(/^(?:import|export)[^"]*"([^"]+)";?$/gm);
|
|
5876
2892
|
for (const match of Array.from(matches)) {
|
|
5877
2893
|
const modname = match[1];
|
|
@@ -5883,7 +2899,7 @@ async function findReferencedFiles(filename, visited) {
|
|
|
5883
2899
|
}
|
|
5884
2900
|
const relPath = path3.join(path3.dirname(filename), modname);
|
|
5885
2901
|
if (existsSync(relPath)) {
|
|
5886
|
-
const stat = await
|
|
2902
|
+
const stat = await fs2.stat(relPath);
|
|
5887
2903
|
if (stat.isDirectory()) {
|
|
5888
2904
|
await findReferencedFiles(
|
|
5889
2905
|
path3.join(relPath, "index.d.ts"),
|
|
@@ -5903,13 +2919,13 @@ async function patchAugmentations(config) {
|
|
|
5903
2919
|
return;
|
|
5904
2920
|
}
|
|
5905
2921
|
async function extract(filename) {
|
|
5906
|
-
const content = await
|
|
2922
|
+
const content = await fs2.readFile(filename, "utf8");
|
|
5907
2923
|
return extractAugmentations(content);
|
|
5908
2924
|
}
|
|
5909
2925
|
async function patch(filename, augmentations2) {
|
|
5910
|
-
const content = await
|
|
2926
|
+
const content = await fs2.readFile(filename, "utf8");
|
|
5911
2927
|
const patched = [content, ...augmentations2].join("\n\n");
|
|
5912
|
-
await
|
|
2928
|
+
await fs2.writeFile(filename, patched, "utf8");
|
|
5913
2929
|
}
|
|
5914
2930
|
console.log();
|
|
5915
2931
|
console.group("Patching module augmentations");
|
|
@@ -5921,7 +2937,7 @@ async function patchAugmentations(config) {
|
|
|
5921
2937
|
"declaration files referenced by",
|
|
5922
2938
|
mainEntryPointFilePath
|
|
5923
2939
|
);
|
|
5924
|
-
const promises = Array.from(files, (
|
|
2940
|
+
const promises = Array.from(files, (it) => extract(it));
|
|
5925
2941
|
const result = await Promise.all(promises);
|
|
5926
2942
|
const augmentations = result.flat();
|
|
5927
2943
|
console.log("Found", augmentations.length, "module augmentation(s)");
|
|
@@ -5938,10 +2954,12 @@ async function patchDeclareVarVls(declarationDir) {
|
|
|
5938
2954
|
`Patching vue-tsc dts files in "${declarationDir}" (microsoft/rushstack#5146)`
|
|
5939
2955
|
);
|
|
5940
2956
|
let numPatchedFiles = 0;
|
|
5941
|
-
const filenames = await
|
|
2957
|
+
const filenames = await Array.fromAsync(
|
|
2958
|
+
fs2.glob("**/*.vue.d.ts", { cwd: declarationDir })
|
|
2959
|
+
);
|
|
5942
2960
|
const promises = filenames.map(async (filename) => {
|
|
5943
2961
|
const filePath = path3.join(declarationDir, filename);
|
|
5944
|
-
const content = await
|
|
2962
|
+
const content = await fs2.readFile(filePath, "utf8");
|
|
5945
2963
|
const updated = content.replace(
|
|
5946
2964
|
/declare var (__VLS_\d+)/,
|
|
5947
2965
|
"declare const $1"
|
|
@@ -5949,7 +2967,7 @@ async function patchDeclareVarVls(declarationDir) {
|
|
|
5949
2967
|
if (content === updated) {
|
|
5950
2968
|
return;
|
|
5951
2969
|
}
|
|
5952
|
-
await
|
|
2970
|
+
await fs2.writeFile(filePath, updated, "utf8");
|
|
5953
2971
|
numPatchedFiles++;
|
|
5954
2972
|
console.log(filename);
|
|
5955
2973
|
});
|
|
@@ -5961,7 +2979,7 @@ async function patchDeclareVarVls(declarationDir) {
|
|
|
5961
2979
|
);
|
|
5962
2980
|
}
|
|
5963
2981
|
async function run(argv) {
|
|
5964
|
-
const flags = new Set(argv.filter((
|
|
2982
|
+
const flags = new Set(argv.filter((it) => it.startsWith("--")));
|
|
5965
2983
|
if (flags.has("--help")) {
|
|
5966
2984
|
console.log("usage: fk-api-extractor [OPTIONS..] [FILENAME..]");
|
|
5967
2985
|
console.log(`
|
|
@@ -5979,7 +2997,7 @@ only.
|
|
|
5979
2997
|
`);
|
|
5980
2998
|
return;
|
|
5981
2999
|
}
|
|
5982
|
-
const positional = argv.filter((
|
|
3000
|
+
const positional = argv.filter((it) => !it.startsWith("--"));
|
|
5983
3001
|
const configFiles = await getConfigFiles(positional);
|
|
5984
3002
|
const numFiles = configFiles.length;
|
|
5985
3003
|
const strFiles = `${String(numFiles)} file${numFiles === 1 ? "" : "s"}`;
|