@hyperfixi/mcp-server 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/chunk-P76KH42G.js +247 -0
- package/dist/{esm-LUPOYJFX.js → esm-RQFF6QRX.js} +512 -486
- package/dist/feedback-tools-S6VDG6F5.js +10 -0
- package/dist/index.js +907 -413
- package/package.json +8 -5
|
@@ -114,11 +114,11 @@ function embrace(str) {
|
|
|
114
114
|
function isPadded(el) {
|
|
115
115
|
return /^-?0\d/.test(el);
|
|
116
116
|
}
|
|
117
|
-
function lte(i,
|
|
118
|
-
return i <=
|
|
117
|
+
function lte(i, y) {
|
|
118
|
+
return i <= y;
|
|
119
119
|
}
|
|
120
|
-
function gte(i,
|
|
121
|
-
return i >=
|
|
120
|
+
function gte(i, y) {
|
|
121
|
+
return i >= y;
|
|
122
122
|
}
|
|
123
123
|
function expand_(str, max, isTop) {
|
|
124
124
|
const expansions = [];
|
|
@@ -128,8 +128,8 @@ function expand_(str, max, isTop) {
|
|
|
128
128
|
const pre = m.pre;
|
|
129
129
|
const post = m.post.length ? expand_(m.post, max, false) : [""];
|
|
130
130
|
if (/\$$/.test(m.pre)) {
|
|
131
|
-
for (let
|
|
132
|
-
const expansion = pre + "{" + m.body + "}" + post[
|
|
131
|
+
for (let k2 = 0; k2 < post.length && k2 < max; k2++) {
|
|
132
|
+
const expansion = pre + "{" + m.body + "}" + post[k2];
|
|
133
133
|
expansions.push(expansion);
|
|
134
134
|
}
|
|
135
135
|
} else {
|
|
@@ -158,50 +158,50 @@ function expand_(str, max, isTop) {
|
|
|
158
158
|
}
|
|
159
159
|
let N;
|
|
160
160
|
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
|
|
161
|
-
const
|
|
162
|
-
const
|
|
161
|
+
const x = numeric(n[0]);
|
|
162
|
+
const y = numeric(n[1]);
|
|
163
163
|
const width = Math.max(n[0].length, n[1].length);
|
|
164
|
-
let incr = n.length === 3 && n[2] !== void 0 ? Math.abs(numeric(n[2])) : 1;
|
|
164
|
+
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
|
165
165
|
let test = lte;
|
|
166
|
-
const reverse =
|
|
166
|
+
const reverse = y < x;
|
|
167
167
|
if (reverse) {
|
|
168
168
|
incr *= -1;
|
|
169
169
|
test = gte;
|
|
170
170
|
}
|
|
171
171
|
const pad = n.some(isPadded);
|
|
172
172
|
N = [];
|
|
173
|
-
for (let i =
|
|
174
|
-
let
|
|
173
|
+
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
174
|
+
let c;
|
|
175
175
|
if (isAlphaSequence) {
|
|
176
|
-
|
|
177
|
-
if (
|
|
178
|
-
|
|
176
|
+
c = String.fromCharCode(i);
|
|
177
|
+
if (c === "\\") {
|
|
178
|
+
c = "";
|
|
179
179
|
}
|
|
180
180
|
} else {
|
|
181
|
-
|
|
181
|
+
c = String(i);
|
|
182
182
|
if (pad) {
|
|
183
|
-
const need = width -
|
|
183
|
+
const need = width - c.length;
|
|
184
184
|
if (need > 0) {
|
|
185
|
-
const
|
|
185
|
+
const z = new Array(need + 1).join("0");
|
|
186
186
|
if (i < 0) {
|
|
187
|
-
|
|
187
|
+
c = "-" + z + c.slice(1);
|
|
188
188
|
} else {
|
|
189
|
-
|
|
189
|
+
c = z + c;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
N.push(
|
|
194
|
+
N.push(c);
|
|
195
195
|
}
|
|
196
196
|
} else {
|
|
197
197
|
N = [];
|
|
198
|
-
for (let
|
|
199
|
-
N.push.apply(N, expand_(n[
|
|
198
|
+
for (let j2 = 0; j2 < n.length; j2++) {
|
|
199
|
+
N.push.apply(N, expand_(n[j2], max, false));
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
for (let
|
|
203
|
-
for (let
|
|
204
|
-
const expansion = pre + N[
|
|
202
|
+
for (let j2 = 0; j2 < N.length; j2++) {
|
|
203
|
+
for (let k2 = 0; k2 < post.length && expansions.length < max; k2++) {
|
|
204
|
+
const expansion = pre + N[j2] + post[k2];
|
|
205
205
|
if (!isTop || isSequence || expansion) {
|
|
206
206
|
expansions.push(expansion);
|
|
207
207
|
}
|
|
@@ -257,26 +257,26 @@ var parseClass = (glob2, position) => {
|
|
|
257
257
|
let endPos = pos;
|
|
258
258
|
let rangeStart = "";
|
|
259
259
|
WHILE: while (i < glob2.length) {
|
|
260
|
-
const
|
|
261
|
-
if ((
|
|
260
|
+
const c = glob2.charAt(i);
|
|
261
|
+
if ((c === "!" || c === "^") && i === pos + 1) {
|
|
262
262
|
negate = true;
|
|
263
263
|
i++;
|
|
264
264
|
continue;
|
|
265
265
|
}
|
|
266
|
-
if (
|
|
266
|
+
if (c === "]" && sawStart && !escaping) {
|
|
267
267
|
endPos = i + 1;
|
|
268
268
|
break;
|
|
269
269
|
}
|
|
270
270
|
sawStart = true;
|
|
271
|
-
if (
|
|
271
|
+
if (c === "\\") {
|
|
272
272
|
if (!escaping) {
|
|
273
273
|
escaping = true;
|
|
274
274
|
i++;
|
|
275
275
|
continue;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
if (
|
|
279
|
-
for (const [cls, [unip,
|
|
278
|
+
if (c === "[" && !escaping) {
|
|
279
|
+
for (const [cls, [unip, u3, neg]] of Object.entries(posixClasses)) {
|
|
280
280
|
if (glob2.startsWith(cls, i)) {
|
|
281
281
|
if (rangeStart) {
|
|
282
282
|
return ["$.", false, glob2.length - pos, true];
|
|
@@ -286,33 +286,33 @@ var parseClass = (glob2, position) => {
|
|
|
286
286
|
negs.push(unip);
|
|
287
287
|
else
|
|
288
288
|
ranges.push(unip);
|
|
289
|
-
uflag = uflag ||
|
|
289
|
+
uflag = uflag || u3;
|
|
290
290
|
continue WHILE;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
escaping = false;
|
|
295
295
|
if (rangeStart) {
|
|
296
|
-
if (
|
|
297
|
-
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(
|
|
298
|
-
} else if (
|
|
299
|
-
ranges.push(braceEscape(
|
|
296
|
+
if (c > rangeStart) {
|
|
297
|
+
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
298
|
+
} else if (c === rangeStart) {
|
|
299
|
+
ranges.push(braceEscape(c));
|
|
300
300
|
}
|
|
301
301
|
rangeStart = "";
|
|
302
302
|
i++;
|
|
303
303
|
continue;
|
|
304
304
|
}
|
|
305
305
|
if (glob2.startsWith("-]", i + 1)) {
|
|
306
|
-
ranges.push(braceEscape(
|
|
306
|
+
ranges.push(braceEscape(c + "-"));
|
|
307
307
|
i += 2;
|
|
308
308
|
continue;
|
|
309
309
|
}
|
|
310
310
|
if (glob2.startsWith("-", i + 1)) {
|
|
311
|
-
rangeStart =
|
|
311
|
+
rangeStart = c;
|
|
312
312
|
i += 2;
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
315
|
-
ranges.push(braceEscape(
|
|
315
|
+
ranges.push(braceEscape(c));
|
|
316
316
|
i++;
|
|
317
317
|
}
|
|
318
318
|
if (endPos < i) {
|
|
@@ -334,16 +334,16 @@ var parseClass = (glob2, position) => {
|
|
|
334
334
|
// ../../node_modules/minimatch/dist/esm/unescape.js
|
|
335
335
|
var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
|
|
336
336
|
if (magicalBraces) {
|
|
337
|
-
return windowsPathsNoEscape ? s.replace(/\[([
|
|
337
|
+
return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
|
|
338
338
|
}
|
|
339
|
-
return windowsPathsNoEscape ? s.replace(/\[([
|
|
339
|
+
return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
|
|
340
340
|
};
|
|
341
341
|
|
|
342
342
|
// ../../node_modules/minimatch/dist/esm/ast.js
|
|
343
343
|
var _a;
|
|
344
344
|
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
345
|
-
var isExtglobType = (
|
|
346
|
-
var isExtglobAST = (
|
|
345
|
+
var isExtglobType = (c) => types.has(c);
|
|
346
|
+
var isExtglobAST = (c) => isExtglobType(c.type);
|
|
347
347
|
var adoptionMap = /* @__PURE__ */ new Map([
|
|
348
348
|
["!", ["@"]],
|
|
349
349
|
["?", ["?", "@"]],
|
|
@@ -456,13 +456,7 @@ var AST = class {
|
|
|
456
456
|
}
|
|
457
457
|
// reconstructs the pattern
|
|
458
458
|
toString() {
|
|
459
|
-
|
|
460
|
-
return this.#toString;
|
|
461
|
-
if (!this.type) {
|
|
462
|
-
return this.#toString = this.#parts.map((p) => String(p)).join("");
|
|
463
|
-
} else {
|
|
464
|
-
return this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
|
|
465
|
-
}
|
|
459
|
+
return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p) => String(p)).join("") : this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
|
|
466
460
|
}
|
|
467
461
|
#fillNegs() {
|
|
468
462
|
if (this !== this.#root)
|
|
@@ -546,11 +540,11 @@ var AST = class {
|
|
|
546
540
|
this.push(part.clone(this));
|
|
547
541
|
}
|
|
548
542
|
clone(parent) {
|
|
549
|
-
const
|
|
543
|
+
const c = new _a(this.type, parent);
|
|
550
544
|
for (const p of this.#parts) {
|
|
551
|
-
|
|
545
|
+
c.copyIn(p);
|
|
552
546
|
}
|
|
553
|
-
return
|
|
547
|
+
return c;
|
|
554
548
|
}
|
|
555
549
|
static #parseAST(str, ast, pos, opt, extDepth) {
|
|
556
550
|
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
|
@@ -562,39 +556,39 @@ var AST = class {
|
|
|
562
556
|
let i2 = pos;
|
|
563
557
|
let acc2 = "";
|
|
564
558
|
while (i2 < str.length) {
|
|
565
|
-
const
|
|
566
|
-
if (escaping ||
|
|
559
|
+
const c = str.charAt(i2++);
|
|
560
|
+
if (escaping || c === "\\") {
|
|
567
561
|
escaping = !escaping;
|
|
568
|
-
acc2 +=
|
|
562
|
+
acc2 += c;
|
|
569
563
|
continue;
|
|
570
564
|
}
|
|
571
565
|
if (inBrace) {
|
|
572
566
|
if (i2 === braceStart + 1) {
|
|
573
|
-
if (
|
|
567
|
+
if (c === "^" || c === "!") {
|
|
574
568
|
braceNeg = true;
|
|
575
569
|
}
|
|
576
|
-
} else if (
|
|
570
|
+
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
577
571
|
inBrace = false;
|
|
578
572
|
}
|
|
579
|
-
acc2 +=
|
|
573
|
+
acc2 += c;
|
|
580
574
|
continue;
|
|
581
|
-
} else if (
|
|
575
|
+
} else if (c === "[") {
|
|
582
576
|
inBrace = true;
|
|
583
577
|
braceStart = i2;
|
|
584
578
|
braceNeg = false;
|
|
585
|
-
acc2 +=
|
|
579
|
+
acc2 += c;
|
|
586
580
|
continue;
|
|
587
581
|
}
|
|
588
|
-
const doRecurse = !opt.noext && isExtglobType(
|
|
582
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
|
|
589
583
|
if (doRecurse) {
|
|
590
584
|
ast.push(acc2);
|
|
591
585
|
acc2 = "";
|
|
592
|
-
const ext2 = new _a(
|
|
586
|
+
const ext2 = new _a(c, ast);
|
|
593
587
|
i2 = _a.#parseAST(str, ext2, i2, opt, extDepth + 1);
|
|
594
588
|
ast.push(ext2);
|
|
595
589
|
continue;
|
|
596
590
|
}
|
|
597
|
-
acc2 +=
|
|
591
|
+
acc2 += c;
|
|
598
592
|
}
|
|
599
593
|
ast.push(acc2);
|
|
600
594
|
return i2;
|
|
@@ -604,48 +598,48 @@ var AST = class {
|
|
|
604
598
|
const parts = [];
|
|
605
599
|
let acc = "";
|
|
606
600
|
while (i < str.length) {
|
|
607
|
-
const
|
|
608
|
-
if (escaping ||
|
|
601
|
+
const c = str.charAt(i++);
|
|
602
|
+
if (escaping || c === "\\") {
|
|
609
603
|
escaping = !escaping;
|
|
610
|
-
acc +=
|
|
604
|
+
acc += c;
|
|
611
605
|
continue;
|
|
612
606
|
}
|
|
613
607
|
if (inBrace) {
|
|
614
608
|
if (i === braceStart + 1) {
|
|
615
|
-
if (
|
|
609
|
+
if (c === "^" || c === "!") {
|
|
616
610
|
braceNeg = true;
|
|
617
611
|
}
|
|
618
|
-
} else if (
|
|
612
|
+
} else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
|
|
619
613
|
inBrace = false;
|
|
620
614
|
}
|
|
621
|
-
acc +=
|
|
615
|
+
acc += c;
|
|
622
616
|
continue;
|
|
623
|
-
} else if (
|
|
617
|
+
} else if (c === "[") {
|
|
624
618
|
inBrace = true;
|
|
625
619
|
braceStart = i;
|
|
626
620
|
braceNeg = false;
|
|
627
|
-
acc +=
|
|
621
|
+
acc += c;
|
|
628
622
|
continue;
|
|
629
623
|
}
|
|
630
|
-
const doRecurse = !opt.noext && isExtglobType(
|
|
631
|
-
(extDepth <= maxDepth || ast && ast.#canAdoptType(
|
|
624
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
625
|
+
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
|
632
626
|
if (doRecurse) {
|
|
633
|
-
const depthAdd = ast && ast.#canAdoptType(
|
|
627
|
+
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
634
628
|
part.push(acc);
|
|
635
629
|
acc = "";
|
|
636
|
-
const ext2 = new _a(
|
|
630
|
+
const ext2 = new _a(c, part);
|
|
637
631
|
part.push(ext2);
|
|
638
632
|
i = _a.#parseAST(str, ext2, i, opt, extDepth + depthAdd);
|
|
639
633
|
continue;
|
|
640
634
|
}
|
|
641
|
-
if (
|
|
635
|
+
if (c === "|") {
|
|
642
636
|
part.push(acc);
|
|
643
637
|
acc = "";
|
|
644
638
|
parts.push(part);
|
|
645
639
|
part = new _a(null, ast);
|
|
646
640
|
continue;
|
|
647
641
|
}
|
|
648
|
-
if (
|
|
642
|
+
if (c === ")") {
|
|
649
643
|
if (acc === "" && ast.#parts.length === 0) {
|
|
650
644
|
ast.#emptyExt = true;
|
|
651
645
|
}
|
|
@@ -654,7 +648,7 @@ var AST = class {
|
|
|
654
648
|
ast.push(...parts, part);
|
|
655
649
|
return i;
|
|
656
650
|
}
|
|
657
|
-
acc +=
|
|
651
|
+
acc += c;
|
|
658
652
|
}
|
|
659
653
|
ast.type = null;
|
|
660
654
|
ast.#hasMagic = void 0;
|
|
@@ -674,8 +668,8 @@ var AST = class {
|
|
|
674
668
|
}
|
|
675
669
|
return this.#canAdoptType(gc.type, map);
|
|
676
670
|
}
|
|
677
|
-
#canAdoptType(
|
|
678
|
-
return !!map.get(this.type)?.includes(
|
|
671
|
+
#canAdoptType(c, map = adoptionAnyMap) {
|
|
672
|
+
return !!map.get(this.type)?.includes(c);
|
|
679
673
|
}
|
|
680
674
|
#adoptWithSpace(child, index) {
|
|
681
675
|
const gc = child.#parts[0];
|
|
@@ -693,9 +687,9 @@ var AST = class {
|
|
|
693
687
|
}
|
|
694
688
|
this.#toString = void 0;
|
|
695
689
|
}
|
|
696
|
-
#canUsurpType(
|
|
690
|
+
#canUsurpType(c) {
|
|
697
691
|
const m = usurpMap.get(this.type);
|
|
698
|
-
return !!m?.has(
|
|
692
|
+
return !!m?.has(c);
|
|
699
693
|
}
|
|
700
694
|
#canUsurp(child) {
|
|
701
695
|
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
|
@@ -908,18 +902,18 @@ var AST = class {
|
|
|
908
902
|
do {
|
|
909
903
|
done = true;
|
|
910
904
|
for (let i = 0; i < this.#parts.length; i++) {
|
|
911
|
-
const
|
|
912
|
-
if (typeof
|
|
913
|
-
|
|
914
|
-
if (this.#canAdopt(
|
|
905
|
+
const c = this.#parts[i];
|
|
906
|
+
if (typeof c === "object") {
|
|
907
|
+
c.#flatten();
|
|
908
|
+
if (this.#canAdopt(c)) {
|
|
915
909
|
done = false;
|
|
916
|
-
this.#adopt(
|
|
917
|
-
} else if (this.#canAdoptWithSpace(
|
|
910
|
+
this.#adopt(c, i);
|
|
911
|
+
} else if (this.#canAdoptWithSpace(c)) {
|
|
918
912
|
done = false;
|
|
919
|
-
this.#adoptWithSpace(
|
|
920
|
-
} else if (this.#canUsurp(
|
|
913
|
+
this.#adoptWithSpace(c, i);
|
|
914
|
+
} else if (this.#canUsurp(c)) {
|
|
921
915
|
done = false;
|
|
922
|
-
this.#usurp(
|
|
916
|
+
this.#usurp(c);
|
|
923
917
|
}
|
|
924
918
|
}
|
|
925
919
|
}
|
|
@@ -943,13 +937,13 @@ var AST = class {
|
|
|
943
937
|
let uflag = false;
|
|
944
938
|
let inStar = false;
|
|
945
939
|
for (let i = 0; i < glob2.length; i++) {
|
|
946
|
-
const
|
|
940
|
+
const c = glob2.charAt(i);
|
|
947
941
|
if (escaping) {
|
|
948
942
|
escaping = false;
|
|
949
|
-
re += (reSpecials.has(
|
|
943
|
+
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
950
944
|
continue;
|
|
951
945
|
}
|
|
952
|
-
if (
|
|
946
|
+
if (c === "*") {
|
|
953
947
|
if (inStar)
|
|
954
948
|
continue;
|
|
955
949
|
inStar = true;
|
|
@@ -959,7 +953,7 @@ var AST = class {
|
|
|
959
953
|
} else {
|
|
960
954
|
inStar = false;
|
|
961
955
|
}
|
|
962
|
-
if (
|
|
956
|
+
if (c === "\\") {
|
|
963
957
|
if (i === glob2.length - 1) {
|
|
964
958
|
re += "\\\\";
|
|
965
959
|
} else {
|
|
@@ -967,7 +961,7 @@ var AST = class {
|
|
|
967
961
|
}
|
|
968
962
|
continue;
|
|
969
963
|
}
|
|
970
|
-
if (
|
|
964
|
+
if (c === "[") {
|
|
971
965
|
const [src, needUflag, consumed, magic] = parseClass(glob2, i);
|
|
972
966
|
if (consumed) {
|
|
973
967
|
re += src;
|
|
@@ -977,12 +971,12 @@ var AST = class {
|
|
|
977
971
|
continue;
|
|
978
972
|
}
|
|
979
973
|
}
|
|
980
|
-
if (
|
|
974
|
+
if (c === "?") {
|
|
981
975
|
re += qmark;
|
|
982
976
|
hasMagic2 = true;
|
|
983
977
|
continue;
|
|
984
978
|
}
|
|
985
|
-
re += regExpEscape(
|
|
979
|
+
re += regExpEscape(c);
|
|
986
980
|
}
|
|
987
981
|
return [re, unescape(glob2), !!hasMagic2, uflag];
|
|
988
982
|
}
|
|
@@ -1005,7 +999,7 @@ var minimatch = (p, pattern, options = {}) => {
|
|
|
1005
999
|
}
|
|
1006
1000
|
return new Minimatch(pattern, options).match(p);
|
|
1007
1001
|
};
|
|
1008
|
-
var starDotExtRE = /^\*+([
|
|
1002
|
+
var starDotExtRE = /^\*+([^+@!?*[(]*)$/;
|
|
1009
1003
|
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
|
1010
1004
|
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
|
|
1011
1005
|
var starDotExtTestNocase = (ext2) => {
|
|
@@ -1024,7 +1018,7 @@ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
|
1024
1018
|
var starRE = /^\*+$/;
|
|
1025
1019
|
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
1026
1020
|
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
1027
|
-
var qmarksRE = /^\?+([
|
|
1021
|
+
var qmarksRE = /^\?+([^+@!?*[(]*)?$/;
|
|
1028
1022
|
var qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
1029
1023
|
const noext = qmarksTestNoExt([$0]);
|
|
1030
1024
|
if (!ext2)
|
|
@@ -1243,10 +1237,10 @@ var Minimatch = class {
|
|
|
1243
1237
|
// of patterns that we have to process.
|
|
1244
1238
|
preprocess(globParts) {
|
|
1245
1239
|
if (this.options.noglobstar) {
|
|
1246
|
-
for (
|
|
1247
|
-
for (let
|
|
1248
|
-
if (
|
|
1249
|
-
|
|
1240
|
+
for (const partset of globParts) {
|
|
1241
|
+
for (let j2 = 0; j2 < partset.length; j2++) {
|
|
1242
|
+
if (partset[j2] === "**") {
|
|
1243
|
+
partset[j2] = "*";
|
|
1250
1244
|
}
|
|
1251
1245
|
}
|
|
1252
1246
|
}
|
|
@@ -1324,7 +1318,7 @@ var Minimatch = class {
|
|
|
1324
1318
|
let dd = 0;
|
|
1325
1319
|
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1326
1320
|
const p = parts[dd - 1];
|
|
1327
|
-
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1321
|
+
if (p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p))) {
|
|
1328
1322
|
didSomething = true;
|
|
1329
1323
|
parts.splice(dd - 1, 2);
|
|
1330
1324
|
dd -= 2;
|
|
@@ -1422,11 +1416,11 @@ var Minimatch = class {
|
|
|
1422
1416
|
// ^-- not valid because ** doens't follow symlinks
|
|
1423
1417
|
secondPhasePreProcess(globParts) {
|
|
1424
1418
|
for (let i = 0; i < globParts.length - 1; i++) {
|
|
1425
|
-
for (let
|
|
1426
|
-
const matched = this.partsMatch(globParts[i], globParts[
|
|
1419
|
+
for (let j2 = i + 1; j2 < globParts.length; j2++) {
|
|
1420
|
+
const matched = this.partsMatch(globParts[i], globParts[j2], !this.preserveMultipleSlashes);
|
|
1427
1421
|
if (matched) {
|
|
1428
1422
|
globParts[i] = [];
|
|
1429
|
-
globParts[
|
|
1423
|
+
globParts[j2] = matched;
|
|
1430
1424
|
break;
|
|
1431
1425
|
}
|
|
1432
1426
|
}
|
|
@@ -1740,7 +1734,7 @@ var Minimatch = class {
|
|
|
1740
1734
|
re = "^(?!" + re + ").+$";
|
|
1741
1735
|
try {
|
|
1742
1736
|
this.regexp = new RegExp(re, [...flags].join(""));
|
|
1743
|
-
} catch
|
|
1737
|
+
} catch {
|
|
1744
1738
|
this.regexp = false;
|
|
1745
1739
|
}
|
|
1746
1740
|
return this.regexp;
|
|
@@ -1748,7 +1742,7 @@ var Minimatch = class {
|
|
|
1748
1742
|
slashSplit(p) {
|
|
1749
1743
|
if (this.preserveMultipleSlashes) {
|
|
1750
1744
|
return p.split("/");
|
|
1751
|
-
} else if (this.isWindows && /^\/\/[
|
|
1745
|
+
} else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
|
|
1752
1746
|
return ["", ...p.split(/\/+/)];
|
|
1753
1747
|
} else {
|
|
1754
1748
|
return p.split(/\/+/);
|
|
@@ -1779,8 +1773,7 @@ var Minimatch = class {
|
|
|
1779
1773
|
filename = ff[i];
|
|
1780
1774
|
}
|
|
1781
1775
|
}
|
|
1782
|
-
for (
|
|
1783
|
-
const pattern = set[i];
|
|
1776
|
+
for (const pattern of set) {
|
|
1784
1777
|
let file = ff;
|
|
1785
1778
|
if (options.matchBase && pattern.length === 1) {
|
|
1786
1779
|
file = [filename];
|
|
@@ -1810,79 +1803,54 @@ minimatch.unescape = unescape;
|
|
|
1810
1803
|
// ../../node_modules/glob/dist/esm/glob.js
|
|
1811
1804
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1812
1805
|
|
|
1813
|
-
// ../../node_modules/lru-cache/dist/esm/index.min.js
|
|
1814
|
-
|
|
1815
|
-
var
|
|
1816
|
-
var
|
|
1817
|
-
var
|
|
1818
|
-
|
|
1806
|
+
// ../../node_modules/lru-cache/dist/esm/node/index.min.js
|
|
1807
|
+
import { tracingChannel as G, channel as P } from "diagnostics_channel";
|
|
1808
|
+
var S = P("lru-cache:metrics");
|
|
1809
|
+
var W = G("lru-cache");
|
|
1810
|
+
var L = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
1811
|
+
var D = () => S.hasSubscribers || W.hasSubscribers;
|
|
1812
|
+
var U = /* @__PURE__ */ new Set();
|
|
1813
|
+
var M = typeof process == "object" && process ? process : {};
|
|
1814
|
+
var k = (u3, e, t, i) => {
|
|
1815
|
+
typeof M.emitWarning == "function" ? M.emitWarning(u3, e, t, i) : console.error(`[${t}] ${e}: ${u3}`);
|
|
1819
1816
|
};
|
|
1820
|
-
var
|
|
1821
|
-
var
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
reason;
|
|
1827
|
-
aborted = false;
|
|
1828
|
-
addEventListener(i, s) {
|
|
1829
|
-
this._onabort.push(s);
|
|
1830
|
-
}
|
|
1831
|
-
}, C = class {
|
|
1832
|
-
constructor() {
|
|
1833
|
-
t();
|
|
1834
|
-
}
|
|
1835
|
-
signal = new D();
|
|
1836
|
-
abort(i) {
|
|
1837
|
-
if (!this.signal.aborted) {
|
|
1838
|
-
this.signal.reason = i, this.signal.aborted = true;
|
|
1839
|
-
for (let s of this.signal._onabort) s(i);
|
|
1840
|
-
this.signal.onabort?.(i);
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
};
|
|
1844
|
-
let c3 = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
1845
|
-
c3 && (c3 = false, U("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));
|
|
1846
|
-
};
|
|
1847
|
-
}
|
|
1848
|
-
var G = (c3) => !I.has(c3);
|
|
1849
|
-
var H = Symbol("type");
|
|
1850
|
-
var y = (c3) => c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
|
|
1851
|
-
var M = (c3) => y(c3) ? c3 <= Math.pow(2, 8) ? Uint8Array : c3 <= Math.pow(2, 16) ? Uint16Array : c3 <= Math.pow(2, 32) ? Uint32Array : c3 <= Number.MAX_SAFE_INTEGER ? z : null : null;
|
|
1852
|
-
var z = class extends Array {
|
|
1853
|
-
constructor(t) {
|
|
1854
|
-
super(t), this.fill(0);
|
|
1817
|
+
var H = (u3) => !U.has(u3);
|
|
1818
|
+
var T = (u3) => !!u3 && u3 === Math.floor(u3) && u3 > 0 && isFinite(u3);
|
|
1819
|
+
var j = (u3) => T(u3) ? u3 <= Math.pow(2, 8) ? Uint8Array : u3 <= Math.pow(2, 16) ? Uint16Array : u3 <= Math.pow(2, 32) ? Uint32Array : u3 <= Number.MAX_SAFE_INTEGER ? O : null : null;
|
|
1820
|
+
var O = class extends Array {
|
|
1821
|
+
constructor(e) {
|
|
1822
|
+
super(e), this.fill(0);
|
|
1855
1823
|
}
|
|
1856
1824
|
};
|
|
1857
|
-
var
|
|
1825
|
+
var R = class u {
|
|
1858
1826
|
heap;
|
|
1859
1827
|
length;
|
|
1860
1828
|
static #o = false;
|
|
1861
|
-
static create(
|
|
1862
|
-
let
|
|
1863
|
-
if (!
|
|
1864
|
-
|
|
1865
|
-
let i = new
|
|
1866
|
-
return
|
|
1829
|
+
static create(e) {
|
|
1830
|
+
let t = j(e);
|
|
1831
|
+
if (!t) return [];
|
|
1832
|
+
u.#o = true;
|
|
1833
|
+
let i = new u(e, t);
|
|
1834
|
+
return u.#o = false, i;
|
|
1867
1835
|
}
|
|
1868
|
-
constructor(
|
|
1869
|
-
if (!
|
|
1870
|
-
this.heap = new e
|
|
1836
|
+
constructor(e, t) {
|
|
1837
|
+
if (!u.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
1838
|
+
this.heap = new t(e), this.length = 0;
|
|
1871
1839
|
}
|
|
1872
|
-
push(
|
|
1873
|
-
this.heap[this.length++] =
|
|
1840
|
+
push(e) {
|
|
1841
|
+
this.heap[this.length++] = e;
|
|
1874
1842
|
}
|
|
1875
1843
|
pop() {
|
|
1876
1844
|
return this.heap[--this.length];
|
|
1877
1845
|
}
|
|
1878
1846
|
};
|
|
1879
|
-
var
|
|
1847
|
+
var I = class u2 {
|
|
1880
1848
|
#o;
|
|
1881
1849
|
#c;
|
|
1882
|
-
#w;
|
|
1883
|
-
#C;
|
|
1884
1850
|
#S;
|
|
1885
|
-
#
|
|
1851
|
+
#O;
|
|
1852
|
+
#w;
|
|
1853
|
+
#M;
|
|
1886
1854
|
#I;
|
|
1887
1855
|
#m;
|
|
1888
1856
|
get perf() {
|
|
@@ -1903,31 +1871,32 @@ var L = class c2 {
|
|
|
1903
1871
|
allowStaleOnFetchAbort;
|
|
1904
1872
|
allowStaleOnFetchRejection;
|
|
1905
1873
|
ignoreFetchAbort;
|
|
1874
|
+
backgroundFetchSize;
|
|
1906
1875
|
#n;
|
|
1907
|
-
#
|
|
1876
|
+
#b;
|
|
1908
1877
|
#s;
|
|
1909
1878
|
#i;
|
|
1910
1879
|
#t;
|
|
1911
|
-
#a;
|
|
1912
|
-
#u;
|
|
1913
1880
|
#l;
|
|
1881
|
+
#u;
|
|
1882
|
+
#a;
|
|
1914
1883
|
#h;
|
|
1915
|
-
#b;
|
|
1916
|
-
#r;
|
|
1917
1884
|
#y;
|
|
1918
|
-
#
|
|
1885
|
+
#r;
|
|
1886
|
+
#_;
|
|
1887
|
+
#F;
|
|
1919
1888
|
#d;
|
|
1920
1889
|
#g;
|
|
1921
1890
|
#T;
|
|
1922
|
-
#v;
|
|
1923
|
-
#f;
|
|
1924
1891
|
#U;
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1892
|
+
#f;
|
|
1893
|
+
#x;
|
|
1894
|
+
static unsafeExposeInternals(e) {
|
|
1895
|
+
return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#l, prev: e.#u, get head() {
|
|
1896
|
+
return e.#a;
|
|
1928
1897
|
}, get tail() {
|
|
1929
|
-
return
|
|
1930
|
-
}, free:
|
|
1898
|
+
return e.#h;
|
|
1899
|
+
}, free: e.#y, isBackgroundFetch: (t) => e.#e(t), backgroundFetch: (t, i, s, n) => e.#P(t, i, s, n), moveToTail: (t) => e.#L(t), indexes: (t) => e.#A(t), rindexes: (t) => e.#z(t), isStale: (t) => e.#p(t) };
|
|
1931
1900
|
}
|
|
1932
1901
|
get max() {
|
|
1933
1902
|
return this.#o;
|
|
@@ -1936,425 +1905,482 @@ var L = class c2 {
|
|
|
1936
1905
|
return this.#c;
|
|
1937
1906
|
}
|
|
1938
1907
|
get calculatedSize() {
|
|
1939
|
-
return this.#
|
|
1908
|
+
return this.#b;
|
|
1940
1909
|
}
|
|
1941
1910
|
get size() {
|
|
1942
1911
|
return this.#n;
|
|
1943
1912
|
}
|
|
1944
1913
|
get fetchMethod() {
|
|
1945
|
-
return this.#
|
|
1914
|
+
return this.#M;
|
|
1946
1915
|
}
|
|
1947
1916
|
get memoMethod() {
|
|
1948
1917
|
return this.#I;
|
|
1949
1918
|
}
|
|
1950
1919
|
get dispose() {
|
|
1951
|
-
return this.#
|
|
1920
|
+
return this.#S;
|
|
1952
1921
|
}
|
|
1953
1922
|
get onInsert() {
|
|
1954
|
-
return this.#
|
|
1923
|
+
return this.#O;
|
|
1955
1924
|
}
|
|
1956
1925
|
get disposeAfter() {
|
|
1957
|
-
return this.#
|
|
1926
|
+
return this.#w;
|
|
1958
1927
|
}
|
|
1959
|
-
constructor(
|
|
1960
|
-
let { max:
|
|
1961
|
-
if (
|
|
1962
|
-
if (this.#m =
|
|
1963
|
-
let
|
|
1964
|
-
if (!
|
|
1965
|
-
if (this.#o =
|
|
1928
|
+
constructor(e) {
|
|
1929
|
+
let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: r, updateAgeOnHas: h, allowStale: a, dispose: o, onInsert: d, disposeAfter: y, noDisposeOnSet: _, noUpdateTTL: c, maxSize: g = 0, maxEntrySize: f = 0, sizeCalculation: b, fetchMethod: l, memoMethod: w, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: m, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: C = 1, perf: E } = e;
|
|
1930
|
+
if (this.backgroundFetchSize = C, E !== void 0 && typeof E?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
1931
|
+
if (this.#m = E ?? L, t !== 0 && !T(t)) throw new TypeError("max option must be a nonnegative integer");
|
|
1932
|
+
let v = t ? j(t) : Array;
|
|
1933
|
+
if (!v) throw new Error("invalid max value: " + t);
|
|
1934
|
+
if (this.#o = t, this.#c = g, this.maxEntrySize = f || this.#c, this.sizeCalculation = b, this.sizeCalculation) {
|
|
1966
1935
|
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1967
1936
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
1968
1937
|
}
|
|
1969
|
-
if (
|
|
1970
|
-
if (this.#I =
|
|
1971
|
-
if (this.#
|
|
1972
|
-
if (this.#c !== 0 && !
|
|
1973
|
-
if (!
|
|
1974
|
-
this.#
|
|
1938
|
+
if (w !== void 0 && typeof w != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
1939
|
+
if (this.#I = w, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
1940
|
+
if (this.#M = l, this.#U = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: t }).fill(void 0), this.#t = Array.from({ length: t }).fill(void 0), this.#l = new v(t), this.#u = new v(t), this.#a = 0, this.#h = 0, this.#y = R.create(t), this.#n = 0, this.#b = 0, typeof o == "function" && (this.#S = o), typeof d == "function" && (this.#O = d), typeof y == "function" ? (this.#w = y, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#S, this.#x = !!this.#O, this.#f = !!this.#w, this.noDisposeOnSet = !!_, this.noUpdateTTL = !!c, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!p, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
1941
|
+
if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
1942
|
+
if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1943
|
+
this.#X();
|
|
1975
1944
|
}
|
|
1976
|
-
if (this.allowStale = !!
|
|
1977
|
-
if (!
|
|
1978
|
-
this.#
|
|
1945
|
+
if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!m, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!h, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
|
|
1946
|
+
if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
1947
|
+
this.#k();
|
|
1979
1948
|
}
|
|
1980
1949
|
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1981
1950
|
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
1982
|
-
let
|
|
1983
|
-
|
|
1951
|
+
let x = "LRU_CACHE_UNBOUNDED";
|
|
1952
|
+
H(x) && (U.add(x), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", x, u2));
|
|
1984
1953
|
}
|
|
1985
1954
|
}
|
|
1986
|
-
getRemainingTTL(
|
|
1987
|
-
return this.#s.has(
|
|
1955
|
+
getRemainingTTL(e) {
|
|
1956
|
+
return this.#s.has(e) ? 1 / 0 : 0;
|
|
1988
1957
|
}
|
|
1989
|
-
#
|
|
1990
|
-
let
|
|
1991
|
-
this.#d =
|
|
1992
|
-
let i = this.ttlAutopurge ?
|
|
1993
|
-
this.#g = i, this.#
|
|
1994
|
-
|
|
1995
|
-
}, this.#
|
|
1996
|
-
|
|
1958
|
+
#k() {
|
|
1959
|
+
let e = new O(this.#o), t = new O(this.#o);
|
|
1960
|
+
this.#d = e, this.#F = t;
|
|
1961
|
+
let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
1962
|
+
this.#g = i, this.#H = (h, a, o = this.#m.now()) => {
|
|
1963
|
+
t[h] = a !== 0 ? o : 0, e[h] = a, s(h, a);
|
|
1964
|
+
}, this.#D = (h) => {
|
|
1965
|
+
t[h] = e[h] !== 0 ? this.#m.now() : 0, s(h, e[h]);
|
|
1997
1966
|
};
|
|
1998
|
-
let s = this.ttlAutopurge ? (h,
|
|
1999
|
-
if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0),
|
|
2000
|
-
let
|
|
1967
|
+
let s = this.ttlAutopurge ? (h, a) => {
|
|
1968
|
+
if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), a && a !== 0 && i) {
|
|
1969
|
+
let o = setTimeout(() => {
|
|
2001
1970
|
this.#p(h) && this.#E(this.#i[h], "expire");
|
|
2002
|
-
},
|
|
2003
|
-
|
|
1971
|
+
}, a + 1);
|
|
1972
|
+
o.unref && o.unref(), i[h] = o;
|
|
2004
1973
|
}
|
|
2005
1974
|
} : () => {
|
|
2006
1975
|
};
|
|
2007
|
-
this.#
|
|
2008
|
-
if (
|
|
2009
|
-
let
|
|
2010
|
-
if (!
|
|
2011
|
-
h.ttl =
|
|
2012
|
-
let
|
|
2013
|
-
h.remainingTTL =
|
|
1976
|
+
this.#v = (h, a) => {
|
|
1977
|
+
if (e[a]) {
|
|
1978
|
+
let o = e[a], d = t[a];
|
|
1979
|
+
if (!o || !d) return;
|
|
1980
|
+
h.ttl = o, h.start = d, h.now = n || r();
|
|
1981
|
+
let y = h.now - d;
|
|
1982
|
+
h.remainingTTL = o - y;
|
|
2014
1983
|
}
|
|
2015
1984
|
};
|
|
2016
|
-
let n = 0,
|
|
1985
|
+
let n = 0, r = () => {
|
|
2017
1986
|
let h = this.#m.now();
|
|
2018
1987
|
if (this.ttlResolution > 0) {
|
|
2019
1988
|
n = h;
|
|
2020
|
-
let
|
|
2021
|
-
|
|
1989
|
+
let a = setTimeout(() => n = 0, this.ttlResolution);
|
|
1990
|
+
a.unref && a.unref();
|
|
2022
1991
|
}
|
|
2023
1992
|
return h;
|
|
2024
1993
|
};
|
|
2025
1994
|
this.getRemainingTTL = (h) => {
|
|
2026
|
-
let
|
|
2027
|
-
if (
|
|
2028
|
-
let
|
|
2029
|
-
if (!
|
|
2030
|
-
let
|
|
2031
|
-
return
|
|
1995
|
+
let a = this.#s.get(h);
|
|
1996
|
+
if (a === void 0) return 0;
|
|
1997
|
+
let o = e[a], d = t[a];
|
|
1998
|
+
if (!o || !d) return 1 / 0;
|
|
1999
|
+
let y = (n || r()) - d;
|
|
2000
|
+
return o - y;
|
|
2032
2001
|
}, this.#p = (h) => {
|
|
2033
|
-
let
|
|
2034
|
-
return !!
|
|
2002
|
+
let a = t[h], o = e[h];
|
|
2003
|
+
return !!o && !!a && (n || r()) - a > o;
|
|
2035
2004
|
};
|
|
2036
2005
|
}
|
|
2037
|
-
#
|
|
2006
|
+
#D = () => {
|
|
2038
2007
|
};
|
|
2039
|
-
#
|
|
2008
|
+
#v = () => {
|
|
2040
2009
|
};
|
|
2041
|
-
#
|
|
2010
|
+
#H = () => {
|
|
2042
2011
|
};
|
|
2043
2012
|
#p = () => false;
|
|
2044
|
-
#
|
|
2045
|
-
let
|
|
2046
|
-
this.#
|
|
2047
|
-
this.#
|
|
2048
|
-
}, this.#
|
|
2049
|
-
if (
|
|
2050
|
-
|
|
2051
|
-
if (
|
|
2052
|
-
|
|
2053
|
-
|
|
2013
|
+
#X() {
|
|
2014
|
+
let e = new O(this.#o);
|
|
2015
|
+
this.#b = 0, this.#_ = e, this.#R = (t) => {
|
|
2016
|
+
this.#b -= e[t], e[t] = 0;
|
|
2017
|
+
}, this.#N = (t, i, s, n) => {
|
|
2018
|
+
if (!T(s)) {
|
|
2019
|
+
if (this.#e(i)) return this.backgroundFetchSize;
|
|
2020
|
+
if (n) {
|
|
2021
|
+
if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
|
|
2022
|
+
if (s = n(i, t), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
2023
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
2024
|
+
}
|
|
2054
2025
|
return s;
|
|
2055
|
-
}, this.#
|
|
2056
|
-
if (t
|
|
2057
|
-
let n = this.#c - t
|
|
2058
|
-
for (; this.#
|
|
2026
|
+
}, this.#j = (t, i, s) => {
|
|
2027
|
+
if (e[t] = i, this.#c) {
|
|
2028
|
+
let n = this.#c - e[t];
|
|
2029
|
+
for (; this.#b > n; ) this.#G(true);
|
|
2059
2030
|
}
|
|
2060
|
-
this.#
|
|
2031
|
+
this.#b += e[t], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
|
|
2061
2032
|
};
|
|
2062
2033
|
}
|
|
2063
|
-
#
|
|
2034
|
+
#R = (e) => {
|
|
2064
2035
|
};
|
|
2065
|
-
#
|
|
2036
|
+
#j = (e, t, i) => {
|
|
2066
2037
|
};
|
|
2067
|
-
#
|
|
2038
|
+
#N = (e, t, i, s) => {
|
|
2068
2039
|
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
2069
2040
|
return 0;
|
|
2070
2041
|
};
|
|
2071
|
-
*#
|
|
2072
|
-
if (this.#n) for (let
|
|
2042
|
+
*#A({ allowStale: e = this.allowStale } = {}) {
|
|
2043
|
+
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#a); ) t = this.#u[t];
|
|
2073
2044
|
}
|
|
2074
|
-
*#
|
|
2075
|
-
if (this.#n) for (let
|
|
2045
|
+
*#z({ allowStale: e = this.allowStale } = {}) {
|
|
2046
|
+
if (this.#n) for (let t = this.#a; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#h); ) t = this.#l[t];
|
|
2076
2047
|
}
|
|
2077
|
-
#
|
|
2078
|
-
return
|
|
2048
|
+
#V(e) {
|
|
2049
|
+
return e !== void 0 && this.#s.get(this.#i[e]) === e;
|
|
2079
2050
|
}
|
|
2080
2051
|
*entries() {
|
|
2081
|
-
for (let
|
|
2052
|
+
for (let e of this.#A()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
|
|
2082
2053
|
}
|
|
2083
2054
|
*rentries() {
|
|
2084
|
-
for (let
|
|
2055
|
+
for (let e of this.#z()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
|
|
2085
2056
|
}
|
|
2086
2057
|
*keys() {
|
|
2087
|
-
for (let
|
|
2088
|
-
let
|
|
2089
|
-
|
|
2058
|
+
for (let e of this.#A()) {
|
|
2059
|
+
let t = this.#i[e];
|
|
2060
|
+
t !== void 0 && !this.#e(this.#t[e]) && (yield t);
|
|
2090
2061
|
}
|
|
2091
2062
|
}
|
|
2092
2063
|
*rkeys() {
|
|
2093
|
-
for (let
|
|
2094
|
-
let
|
|
2095
|
-
|
|
2064
|
+
for (let e of this.#z()) {
|
|
2065
|
+
let t = this.#i[e];
|
|
2066
|
+
t !== void 0 && !this.#e(this.#t[e]) && (yield t);
|
|
2096
2067
|
}
|
|
2097
2068
|
}
|
|
2098
2069
|
*values() {
|
|
2099
|
-
for (let
|
|
2070
|
+
for (let e of this.#A()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
|
|
2100
2071
|
}
|
|
2101
2072
|
*rvalues() {
|
|
2102
|
-
for (let
|
|
2073
|
+
for (let e of this.#z()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
|
|
2103
2074
|
}
|
|
2104
2075
|
[Symbol.iterator]() {
|
|
2105
2076
|
return this.entries();
|
|
2106
2077
|
}
|
|
2107
2078
|
[Symbol.toStringTag] = "LRUCache";
|
|
2108
|
-
find(
|
|
2109
|
-
for (let i of this.#
|
|
2079
|
+
find(e, t = {}) {
|
|
2080
|
+
for (let i of this.#A()) {
|
|
2110
2081
|
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
2111
|
-
if (n !== void 0 &&
|
|
2082
|
+
if (n !== void 0 && e(n, this.#i[i], this)) return this.#C(this.#i[i], t);
|
|
2112
2083
|
}
|
|
2113
2084
|
}
|
|
2114
|
-
forEach(
|
|
2115
|
-
for (let i of this.#
|
|
2085
|
+
forEach(e, t = this) {
|
|
2086
|
+
for (let i of this.#A()) {
|
|
2116
2087
|
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
2117
|
-
n !== void 0 &&
|
|
2088
|
+
n !== void 0 && e.call(t, n, this.#i[i], this);
|
|
2118
2089
|
}
|
|
2119
2090
|
}
|
|
2120
|
-
rforEach(
|
|
2121
|
-
for (let i of this.#
|
|
2091
|
+
rforEach(e, t = this) {
|
|
2092
|
+
for (let i of this.#z()) {
|
|
2122
2093
|
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
2123
|
-
n !== void 0 &&
|
|
2094
|
+
n !== void 0 && e.call(t, n, this.#i[i], this);
|
|
2124
2095
|
}
|
|
2125
2096
|
}
|
|
2126
2097
|
purgeStale() {
|
|
2127
|
-
let
|
|
2128
|
-
for (let
|
|
2129
|
-
return
|
|
2130
|
-
}
|
|
2131
|
-
info(
|
|
2132
|
-
let
|
|
2133
|
-
if (
|
|
2134
|
-
let i = this.#t[
|
|
2098
|
+
let e = false;
|
|
2099
|
+
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#E(this.#i[t], "expire"), e = true);
|
|
2100
|
+
return e;
|
|
2101
|
+
}
|
|
2102
|
+
info(e) {
|
|
2103
|
+
let t = this.#s.get(e);
|
|
2104
|
+
if (t === void 0) return;
|
|
2105
|
+
let i = this.#t[t], s = this.#e(i) ? i.__staleWhileFetching : i;
|
|
2135
2106
|
if (s === void 0) return;
|
|
2136
2107
|
let n = { value: s };
|
|
2137
|
-
if (this.#d && this.#
|
|
2138
|
-
let
|
|
2139
|
-
if (
|
|
2140
|
-
let
|
|
2141
|
-
n.ttl =
|
|
2108
|
+
if (this.#d && this.#F) {
|
|
2109
|
+
let r = this.#d[t], h = this.#F[t];
|
|
2110
|
+
if (r && h) {
|
|
2111
|
+
let a = r - (this.#m.now() - h);
|
|
2112
|
+
n.ttl = a, n.start = Date.now();
|
|
2142
2113
|
}
|
|
2143
2114
|
}
|
|
2144
|
-
return this.#
|
|
2115
|
+
return this.#_ && (n.size = this.#_[t]), n;
|
|
2145
2116
|
}
|
|
2146
2117
|
dump() {
|
|
2147
|
-
let
|
|
2148
|
-
for (let
|
|
2149
|
-
let i = this.#i[
|
|
2118
|
+
let e = [];
|
|
2119
|
+
for (let t of this.#A({ allowStale: true })) {
|
|
2120
|
+
let i = this.#i[t], s = this.#t[t], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
2150
2121
|
if (n === void 0 || i === void 0) continue;
|
|
2151
|
-
let
|
|
2152
|
-
if (this.#d && this.#
|
|
2153
|
-
|
|
2154
|
-
let h = this.#m.now() - this.#
|
|
2155
|
-
|
|
2122
|
+
let r = { value: n };
|
|
2123
|
+
if (this.#d && this.#F) {
|
|
2124
|
+
r.ttl = this.#d[t];
|
|
2125
|
+
let h = this.#m.now() - this.#F[t];
|
|
2126
|
+
r.start = Math.floor(Date.now() - h);
|
|
2156
2127
|
}
|
|
2157
|
-
this.#
|
|
2128
|
+
this.#_ && (r.size = this.#_[t]), e.unshift([i, r]);
|
|
2158
2129
|
}
|
|
2159
|
-
return
|
|
2130
|
+
return e;
|
|
2160
2131
|
}
|
|
2161
|
-
load(
|
|
2132
|
+
load(e) {
|
|
2162
2133
|
this.clear();
|
|
2163
|
-
for (let [
|
|
2134
|
+
for (let [t, i] of e) {
|
|
2164
2135
|
if (i.start) {
|
|
2165
2136
|
let s = Date.now() - i.start;
|
|
2166
2137
|
i.start = this.#m.now() - s;
|
|
2167
2138
|
}
|
|
2168
|
-
this
|
|
2169
|
-
}
|
|
2170
|
-
}
|
|
2171
|
-
set(
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2139
|
+
this.#W(t, i.value, i);
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
set(e, t, i = {}) {
|
|
2143
|
+
let { status: s = S.hasSubscribers ? {} : void 0 } = i;
|
|
2144
|
+
i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t), s.cache = this);
|
|
2145
|
+
let n = this.#W(e, t, i);
|
|
2146
|
+
return s && S.hasSubscribers && S.publish(s), n;
|
|
2147
|
+
}
|
|
2148
|
+
#W(e, t, i, s) {
|
|
2149
|
+
let { ttl: n = this.ttl, start: r, noDisposeOnSet: h = this.noDisposeOnSet, sizeCalculation: a = this.sizeCalculation, status: o } = i, d = this.#e(t);
|
|
2150
|
+
if (t === void 0) return o && (o.set = "deleted"), this.delete(e), this;
|
|
2151
|
+
let { noUpdateTTL: y = this.noUpdateTTL } = i;
|
|
2152
|
+
o && !d && (o.value = t);
|
|
2153
|
+
let _ = this.#N(e, t, i.size || 0, a, o);
|
|
2154
|
+
if (this.maxEntrySize && _ > this.maxEntrySize) return this.#E(e, "set"), o && (o.set = "miss", o.maxEntrySizeExceeded = true), this;
|
|
2155
|
+
let c = this.#n === 0 ? void 0 : this.#s.get(e);
|
|
2156
|
+
if (c === void 0) c = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(false) : this.#n, this.#i[c] = e, this.#t[c] = t, this.#s.set(e, c), this.#l[this.#h] = c, this.#u[c] = this.#h, this.#h = c, this.#n++, this.#j(c, _, o), o && (o.set = "add"), y = false, this.#x && !d && this.#O?.(t, e, "add");
|
|
2177
2157
|
else {
|
|
2178
|
-
this.#
|
|
2179
|
-
let
|
|
2180
|
-
if (
|
|
2181
|
-
if (
|
|
2182
|
-
|
|
2183
|
-
let { __staleWhileFetching:
|
|
2184
|
-
|
|
2185
|
-
} else
|
|
2186
|
-
if (this.#
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
g !== void 0 && (r.oldValue = g);
|
|
2158
|
+
this.#L(c);
|
|
2159
|
+
let g = this.#t[c];
|
|
2160
|
+
if (t !== g) {
|
|
2161
|
+
if (!h) if (this.#e(g)) {
|
|
2162
|
+
g !== s && g.__abortController.abort(new Error("replaced"));
|
|
2163
|
+
let { __staleWhileFetching: f } = g;
|
|
2164
|
+
f !== void 0 && f !== t && (this.#T && this.#S?.(f, e, "set"), this.#f && this.#r?.push([f, e, "set"]));
|
|
2165
|
+
} else this.#T && this.#S?.(g, e, "set"), this.#f && this.#r?.push([g, e, "set"]);
|
|
2166
|
+
if (this.#R(c), this.#j(c, _, o), this.#t[c] = t, !d) {
|
|
2167
|
+
let f = g && this.#e(g) ? g.__staleWhileFetching : g, b = f === void 0 ? "add" : t !== f ? "replace" : "update";
|
|
2168
|
+
o && (o.set = b, f !== void 0 && (o.oldValue = f)), this.#x && this.onInsert?.(t, e, b);
|
|
2190
2169
|
}
|
|
2191
|
-
} else
|
|
2192
|
-
this.#U && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
2170
|
+
} else d || (o && (o.set = "update"), this.#x && this.onInsert?.(t, e, "update"));
|
|
2193
2171
|
}
|
|
2194
|
-
if (
|
|
2195
|
-
let
|
|
2196
|
-
for (;
|
|
2172
|
+
if (n !== 0 && !this.#d && this.#k(), this.#d && (y || this.#H(c, n, r), o && this.#v(o, c)), !h && this.#f && this.#r) {
|
|
2173
|
+
let g = this.#r, f;
|
|
2174
|
+
for (; f = g?.shift(); ) this.#w?.(...f);
|
|
2197
2175
|
}
|
|
2198
2176
|
return this;
|
|
2199
2177
|
}
|
|
2200
2178
|
pop() {
|
|
2201
2179
|
try {
|
|
2202
2180
|
for (; this.#n; ) {
|
|
2203
|
-
let
|
|
2204
|
-
if (this.#
|
|
2205
|
-
if (
|
|
2206
|
-
} else if (
|
|
2181
|
+
let e = this.#t[this.#a];
|
|
2182
|
+
if (this.#G(true), this.#e(e)) {
|
|
2183
|
+
if (e.__staleWhileFetching) return e.__staleWhileFetching;
|
|
2184
|
+
} else if (e !== void 0) return e;
|
|
2207
2185
|
}
|
|
2208
2186
|
} finally {
|
|
2209
2187
|
if (this.#f && this.#r) {
|
|
2210
|
-
let
|
|
2211
|
-
for (;
|
|
2188
|
+
let e = this.#r, t;
|
|
2189
|
+
for (; t = e?.shift(); ) this.#w?.(...t);
|
|
2212
2190
|
}
|
|
2213
2191
|
}
|
|
2214
2192
|
}
|
|
2215
|
-
#
|
|
2216
|
-
let
|
|
2217
|
-
|
|
2193
|
+
#G(e) {
|
|
2194
|
+
let t = this.#a, i = this.#i[t], s = this.#t[t], n = this.#e(s);
|
|
2195
|
+
n && s.__abortController.abort(new Error("evicted"));
|
|
2196
|
+
let r = n ? s.__staleWhileFetching : s;
|
|
2197
|
+
return (this.#T || this.#f) && r !== void 0 && (this.#T && this.#S?.(r, i, "evict"), this.#f && this.#r?.push([r, i, "evict"])), this.#R(t), this.#g?.[t] && (clearTimeout(this.#g[t]), this.#g[t] = void 0), e && (this.#i[t] = void 0, this.#t[t] = void 0, this.#y.push(t)), this.#n === 1 ? (this.#a = this.#h = 0, this.#y.length = 0) : this.#a = this.#l[t], this.#s.delete(i), this.#n--, t;
|
|
2198
|
+
}
|
|
2199
|
+
has(e, t = {}) {
|
|
2200
|
+
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
2201
|
+
t.status = i, i && (i.op = "has", i.key = e, i.cache = this);
|
|
2202
|
+
let s = this.#Y(e, t);
|
|
2203
|
+
return S.hasSubscribers && S.publish(i), s;
|
|
2218
2204
|
}
|
|
2219
|
-
|
|
2220
|
-
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } =
|
|
2205
|
+
#Y(e, t = {}) {
|
|
2206
|
+
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = t, n = this.#s.get(e);
|
|
2221
2207
|
if (n !== void 0) {
|
|
2222
|
-
let
|
|
2223
|
-
if (this.#e(
|
|
2224
|
-
if (this.#p(n)) s && (s.has = "stale", this.#
|
|
2225
|
-
else return i && this.#
|
|
2208
|
+
let r = this.#t[n];
|
|
2209
|
+
if (this.#e(r) && r.__staleWhileFetching === void 0) return false;
|
|
2210
|
+
if (this.#p(n)) s && (s.has = "stale", this.#v(s, n));
|
|
2211
|
+
else return i && this.#D(n), s && (s.has = "hit", this.#v(s, n)), true;
|
|
2226
2212
|
} else s && (s.has = "miss");
|
|
2227
2213
|
return false;
|
|
2228
2214
|
}
|
|
2229
|
-
peek(
|
|
2230
|
-
let {
|
|
2231
|
-
|
|
2232
|
-
let
|
|
2233
|
-
return
|
|
2215
|
+
peek(e, t = {}) {
|
|
2216
|
+
let { status: i = D() ? {} : void 0 } = t;
|
|
2217
|
+
i && (i.op = "peek", i.key = e, i.cache = this), t.status = i;
|
|
2218
|
+
let s = this.#J(e, t);
|
|
2219
|
+
return S.hasSubscribers && S.publish(i), s;
|
|
2234
2220
|
}
|
|
2235
|
-
#
|
|
2236
|
-
let
|
|
2221
|
+
#J(e, t) {
|
|
2222
|
+
let { status: i, allowStale: s = this.allowStale } = t, n = this.#s.get(e);
|
|
2223
|
+
if (n === void 0 || !s && this.#p(n)) {
|
|
2224
|
+
i && (i.peek = n === void 0 ? "miss" : "stale");
|
|
2225
|
+
return;
|
|
2226
|
+
}
|
|
2227
|
+
let r = this.#t[n], h = this.#e(r) ? r.__staleWhileFetching : r;
|
|
2228
|
+
return i && (h !== void 0 ? (i.peek = "hit", i.value = h) : i.peek = "miss"), h;
|
|
2229
|
+
}
|
|
2230
|
+
#P(e, t, i, s) {
|
|
2231
|
+
let n = t === void 0 ? void 0 : this.#t[t];
|
|
2237
2232
|
if (this.#e(n)) return n;
|
|
2238
|
-
let
|
|
2239
|
-
h?.addEventListener("abort", () =>
|
|
2240
|
-
let
|
|
2241
|
-
let { aborted: l } =
|
|
2242
|
-
if (i.status && (l && !
|
|
2243
|
-
let m =
|
|
2244
|
-
return (
|
|
2245
|
-
},
|
|
2246
|
-
let { aborted: l } =
|
|
2247
|
-
if (this.#t[
|
|
2248
|
-
if (
|
|
2249
|
-
},
|
|
2250
|
-
let l = this.#
|
|
2251
|
-
|
|
2252
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (
|
|
2253
|
-
});
|
|
2233
|
+
let r = new AbortController(), { signal: h } = i;
|
|
2234
|
+
h?.addEventListener("abort", () => r.abort(h.reason), { signal: r.signal });
|
|
2235
|
+
let a = { signal: r.signal, options: i, context: s }, o = (f, b = false) => {
|
|
2236
|
+
let { aborted: l } = r.signal, w = i.ignoreFetchAbort && f !== void 0, F = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
|
|
2237
|
+
if (i.status && (l && !b ? (i.status.fetchAborted = true, i.status.fetchError = r.signal.reason, w && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !w && !b) return y(r.signal.reason, F);
|
|
2238
|
+
let m = c, p = this.#t[t];
|
|
2239
|
+
return (p === c || p === void 0 && w && b) && (f === void 0 ? m.__staleWhileFetching !== void 0 ? this.#t[t] = m.__staleWhileFetching : this.#E(e, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#W(e, f, a.options, m))), f;
|
|
2240
|
+
}, d = (f) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = f), y(f, false)), y = (f, b) => {
|
|
2241
|
+
let { aborted: l } = r.signal, w = l && i.allowStaleOnFetchAbort, F = w || i.allowStaleOnFetchRejection, m = F || i.noDeleteOnFetchRejection, p = c;
|
|
2242
|
+
if (this.#t[t] === c && (!m || !b && p.__staleWhileFetching === void 0 ? this.#E(e, "fetch") : w || (this.#t[t] = p.__staleWhileFetching)), F) return i.status && p.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), p.__staleWhileFetching;
|
|
2243
|
+
if (p.__returned === p) throw f;
|
|
2244
|
+
}, _ = (f, b) => {
|
|
2245
|
+
let l = this.#M?.(e, n, a);
|
|
2246
|
+
r.signal.addEventListener("abort", () => {
|
|
2247
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (w) => o(w, true)));
|
|
2248
|
+
}), l && l instanceof Promise ? l.then((w) => f(w === void 0 ? void 0 : w), b) : l !== void 0 && f(l);
|
|
2254
2249
|
};
|
|
2255
2250
|
i.status && (i.status.fetchDispatched = true);
|
|
2256
|
-
let
|
|
2257
|
-
return
|
|
2258
|
-
}
|
|
2259
|
-
#e(
|
|
2260
|
-
if (!this.#
|
|
2261
|
-
let
|
|
2262
|
-
return !!
|
|
2263
|
-
}
|
|
2264
|
-
|
|
2265
|
-
let
|
|
2266
|
-
|
|
2267
|
-
let
|
|
2251
|
+
let c = new Promise(_).then(o, d), g = Object.assign(c, { __abortController: r, __staleWhileFetching: n, __returned: void 0 });
|
|
2252
|
+
return t === void 0 ? (this.#W(e, g, { ...a.options, status: void 0 }), t = this.#s.get(e)) : this.#t[t] = g, g;
|
|
2253
|
+
}
|
|
2254
|
+
#e(e) {
|
|
2255
|
+
if (!this.#U) return false;
|
|
2256
|
+
let t = e;
|
|
2257
|
+
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
2258
|
+
}
|
|
2259
|
+
fetch(e, t = {}) {
|
|
2260
|
+
let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
|
|
2261
|
+
t.status = s, s && t.context && (s.context = t.context);
|
|
2262
|
+
let n = this.#B(e, t);
|
|
2263
|
+
return s && i && (s.trace = true, W.tracePromise(() => n, s).catch(() => {
|
|
2264
|
+
})), n;
|
|
2265
|
+
}
|
|
2266
|
+
async #B(e, t = {}) {
|
|
2267
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: o = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: y = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: _ = this.allowStaleOnFetchRejection, ignoreFetchAbort: c = this.ignoreFetchAbort, allowStaleOnFetchAbort: g = this.allowStaleOnFetchAbort, context: f, forceRefresh: b = false, status: l, signal: w } = t;
|
|
2268
|
+
if (l && (l.op = "fetch", l.key = e, b && (l.forceRefresh = true), l.cache = this), !this.#U) return l && (l.fetch = "get"), this.#C(e, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: l });
|
|
2269
|
+
let F = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: r, noDisposeOnSet: h, size: a, sizeCalculation: o, noUpdateTTL: d, noDeleteOnFetchRejection: y, allowStaleOnFetchRejection: _, allowStaleOnFetchAbort: g, ignoreFetchAbort: c, status: l, signal: w }, m = this.#s.get(e);
|
|
2268
2270
|
if (m === void 0) {
|
|
2269
2271
|
l && (l.fetch = "miss");
|
|
2270
|
-
let
|
|
2271
|
-
return
|
|
2272
|
+
let p = this.#P(e, m, F, f);
|
|
2273
|
+
return p.__returned = p;
|
|
2272
2274
|
} else {
|
|
2273
|
-
let
|
|
2274
|
-
if (this.#e(
|
|
2275
|
-
let
|
|
2276
|
-
return l && (l.fetch = "inflight",
|
|
2275
|
+
let p = this.#t[m];
|
|
2276
|
+
if (this.#e(p)) {
|
|
2277
|
+
let v = i && p.__staleWhileFetching !== void 0;
|
|
2278
|
+
return l && (l.fetch = "inflight", v && (l.returnedStale = true)), v ? p.__staleWhileFetching : p.__returned = p;
|
|
2277
2279
|
}
|
|
2278
|
-
let
|
|
2279
|
-
if (!
|
|
2280
|
-
let
|
|
2281
|
-
return l && (l.fetch =
|
|
2280
|
+
let A = this.#p(m);
|
|
2281
|
+
if (!b && !A) return l && (l.fetch = "hit"), this.#L(m), s && this.#D(m), l && this.#v(l, m), p;
|
|
2282
|
+
let z = this.#P(e, m, F, f), E = z.__staleWhileFetching !== void 0 && i;
|
|
2283
|
+
return l && (l.fetch = A ? "stale" : "refresh", E && A && (l.returnedStale = true)), E ? z.__staleWhileFetching : z.__returned = z;
|
|
2282
2284
|
}
|
|
2283
2285
|
}
|
|
2284
|
-
|
|
2285
|
-
let i =
|
|
2286
|
+
forceFetch(e, t = {}) {
|
|
2287
|
+
let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
|
|
2288
|
+
t.status = s, s && t.context && (s.context = t.context);
|
|
2289
|
+
let n = this.#K(e, t);
|
|
2290
|
+
return s && i && (s.trace = true, W.tracePromise(() => n, s).catch(() => {
|
|
2291
|
+
})), n;
|
|
2292
|
+
}
|
|
2293
|
+
async #K(e, t = {}) {
|
|
2294
|
+
let i = await this.#B(e, t);
|
|
2286
2295
|
if (i === void 0) throw new Error("fetch() returned undefined");
|
|
2287
2296
|
return i;
|
|
2288
2297
|
}
|
|
2289
|
-
memo(
|
|
2298
|
+
memo(e, t = {}) {
|
|
2299
|
+
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
2300
|
+
t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context), i.cache = this);
|
|
2301
|
+
let s = this.#Q(e, t);
|
|
2302
|
+
return i && (i.value = s), S.hasSubscribers && S.publish(i), s;
|
|
2303
|
+
}
|
|
2304
|
+
#Q(e, t = {}) {
|
|
2290
2305
|
let i = this.#I;
|
|
2291
2306
|
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
2292
|
-
let { context: s,
|
|
2293
|
-
|
|
2294
|
-
let
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2307
|
+
let { context: s, status: n, forceRefresh: r, ...h } = t;
|
|
2308
|
+
n && r && (n.forceRefresh = true);
|
|
2309
|
+
let a = this.#C(e, h), o = r || a === void 0;
|
|
2310
|
+
if (n && (n.memo = o ? "miss" : "hit", o || (n.value = a)), !o) return a;
|
|
2311
|
+
let d = i(e, a, { options: h, context: s });
|
|
2312
|
+
return n && (n.value = d), this.#W(e, d, h), d;
|
|
2313
|
+
}
|
|
2314
|
+
get(e, t = {}) {
|
|
2315
|
+
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
2316
|
+
t.status = i, i && (i.op = "get", i.key = e, i.cache = this);
|
|
2317
|
+
let s = this.#C(e, t);
|
|
2318
|
+
return i && (s !== void 0 && (i.value = s), S.hasSubscribers && S.publish(i)), s;
|
|
2319
|
+
}
|
|
2320
|
+
#C(e, t = {}) {
|
|
2321
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: r } = t, h = this.#s.get(e);
|
|
2322
|
+
if (h === void 0) {
|
|
2323
|
+
r && (r.get = "miss");
|
|
2324
|
+
return;
|
|
2325
|
+
}
|
|
2326
|
+
let a = this.#t[h], o = this.#e(a);
|
|
2327
|
+
return r && this.#v(r, h), this.#p(h) ? o ? (r && (r.get = "stale-fetching"), i && a.__staleWhileFetching !== void 0 ? (r && (r.returnedStale = true), a.__staleWhileFetching) : void 0) : (n || this.#E(e, "expire"), r && (r.get = "stale"), i ? (r && (r.returnedStale = true), a) : void 0) : (r && (r.get = o ? "fetching" : "hit"), this.#L(h), s && this.#D(h), o ? a.__staleWhileFetching : a);
|
|
2303
2328
|
}
|
|
2304
|
-
|
|
2305
|
-
this.#u[
|
|
2329
|
+
#$(e, t) {
|
|
2330
|
+
this.#u[t] = e, this.#l[e] = t;
|
|
2306
2331
|
}
|
|
2307
|
-
#
|
|
2308
|
-
|
|
2332
|
+
#L(e) {
|
|
2333
|
+
e !== this.#h && (e === this.#a ? this.#a = this.#l[e] : this.#$(this.#u[e], this.#l[e]), this.#$(this.#h, e), this.#h = e);
|
|
2309
2334
|
}
|
|
2310
|
-
delete(
|
|
2311
|
-
return this.#E(
|
|
2335
|
+
delete(e) {
|
|
2336
|
+
return this.#E(e, "delete");
|
|
2312
2337
|
}
|
|
2313
|
-
#E(
|
|
2338
|
+
#E(e, t) {
|
|
2339
|
+
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e, cache: this });
|
|
2314
2340
|
let i = false;
|
|
2315
2341
|
if (this.#n !== 0) {
|
|
2316
|
-
let s = this.#s.get(
|
|
2317
|
-
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#
|
|
2342
|
+
let s = this.#s.get(e);
|
|
2343
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#q(t);
|
|
2318
2344
|
else {
|
|
2319
|
-
this.#
|
|
2345
|
+
this.#R(s);
|
|
2320
2346
|
let n = this.#t[s];
|
|
2321
|
-
if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#
|
|
2322
|
-
else if (s === this.#
|
|
2347
|
+
if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#S?.(n, e, t), this.#f && this.#r?.push([n, e, t])), this.#s.delete(e), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
|
|
2348
|
+
else if (s === this.#a) this.#a = this.#l[s];
|
|
2323
2349
|
else {
|
|
2324
|
-
let
|
|
2325
|
-
this.#
|
|
2326
|
-
let h = this.#
|
|
2350
|
+
let r = this.#u[s];
|
|
2351
|
+
this.#l[r] = this.#l[s];
|
|
2352
|
+
let h = this.#l[s];
|
|
2327
2353
|
this.#u[h] = this.#u[s];
|
|
2328
2354
|
}
|
|
2329
|
-
this.#n--, this.#
|
|
2355
|
+
this.#n--, this.#y.push(s);
|
|
2330
2356
|
}
|
|
2331
2357
|
}
|
|
2332
2358
|
if (this.#f && this.#r?.length) {
|
|
2333
2359
|
let s = this.#r, n;
|
|
2334
|
-
for (; n = s?.shift(); ) this.#
|
|
2360
|
+
for (; n = s?.shift(); ) this.#w?.(...n);
|
|
2335
2361
|
}
|
|
2336
2362
|
return i;
|
|
2337
2363
|
}
|
|
2338
2364
|
clear() {
|
|
2339
|
-
return this.#
|
|
2365
|
+
return this.#q("delete");
|
|
2340
2366
|
}
|
|
2341
|
-
#
|
|
2342
|
-
for (let
|
|
2343
|
-
let i = this.#t[
|
|
2367
|
+
#q(e) {
|
|
2368
|
+
for (let t of this.#z({ allowStale: true })) {
|
|
2369
|
+
let i = this.#t[t];
|
|
2344
2370
|
if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
|
|
2345
2371
|
else {
|
|
2346
|
-
let s = this.#i[
|
|
2347
|
-
this.#T && this.#
|
|
2372
|
+
let s = this.#i[t];
|
|
2373
|
+
this.#T && this.#S?.(i, s, e), this.#f && this.#r?.push([i, s, e]);
|
|
2348
2374
|
}
|
|
2349
2375
|
}
|
|
2350
|
-
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#
|
|
2351
|
-
this.#d.fill(0), this.#
|
|
2352
|
-
for (let
|
|
2376
|
+
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
2377
|
+
this.#d.fill(0), this.#F.fill(0);
|
|
2378
|
+
for (let t of this.#g ?? []) t !== void 0 && clearTimeout(t);
|
|
2353
2379
|
this.#g?.fill(void 0);
|
|
2354
2380
|
}
|
|
2355
|
-
if (this.#
|
|
2356
|
-
let
|
|
2357
|
-
for (; i =
|
|
2381
|
+
if (this.#_ && this.#_.fill(0), this.#a = 0, this.#h = 0, this.#y.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
2382
|
+
let t = this.#r, i;
|
|
2383
|
+
for (; i = t?.shift(); ) this.#w?.(...i);
|
|
2358
2384
|
}
|
|
2359
2385
|
}
|
|
2360
2386
|
};
|
|
@@ -2697,16 +2723,16 @@ var Minipass = class extends EventEmitter {
|
|
|
2697
2723
|
if (this[OBJECTMODE])
|
|
2698
2724
|
this[BUFFERSHIFT]();
|
|
2699
2725
|
else {
|
|
2700
|
-
const
|
|
2701
|
-
if (n ===
|
|
2726
|
+
const c = chunk;
|
|
2727
|
+
if (n === c.length || n === null)
|
|
2702
2728
|
this[BUFFERSHIFT]();
|
|
2703
|
-
else if (typeof
|
|
2704
|
-
this[BUFFER][0] =
|
|
2705
|
-
chunk =
|
|
2729
|
+
else if (typeof c === "string") {
|
|
2730
|
+
this[BUFFER][0] = c.slice(n);
|
|
2731
|
+
chunk = c.slice(0, n);
|
|
2706
2732
|
this[BUFFERLENGTH] -= n;
|
|
2707
2733
|
} else {
|
|
2708
|
-
this[BUFFER][0] =
|
|
2709
|
-
chunk =
|
|
2734
|
+
this[BUFFER][0] = c.subarray(n);
|
|
2735
|
+
chunk = c.subarray(0, n);
|
|
2710
2736
|
this[BUFFERLENGTH] -= n;
|
|
2711
2737
|
}
|
|
2712
2738
|
}
|
|
@@ -3070,10 +3096,10 @@ var Minipass = class extends EventEmitter {
|
|
|
3070
3096
|
if (!this[OBJECTMODE])
|
|
3071
3097
|
buf.dataLength = 0;
|
|
3072
3098
|
const p = this.promise();
|
|
3073
|
-
this.on("data", (
|
|
3074
|
-
buf.push(
|
|
3099
|
+
this.on("data", (c) => {
|
|
3100
|
+
buf.push(c);
|
|
3075
3101
|
if (!this[OBJECTMODE])
|
|
3076
|
-
buf.dataLength +=
|
|
3102
|
+
buf.dataLength += c.length;
|
|
3077
3103
|
});
|
|
3078
3104
|
await p;
|
|
3079
3105
|
return buf;
|
|
@@ -3293,30 +3319,30 @@ var ENOREALPATH = 512;
|
|
|
3293
3319
|
var ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
|
|
3294
3320
|
var TYPEMASK = 1023;
|
|
3295
3321
|
var entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN;
|
|
3296
|
-
var normalizeCache = new
|
|
3322
|
+
var normalizeCache = new I({ max: 2 ** 12 });
|
|
3297
3323
|
var normalize = (s) => {
|
|
3298
|
-
const
|
|
3299
|
-
if (
|
|
3300
|
-
return
|
|
3324
|
+
const c = normalizeCache.get(s);
|
|
3325
|
+
if (c)
|
|
3326
|
+
return c;
|
|
3301
3327
|
const n = s.normalize("NFKD");
|
|
3302
3328
|
normalizeCache.set(s, n);
|
|
3303
3329
|
return n;
|
|
3304
3330
|
};
|
|
3305
|
-
var normalizeNocaseCache = new
|
|
3331
|
+
var normalizeNocaseCache = new I({ max: 2 ** 12 });
|
|
3306
3332
|
var normalizeNocase = (s) => {
|
|
3307
|
-
const
|
|
3308
|
-
if (
|
|
3309
|
-
return
|
|
3333
|
+
const c = normalizeNocaseCache.get(s);
|
|
3334
|
+
if (c)
|
|
3335
|
+
return c;
|
|
3310
3336
|
const n = normalize(s.toLowerCase());
|
|
3311
3337
|
normalizeNocaseCache.set(s, n);
|
|
3312
3338
|
return n;
|
|
3313
3339
|
};
|
|
3314
|
-
var ResolveCache = class extends
|
|
3340
|
+
var ResolveCache = class extends I {
|
|
3315
3341
|
constructor() {
|
|
3316
3342
|
super({ max: 256 });
|
|
3317
3343
|
}
|
|
3318
3344
|
};
|
|
3319
|
-
var ChildrenCache = class extends
|
|
3345
|
+
var ChildrenCache = class extends I {
|
|
3320
3346
|
constructor(maxSize = 16 * 1024) {
|
|
3321
3347
|
super({
|
|
3322
3348
|
maxSize,
|
|
@@ -3876,9 +3902,9 @@ var PathBase = class {
|
|
|
3876
3902
|
#readdirSuccess(children) {
|
|
3877
3903
|
this.#type |= READDIR_CALLED;
|
|
3878
3904
|
for (let p = children.provisional; p < children.length; p++) {
|
|
3879
|
-
const
|
|
3880
|
-
if (
|
|
3881
|
-
|
|
3905
|
+
const c = children[p];
|
|
3906
|
+
if (c)
|
|
3907
|
+
c.#markENOENT();
|
|
3882
3908
|
}
|
|
3883
3909
|
}
|
|
3884
3910
|
#markENOENT() {
|
|
@@ -3938,43 +3964,43 @@ var PathBase = class {
|
|
|
3938
3964
|
this.parent.#markENOTDIR();
|
|
3939
3965
|
}
|
|
3940
3966
|
}
|
|
3941
|
-
#readdirAddChild(e,
|
|
3942
|
-
return this.#readdirMaybePromoteChild(e,
|
|
3967
|
+
#readdirAddChild(e, c) {
|
|
3968
|
+
return this.#readdirMaybePromoteChild(e, c) || this.#readdirAddNewChild(e, c);
|
|
3943
3969
|
}
|
|
3944
|
-
#readdirAddNewChild(e,
|
|
3970
|
+
#readdirAddNewChild(e, c) {
|
|
3945
3971
|
const type = entToType(e);
|
|
3946
3972
|
const child = this.newChild(e.name, type, { parent: this });
|
|
3947
3973
|
const ifmt = child.#type & IFMT;
|
|
3948
3974
|
if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
|
|
3949
3975
|
child.#type |= ENOTDIR;
|
|
3950
3976
|
}
|
|
3951
|
-
|
|
3952
|
-
|
|
3977
|
+
c.unshift(child);
|
|
3978
|
+
c.provisional++;
|
|
3953
3979
|
return child;
|
|
3954
3980
|
}
|
|
3955
|
-
#readdirMaybePromoteChild(e,
|
|
3956
|
-
for (let p =
|
|
3957
|
-
const pchild =
|
|
3981
|
+
#readdirMaybePromoteChild(e, c) {
|
|
3982
|
+
for (let p = c.provisional; p < c.length; p++) {
|
|
3983
|
+
const pchild = c[p];
|
|
3958
3984
|
const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
|
|
3959
3985
|
if (name !== pchild.#matchName) {
|
|
3960
3986
|
continue;
|
|
3961
3987
|
}
|
|
3962
|
-
return this.#readdirPromoteChild(e, pchild, p,
|
|
3988
|
+
return this.#readdirPromoteChild(e, pchild, p, c);
|
|
3963
3989
|
}
|
|
3964
3990
|
}
|
|
3965
|
-
#readdirPromoteChild(e, p, index,
|
|
3991
|
+
#readdirPromoteChild(e, p, index, c) {
|
|
3966
3992
|
const v = p.name;
|
|
3967
3993
|
p.#type = p.#type & IFMT_UNKNOWN | entToType(e);
|
|
3968
3994
|
if (v !== e.name)
|
|
3969
3995
|
p.name = e.name;
|
|
3970
|
-
if (index !==
|
|
3971
|
-
if (index ===
|
|
3972
|
-
|
|
3996
|
+
if (index !== c.provisional) {
|
|
3997
|
+
if (index === c.length - 1)
|
|
3998
|
+
c.pop();
|
|
3973
3999
|
else
|
|
3974
|
-
|
|
3975
|
-
|
|
4000
|
+
c.splice(index, 1);
|
|
4001
|
+
c.unshift(p);
|
|
3976
4002
|
}
|
|
3977
|
-
|
|
4003
|
+
c.provisional++;
|
|
3978
4004
|
return p;
|
|
3979
4005
|
}
|
|
3980
4006
|
/**
|
|
@@ -4075,11 +4101,11 @@ var PathBase = class {
|
|
|
4075
4101
|
}
|
|
4076
4102
|
const children = this.children();
|
|
4077
4103
|
if (this.calledReaddir()) {
|
|
4078
|
-
const
|
|
4104
|
+
const c = children.slice(0, children.provisional);
|
|
4079
4105
|
if (allowZalgo)
|
|
4080
|
-
cb(null,
|
|
4106
|
+
cb(null, c);
|
|
4081
4107
|
else
|
|
4082
|
-
queueMicrotask(() => cb(null,
|
|
4108
|
+
queueMicrotask(() => cb(null, c));
|
|
4083
4109
|
return;
|
|
4084
4110
|
}
|
|
4085
4111
|
this.#onReaddirCB.push(cb);
|
|
@@ -5287,7 +5313,7 @@ var SubWalks = class {
|
|
|
5287
5313
|
return subs;
|
|
5288
5314
|
}
|
|
5289
5315
|
entries() {
|
|
5290
|
-
return this.keys().map((
|
|
5316
|
+
return this.keys().map((k2) => [k2, this.store.get(k2)]);
|
|
5291
5317
|
}
|
|
5292
5318
|
keys() {
|
|
5293
5319
|
return [...this.store.keys()].filter((t) => t.canReaddir());
|
|
@@ -5330,8 +5356,8 @@ var Processor = class _Processor {
|
|
|
5330
5356
|
let rest;
|
|
5331
5357
|
let changed = false;
|
|
5332
5358
|
while (typeof (p = pattern.pattern()) === "string" && (rest = pattern.rest())) {
|
|
5333
|
-
const
|
|
5334
|
-
t =
|
|
5359
|
+
const c = t.resolve(p);
|
|
5360
|
+
t = c;
|
|
5335
5361
|
pattern = rest;
|
|
5336
5362
|
changed = true;
|
|
5337
5363
|
}
|