semantic-release-lerna 3.0.0 → 3.1.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/dist/index.js +1371 -232
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1367,6 +1367,47 @@ var require_coerce = __commonJS({
|
|
|
1367
1367
|
}
|
|
1368
1368
|
});
|
|
1369
1369
|
|
|
1370
|
+
// node_modules/semver/functions/truncate.js
|
|
1371
|
+
var require_truncate = __commonJS({
|
|
1372
|
+
"node_modules/semver/functions/truncate.js"(exports, module) {
|
|
1373
|
+
"use strict";
|
|
1374
|
+
var parse2 = require_parse2();
|
|
1375
|
+
var constants6 = require_constants();
|
|
1376
|
+
var SemVer = require_semver();
|
|
1377
|
+
var truncate = (version, truncation, options) => {
|
|
1378
|
+
if (!constants6.RELEASE_TYPES.includes(truncation)) {
|
|
1379
|
+
return null;
|
|
1380
|
+
}
|
|
1381
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
1382
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
1383
|
+
};
|
|
1384
|
+
var cloneInputVersion = (version, options) => {
|
|
1385
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
1386
|
+
return parse2(versionStringToParse, options);
|
|
1387
|
+
};
|
|
1388
|
+
var doTruncation = (version, truncation) => {
|
|
1389
|
+
if (isPrerelease(truncation)) {
|
|
1390
|
+
return version.version;
|
|
1391
|
+
}
|
|
1392
|
+
version.prerelease = [];
|
|
1393
|
+
switch (truncation) {
|
|
1394
|
+
case "major":
|
|
1395
|
+
version.minor = 0;
|
|
1396
|
+
version.patch = 0;
|
|
1397
|
+
break;
|
|
1398
|
+
case "minor":
|
|
1399
|
+
version.patch = 0;
|
|
1400
|
+
break;
|
|
1401
|
+
}
|
|
1402
|
+
return version.format();
|
|
1403
|
+
};
|
|
1404
|
+
var isPrerelease = (type2) => {
|
|
1405
|
+
return type2.startsWith("pre");
|
|
1406
|
+
};
|
|
1407
|
+
module.exports = truncate;
|
|
1408
|
+
}
|
|
1409
|
+
});
|
|
1410
|
+
|
|
1370
1411
|
// node_modules/semver/internal/lrucache.js
|
|
1371
1412
|
var require_lrucache = __commonJS({
|
|
1372
1413
|
"node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
@@ -2401,6 +2442,7 @@ var require_semver2 = __commonJS({
|
|
|
2401
2442
|
var lte2 = require_lte();
|
|
2402
2443
|
var cmp = require_cmp();
|
|
2403
2444
|
var coerce = require_coerce();
|
|
2445
|
+
var truncate = require_truncate();
|
|
2404
2446
|
var Comparator = require_comparator();
|
|
2405
2447
|
var Range = require_range();
|
|
2406
2448
|
var satisfies2 = require_satisfies();
|
|
@@ -2439,6 +2481,7 @@ var require_semver2 = __commonJS({
|
|
|
2439
2481
|
lte: lte2,
|
|
2440
2482
|
cmp,
|
|
2441
2483
|
coerce,
|
|
2484
|
+
truncate,
|
|
2442
2485
|
Comparator,
|
|
2443
2486
|
Range,
|
|
2444
2487
|
satisfies: satisfies2,
|
|
@@ -2465,43 +2508,49 @@ var require_semver2 = __commonJS({
|
|
|
2465
2508
|
}
|
|
2466
2509
|
});
|
|
2467
2510
|
|
|
2468
|
-
// node_modules/
|
|
2511
|
+
// node_modules/npm-package-arg/node_modules/lru-cache/dist/commonjs/node/index.min.js
|
|
2469
2512
|
var require_index_min = __commonJS({
|
|
2470
|
-
"node_modules/
|
|
2513
|
+
"node_modules/npm-package-arg/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
|
|
2471
2514
|
"use strict";
|
|
2472
|
-
var
|
|
2473
|
-
var
|
|
2515
|
+
var M = (c3, t) => () => (t || c3((t = { exports: {} }).exports, t), t.exports);
|
|
2516
|
+
var U = M((O) => {
|
|
2474
2517
|
"use strict";
|
|
2475
2518
|
Object.defineProperty(O, "__esModule", { value: true });
|
|
2476
2519
|
O.tracing = O.metrics = void 0;
|
|
2477
|
-
var
|
|
2478
|
-
O.metrics = (0,
|
|
2479
|
-
O.tracing = (0,
|
|
2520
|
+
var j = __require("node:diagnostics_channel");
|
|
2521
|
+
O.metrics = (0, j.channel)("lru-cache:metrics");
|
|
2522
|
+
O.tracing = (0, j.tracingChannel)("lru-cache");
|
|
2523
|
+
});
|
|
2524
|
+
var I = M((R) => {
|
|
2525
|
+
"use strict";
|
|
2526
|
+
Object.defineProperty(R, "__esModule", { value: true });
|
|
2527
|
+
R.defaultPerf = void 0;
|
|
2528
|
+
R.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
2480
2529
|
});
|
|
2481
2530
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2482
2531
|
exports.LRUCache = void 0;
|
|
2483
|
-
var u2 =
|
|
2484
|
-
var
|
|
2485
|
-
var
|
|
2486
|
-
var
|
|
2487
|
-
var
|
|
2488
|
-
var
|
|
2489
|
-
typeof
|
|
2490
|
-
};
|
|
2491
|
-
var
|
|
2532
|
+
var u2 = U();
|
|
2533
|
+
var N = I();
|
|
2534
|
+
var C = () => u2.metrics.hasSubscribers || u2.tracing.hasSubscribers;
|
|
2535
|
+
var G = /* @__PURE__ */ new Set();
|
|
2536
|
+
var P = typeof process == "object" && process ? process : {};
|
|
2537
|
+
var k = (c3, t, e, i2) => {
|
|
2538
|
+
typeof P.emitWarning == "function" ? P.emitWarning(c3, t, e, i2) : console.error(`[${e}] ${t}: ${c3}`);
|
|
2539
|
+
};
|
|
2540
|
+
var q = (c3) => !G.has(c3);
|
|
2492
2541
|
var F = (c3) => !!c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
|
|
2493
|
-
var
|
|
2542
|
+
var H = (c3) => F(c3) ? c3 <= Math.pow(2, 8) ? Uint8Array : c3 <= Math.pow(2, 16) ? Uint16Array : c3 <= Math.pow(2, 32) ? Uint32Array : c3 <= Number.MAX_SAFE_INTEGER ? W : null : null;
|
|
2494
2543
|
var W = class extends Array {
|
|
2495
2544
|
constructor(t) {
|
|
2496
2545
|
super(t), this.fill(0);
|
|
2497
2546
|
}
|
|
2498
2547
|
};
|
|
2499
|
-
var
|
|
2548
|
+
var x = class c3 {
|
|
2500
2549
|
heap;
|
|
2501
2550
|
length;
|
|
2502
2551
|
static #o = false;
|
|
2503
2552
|
static create(t) {
|
|
2504
|
-
let e =
|
|
2553
|
+
let e = H(t);
|
|
2505
2554
|
if (!e) return [];
|
|
2506
2555
|
c3.#o = true;
|
|
2507
2556
|
let i2 = new c3(t, e);
|
|
@@ -2518,7 +2567,7 @@ var require_index_min = __commonJS({
|
|
|
2518
2567
|
return this.heap[--this.length];
|
|
2519
2568
|
}
|
|
2520
2569
|
};
|
|
2521
|
-
var
|
|
2570
|
+
var L = class c3 {
|
|
2522
2571
|
#o;
|
|
2523
2572
|
#c;
|
|
2524
2573
|
#m;
|
|
@@ -2554,9 +2603,9 @@ var require_index_min = __commonJS({
|
|
|
2554
2603
|
#u;
|
|
2555
2604
|
#a;
|
|
2556
2605
|
#h;
|
|
2557
|
-
#y;
|
|
2558
|
-
#r;
|
|
2559
2606
|
#_;
|
|
2607
|
+
#r;
|
|
2608
|
+
#y;
|
|
2560
2609
|
#F;
|
|
2561
2610
|
#d;
|
|
2562
2611
|
#g;
|
|
@@ -2565,11 +2614,11 @@ var require_index_min = __commonJS({
|
|
|
2565
2614
|
#f;
|
|
2566
2615
|
#U;
|
|
2567
2616
|
static unsafeExposeInternals(t) {
|
|
2568
|
-
return { starts: t.#F, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#
|
|
2617
|
+
return { starts: t.#F, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#y, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#l, prev: t.#u, get head() {
|
|
2569
2618
|
return t.#a;
|
|
2570
2619
|
}, get tail() {
|
|
2571
2620
|
return t.#h;
|
|
2572
|
-
}, free: t.#
|
|
2621
|
+
}, free: t.#_, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i2, s, n2) => t.#G(e, i2, s, n2), moveToTail: (e) => t.#L(e), indexes: (e) => t.#A(e), rindexes: (e) => t.#v(e), isStale: (e) => t.#p(e) };
|
|
2573
2622
|
}
|
|
2574
2623
|
get max() {
|
|
2575
2624
|
return this.#o;
|
|
@@ -2599,18 +2648,18 @@ var require_index_min = __commonJS({
|
|
|
2599
2648
|
return this.#w;
|
|
2600
2649
|
}
|
|
2601
2650
|
constructor(t) {
|
|
2602
|
-
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n2, updateAgeOnGet: o2, updateAgeOnHas: r, allowStale: h2, dispose: a2, onInsert: d, disposeAfter: f, noDisposeOnSet: p, noUpdateTTL: m, maxSize: T = 0, maxEntrySize: w = 0, sizeCalculation:
|
|
2603
|
-
if (
|
|
2604
|
-
if (this.#S =
|
|
2605
|
-
let z = e ?
|
|
2651
|
+
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n2, updateAgeOnGet: o2, updateAgeOnHas: r, allowStale: h2, dispose: a2, onInsert: d, disposeAfter: f, noDisposeOnSet: p, noUpdateTTL: m, maxSize: T = 0, maxEntrySize: w = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: y, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: g, allowStaleOnFetchAbort: A, ignoreFetchAbort: v, perf: D } = t;
|
|
2652
|
+
if (D !== void 0 && typeof D?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
2653
|
+
if (this.#S = D ?? N.defaultPerf, e !== 0 && !F(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
2654
|
+
let z = e ? H(e) : Array;
|
|
2606
2655
|
if (!z) throw new Error("invalid max value: " + e);
|
|
2607
|
-
if (this.#o = e, this.#c = T, this.maxEntrySize = w || this.#c, this.sizeCalculation =
|
|
2656
|
+
if (this.#o = e, this.#c = T, this.maxEntrySize = w || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
|
|
2608
2657
|
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
2609
2658
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
2610
2659
|
}
|
|
2611
2660
|
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
2612
2661
|
if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
2613
|
-
if (this.#M = l, this.#O = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: e }).fill(void 0), this.#t = Array.from({ length: e }).fill(void 0), this.#l = new z(e), this.#u = new z(e), this.#a = 0, this.#h = 0, this.#
|
|
2662
|
+
if (this.#M = l, this.#O = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: e }).fill(void 0), this.#t = Array.from({ length: e }).fill(void 0), this.#l = new z(e), this.#u = new z(e), this.#a = 0, this.#h = 0, this.#_ = x.create(e), this.#n = 0, this.#b = 0, typeof a2 == "function" && (this.#m = a2), typeof d == "function" && (this.#D = d), typeof f == "function" ? (this.#w = f, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#m, this.#U = !!this.#D, this.#f = !!this.#w, this.noDisposeOnSet = !!p, this.noUpdateTTL = !!m, this.noDeleteOnFetchRejection = !!y, this.allowStaleOnFetchRejection = !!g, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!v, this.maxEntrySize !== 0) {
|
|
2614
2663
|
if (this.#c !== 0 && !F(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
2615
2664
|
if (!F(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
2616
2665
|
this.#X();
|
|
@@ -2622,7 +2671,7 @@ var require_index_min = __commonJS({
|
|
|
2622
2671
|
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
2623
2672
|
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
2624
2673
|
let E = "LRU_CACHE_UNBOUNDED";
|
|
2625
|
-
|
|
2674
|
+
q(E) && (G.add(E), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c3));
|
|
2626
2675
|
}
|
|
2627
2676
|
}
|
|
2628
2677
|
getRemainingTTL(t) {
|
|
@@ -2685,7 +2734,7 @@ var require_index_min = __commonJS({
|
|
|
2685
2734
|
#p = () => false;
|
|
2686
2735
|
#X() {
|
|
2687
2736
|
let t = new W(this.#o);
|
|
2688
|
-
this.#b = 0, this.#
|
|
2737
|
+
this.#b = 0, this.#y = t, this.#C = (e) => {
|
|
2689
2738
|
this.#b -= t[e], t[e] = 0;
|
|
2690
2739
|
}, this.#k = (e, i2, s, n2) => {
|
|
2691
2740
|
if (this.#e(i2)) return 0;
|
|
@@ -2697,7 +2746,7 @@ var require_index_min = __commonJS({
|
|
|
2697
2746
|
}, this.#I = (e, i2, s) => {
|
|
2698
2747
|
if (t[e] = i2, this.#c) {
|
|
2699
2748
|
let n2 = this.#c - t[e];
|
|
2700
|
-
for (; this.#b > n2; ) this.#
|
|
2749
|
+
for (; this.#b > n2; ) this.#P(true);
|
|
2701
2750
|
}
|
|
2702
2751
|
this.#b += t[e], s && (s.entrySize = i2, s.totalCalculatedSize = this.#b);
|
|
2703
2752
|
};
|
|
@@ -2711,12 +2760,12 @@ var require_index_min = __commonJS({
|
|
|
2711
2760
|
return 0;
|
|
2712
2761
|
};
|
|
2713
2762
|
*#A({ allowStale: t = this.allowStale } = {}) {
|
|
2714
|
-
if (this.#n) for (let e = this.#h; this.#
|
|
2763
|
+
if (this.#n) for (let e = this.#h; this.#q(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a); ) e = this.#u[e];
|
|
2715
2764
|
}
|
|
2716
2765
|
*#v({ allowStale: t = this.allowStale } = {}) {
|
|
2717
|
-
if (this.#n) for (let e = this.#a; this.#
|
|
2766
|
+
if (this.#n) for (let e = this.#a; this.#q(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h); ) e = this.#l[e];
|
|
2718
2767
|
}
|
|
2719
|
-
#
|
|
2768
|
+
#q(t) {
|
|
2720
2769
|
return t !== void 0 && this.#s.get(this.#i[t]) === t;
|
|
2721
2770
|
}
|
|
2722
2771
|
*entries() {
|
|
@@ -2783,7 +2832,7 @@ var require_index_min = __commonJS({
|
|
|
2783
2832
|
n2.ttl = h2, n2.start = Date.now();
|
|
2784
2833
|
}
|
|
2785
2834
|
}
|
|
2786
|
-
return this.#
|
|
2835
|
+
return this.#y && (n2.size = this.#y[e]), n2;
|
|
2787
2836
|
}
|
|
2788
2837
|
dump() {
|
|
2789
2838
|
let t = [];
|
|
@@ -2796,7 +2845,7 @@ var require_index_min = __commonJS({
|
|
|
2796
2845
|
let r = this.#S.now() - this.#F[e];
|
|
2797
2846
|
o2.start = Math.floor(Date.now() - r);
|
|
2798
2847
|
}
|
|
2799
|
-
this.#
|
|
2848
|
+
this.#y && (o2.size = this.#y[e]), t.unshift([i2, o2]);
|
|
2800
2849
|
}
|
|
2801
2850
|
return t;
|
|
2802
2851
|
}
|
|
@@ -2824,7 +2873,7 @@ var require_index_min = __commonJS({
|
|
|
2824
2873
|
let d = this.#k(t, e, i2.size || 0, r, h2);
|
|
2825
2874
|
if (this.maxEntrySize && d > this.maxEntrySize) return this.#z(t, "set"), h2 && (h2.set = "miss", h2.maxEntrySizeExceeded = true), this;
|
|
2826
2875
|
let f = this.#n === 0 ? void 0 : this.#s.get(t);
|
|
2827
|
-
if (f === void 0) f = this.#n === 0 ? this.#h : this.#
|
|
2876
|
+
if (f === void 0) f = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(false) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#l[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#I(f, d, h2), h2 && (h2.set = "add"), a2 = false, this.#U && this.#D?.(e, t, "add");
|
|
2828
2877
|
else {
|
|
2829
2878
|
this.#L(f);
|
|
2830
2879
|
let p = this.#t[f];
|
|
@@ -2852,7 +2901,7 @@ var require_index_min = __commonJS({
|
|
|
2852
2901
|
try {
|
|
2853
2902
|
for (; this.#n; ) {
|
|
2854
2903
|
let t = this.#t[this.#a];
|
|
2855
|
-
if (this.#
|
|
2904
|
+
if (this.#P(true), this.#e(t)) {
|
|
2856
2905
|
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
2857
2906
|
} else if (t !== void 0) return t;
|
|
2858
2907
|
}
|
|
@@ -2863,9 +2912,9 @@ var require_index_min = __commonJS({
|
|
|
2863
2912
|
}
|
|
2864
2913
|
}
|
|
2865
2914
|
}
|
|
2866
|
-
#
|
|
2915
|
+
#P(t) {
|
|
2867
2916
|
let e = this.#a, i2 = this.#i[e], s = this.#t[e];
|
|
2868
|
-
return this.#O && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#m?.(s, i2, "evict"), this.#f && this.#r?.push([s, i2, "evict"])), this.#C(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#
|
|
2917
|
+
return this.#O && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#m?.(s, i2, "evict"), this.#f && this.#r?.push([s, i2, "evict"])), this.#C(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#_.push(e)), this.#n === 1 ? (this.#a = this.#h = 0, this.#_.length = 0) : this.#a = this.#l[e], this.#s.delete(i2), this.#n--, e;
|
|
2869
2918
|
}
|
|
2870
2919
|
has(t, e = {}) {
|
|
2871
2920
|
let { status: i2 = u2.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
@@ -2884,7 +2933,7 @@ var require_index_min = __commonJS({
|
|
|
2884
2933
|
return false;
|
|
2885
2934
|
}
|
|
2886
2935
|
peek(t, e = {}) {
|
|
2887
|
-
let { status: i2 =
|
|
2936
|
+
let { status: i2 = C() ? {} : void 0 } = e;
|
|
2888
2937
|
i2 && (i2.op = "peek", i2.key = t), e.status = i2;
|
|
2889
2938
|
let s = this.#J(t, e);
|
|
2890
2939
|
return u2.metrics.hasSubscribers && u2.metrics.publish(i2), s;
|
|
@@ -2898,23 +2947,23 @@ var require_index_min = __commonJS({
|
|
|
2898
2947
|
let o2 = this.#t[n2], r = this.#e(o2) ? o2.__staleWhileFetching : o2;
|
|
2899
2948
|
return i2 && (r !== void 0 ? (i2.peek = "hit", i2.value = r) : i2.peek = "miss"), r;
|
|
2900
2949
|
}
|
|
2901
|
-
#
|
|
2950
|
+
#G(t, e, i2, s) {
|
|
2902
2951
|
let n2 = e === void 0 ? void 0 : this.#t[e];
|
|
2903
2952
|
if (this.#e(n2)) return n2;
|
|
2904
2953
|
let o2 = new AbortController(), { signal: r } = i2;
|
|
2905
2954
|
r?.addEventListener("abort", () => o2.abort(r.reason), { signal: o2.signal });
|
|
2906
|
-
let h2 = { signal: o2.signal, options: i2, context: s }, a2 = (w,
|
|
2907
|
-
let { aborted: l } = o2.signal, S = i2.ignoreFetchAbort && w !== void 0,
|
|
2908
|
-
if (i2.status && (l && !
|
|
2955
|
+
let h2 = { signal: o2.signal, options: i2, context: s }, a2 = (w, _ = false) => {
|
|
2956
|
+
let { aborted: l } = o2.signal, S = i2.ignoreFetchAbort && w !== void 0, y = i2.ignoreFetchAbort || !!(i2.allowStaleOnFetchAbort && w !== void 0);
|
|
2957
|
+
if (i2.status && (l && !_ ? (i2.status.fetchAborted = true, i2.status.fetchError = o2.signal.reason, S && (i2.status.fetchAbortIgnored = true)) : i2.status.fetchResolved = true), l && !S && !_) return f(o2.signal.reason, y);
|
|
2909
2958
|
let b = m, g = this.#t[e];
|
|
2910
|
-
return (g === m || g === void 0 && S &&
|
|
2911
|
-
}, d = (w) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = w), f(w, false)), f = (w,
|
|
2912
|
-
let { aborted: l } = o2.signal, S = l && i2.allowStaleOnFetchAbort,
|
|
2913
|
-
if (this.#t[e] === m && (!b || !
|
|
2959
|
+
return (g === m || g === void 0 && S && _) && (w === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[e] = b.__staleWhileFetching : this.#z(t, "fetch") : (i2.status && (i2.status.fetchUpdated = true), this.#W(t, w, h2.options))), w;
|
|
2960
|
+
}, d = (w) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = w), f(w, false)), f = (w, _) => {
|
|
2961
|
+
let { aborted: l } = o2.signal, S = l && i2.allowStaleOnFetchAbort, y = S || i2.allowStaleOnFetchRejection, b = y || i2.noDeleteOnFetchRejection, g = m;
|
|
2962
|
+
if (this.#t[e] === m && (!b || !_ && g.__staleWhileFetching === void 0 ? this.#z(t, "fetch") : S || (this.#t[e] = g.__staleWhileFetching)), y) return i2.status && g.__staleWhileFetching !== void 0 && (i2.status.returnedStale = true), g.__staleWhileFetching;
|
|
2914
2963
|
if (g.__returned === g) throw w;
|
|
2915
|
-
}, p = (w,
|
|
2964
|
+
}, p = (w, _) => {
|
|
2916
2965
|
let l = this.#M?.(t, n2, h2);
|
|
2917
|
-
l && l instanceof Promise && l.then((S) => w(S === void 0 ? void 0 : S),
|
|
2966
|
+
l && l instanceof Promise && l.then((S) => w(S === void 0 ? void 0 : S), _), o2.signal.addEventListener("abort", () => {
|
|
2918
2967
|
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (w(void 0), i2.allowStaleOnFetchAbort && (w = (S) => a2(S, true)));
|
|
2919
2968
|
});
|
|
2920
2969
|
};
|
|
@@ -2928,19 +2977,19 @@ var require_index_min = __commonJS({
|
|
|
2928
2977
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
|
|
2929
2978
|
}
|
|
2930
2979
|
fetch(t, e = {}) {
|
|
2931
|
-
let i2 = u2.tracing.hasSubscribers, { status: s =
|
|
2980
|
+
let i2 = u2.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
2932
2981
|
e.status = s, s && e.context && (s.context = e.context);
|
|
2933
|
-
let n2 = this.#
|
|
2934
|
-
return s &&
|
|
2982
|
+
let n2 = this.#V(t, e);
|
|
2983
|
+
return s && i2 && (s.trace = true, u2.tracing.tracePromise(() => n2, s).catch(() => {
|
|
2935
2984
|
})), n2;
|
|
2936
2985
|
}
|
|
2937
|
-
async #
|
|
2938
|
-
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, ttl: o2 = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h2 = 0, sizeCalculation: a2 = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: p = this.allowStaleOnFetchRejection, ignoreFetchAbort: m = this.ignoreFetchAbort, allowStaleOnFetchAbort: T = this.allowStaleOnFetchAbort, context: w, forceRefresh:
|
|
2939
|
-
if (l && (l.op = "fetch", l.key = t,
|
|
2940
|
-
let
|
|
2986
|
+
async #V(t, e = {}) {
|
|
2987
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, ttl: o2 = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h2 = 0, sizeCalculation: a2 = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: p = this.allowStaleOnFetchRejection, ignoreFetchAbort: m = this.ignoreFetchAbort, allowStaleOnFetchAbort: T = this.allowStaleOnFetchAbort, context: w, forceRefresh: _ = false, status: l, signal: S } = e;
|
|
2988
|
+
if (l && (l.op = "fetch", l.key = t, _ && (l.forceRefresh = true)), !this.#O) return l && (l.fetch = "get"), this.#x(t, { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, status: l });
|
|
2989
|
+
let y = { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, ttl: o2, noDisposeOnSet: r, size: h2, sizeCalculation: a2, noUpdateTTL: d, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: T, ignoreFetchAbort: m, status: l, signal: S }, b = this.#s.get(t);
|
|
2941
2990
|
if (b === void 0) {
|
|
2942
2991
|
l && (l.fetch = "miss");
|
|
2943
|
-
let g = this.#
|
|
2992
|
+
let g = this.#G(t, b, y, w);
|
|
2944
2993
|
return g.__returned = g;
|
|
2945
2994
|
} else {
|
|
2946
2995
|
let g = this.#t[b];
|
|
@@ -2949,20 +2998,20 @@ var require_index_min = __commonJS({
|
|
|
2949
2998
|
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? g.__staleWhileFetching : g.__returned = g;
|
|
2950
2999
|
}
|
|
2951
3000
|
let A = this.#p(b);
|
|
2952
|
-
if (!
|
|
2953
|
-
let v = this.#
|
|
3001
|
+
if (!_ && !A) return l && (l.fetch = "hit"), this.#L(b), s && this.#R(b), l && this.#E(l, b), g;
|
|
3002
|
+
let v = this.#G(t, b, y, w), z = v.__staleWhileFetching !== void 0 && i2;
|
|
2954
3003
|
return l && (l.fetch = A ? "stale" : "refresh", z && A && (l.returnedStale = true)), z ? v.__staleWhileFetching : v.__returned = v;
|
|
2955
3004
|
}
|
|
2956
3005
|
}
|
|
2957
3006
|
forceFetch(t, e = {}) {
|
|
2958
|
-
let i2 = u2.tracing.hasSubscribers, { status: s =
|
|
3007
|
+
let i2 = u2.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
2959
3008
|
e.status = s, s && e.context && (s.context = e.context);
|
|
2960
3009
|
let n2 = this.#K(t, e);
|
|
2961
|
-
return s &&
|
|
3010
|
+
return s && i2 && (s.trace = true, u2.tracing.tracePromise(() => n2, s).catch(() => {
|
|
2962
3011
|
})), n2;
|
|
2963
3012
|
}
|
|
2964
3013
|
async #K(t, e = {}) {
|
|
2965
|
-
let i2 = await this.#
|
|
3014
|
+
let i2 = await this.#V(t, e);
|
|
2966
3015
|
if (i2 === void 0) throw new Error("fetch() returned undefined");
|
|
2967
3016
|
return i2;
|
|
2968
3017
|
}
|
|
@@ -3023,7 +3072,7 @@ var require_index_min = __commonJS({
|
|
|
3023
3072
|
let r = this.#l[s];
|
|
3024
3073
|
this.#u[r] = this.#u[s];
|
|
3025
3074
|
}
|
|
3026
|
-
this.#n--, this.#
|
|
3075
|
+
this.#n--, this.#_.push(s);
|
|
3027
3076
|
}
|
|
3028
3077
|
}
|
|
3029
3078
|
if (this.#f && this.#r?.length) {
|
|
@@ -3049,19 +3098,19 @@ var require_index_min = __commonJS({
|
|
|
3049
3098
|
for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
|
|
3050
3099
|
this.#g?.fill(void 0);
|
|
3051
3100
|
}
|
|
3052
|
-
if (this.#
|
|
3101
|
+
if (this.#y && this.#y.fill(0), this.#a = 0, this.#h = 0, this.#_.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
3053
3102
|
let e = this.#r, i2;
|
|
3054
3103
|
for (; i2 = e?.shift(); ) this.#w?.(...i2);
|
|
3055
3104
|
}
|
|
3056
3105
|
}
|
|
3057
3106
|
};
|
|
3058
|
-
exports.LRUCache =
|
|
3107
|
+
exports.LRUCache = L;
|
|
3059
3108
|
}
|
|
3060
3109
|
});
|
|
3061
3110
|
|
|
3062
|
-
// node_modules/hosted-git-info/lib/hosts.js
|
|
3111
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/hosts.js
|
|
3063
3112
|
var require_hosts = __commonJS({
|
|
3064
|
-
"node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
3113
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
3065
3114
|
"use strict";
|
|
3066
3115
|
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
3067
3116
|
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
@@ -3225,17 +3274,16 @@ var require_hosts = __commonJS({
|
|
|
3225
3274
|
}
|
|
3226
3275
|
});
|
|
3227
3276
|
|
|
3228
|
-
// node_modules/hosted-git-info/lib/parse-url.js
|
|
3277
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/parse-url.js
|
|
3229
3278
|
var require_parse_url = __commonJS({
|
|
3230
|
-
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
3231
|
-
var url = __require("url");
|
|
3279
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
3232
3280
|
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
3233
3281
|
const startPosition = str2.indexOf(beforeChar);
|
|
3234
3282
|
return str2.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
3235
3283
|
};
|
|
3236
3284
|
var safeUrl = (u2) => {
|
|
3237
3285
|
try {
|
|
3238
|
-
return new
|
|
3286
|
+
return new URL(u2);
|
|
3239
3287
|
} catch {
|
|
3240
3288
|
}
|
|
3241
3289
|
};
|
|
@@ -3276,9 +3324,9 @@ var require_parse_url = __commonJS({
|
|
|
3276
3324
|
}
|
|
3277
3325
|
});
|
|
3278
3326
|
|
|
3279
|
-
// node_modules/hosted-git-info/lib/from-url.js
|
|
3327
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/from-url.js
|
|
3280
3328
|
var require_from_url = __commonJS({
|
|
3281
|
-
"node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
3329
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
3282
3330
|
"use strict";
|
|
3283
3331
|
var parseUrl = require_parse_url();
|
|
3284
3332
|
var isGitHubShorthand = (arg) => {
|
|
@@ -3370,9 +3418,9 @@ var require_from_url = __commonJS({
|
|
|
3370
3418
|
}
|
|
3371
3419
|
});
|
|
3372
3420
|
|
|
3373
|
-
// node_modules/hosted-git-info/lib/index.js
|
|
3421
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/index.js
|
|
3374
3422
|
var require_lib = __commonJS({
|
|
3375
|
-
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
3423
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
3376
3424
|
"use strict";
|
|
3377
3425
|
var { LRUCache } = require_index_min();
|
|
3378
3426
|
var hosts = require_hosts();
|
|
@@ -13803,175 +13851,1263 @@ var require_spdx_correct = __commonJS({
|
|
|
13803
13851
|
return transformed;
|
|
13804
13852
|
}
|
|
13805
13853
|
}
|
|
13806
|
-
return null;
|
|
13807
|
-
};
|
|
13808
|
-
var validLastResort = function(identifier) {
|
|
13809
|
-
var upperCased = identifier.toUpperCase();
|
|
13810
|
-
for (var i2 = 0; i2 < lastResorts.length; i2++) {
|
|
13811
|
-
var lastResort = lastResorts[i2];
|
|
13812
|
-
if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
|
|
13813
|
-
return lastResort[IDENTIFIER];
|
|
13854
|
+
return null;
|
|
13855
|
+
};
|
|
13856
|
+
var validLastResort = function(identifier) {
|
|
13857
|
+
var upperCased = identifier.toUpperCase();
|
|
13858
|
+
for (var i2 = 0; i2 < lastResorts.length; i2++) {
|
|
13859
|
+
var lastResort = lastResorts[i2];
|
|
13860
|
+
if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
|
|
13861
|
+
return lastResort[IDENTIFIER];
|
|
13862
|
+
}
|
|
13863
|
+
}
|
|
13864
|
+
return null;
|
|
13865
|
+
};
|
|
13866
|
+
var anyCorrection = function(identifier, check) {
|
|
13867
|
+
for (var i2 = 0; i2 < transpositions.length; i2++) {
|
|
13868
|
+
var transposition = transpositions[i2];
|
|
13869
|
+
var transposed = transposition[TRANSPOSED];
|
|
13870
|
+
if (identifier.indexOf(transposed) > -1) {
|
|
13871
|
+
var corrected = identifier.replace(
|
|
13872
|
+
transposed,
|
|
13873
|
+
transposition[CORRECT]
|
|
13874
|
+
);
|
|
13875
|
+
var checked = check(corrected);
|
|
13876
|
+
if (checked !== null) {
|
|
13877
|
+
return checked;
|
|
13878
|
+
}
|
|
13879
|
+
}
|
|
13880
|
+
}
|
|
13881
|
+
return null;
|
|
13882
|
+
};
|
|
13883
|
+
module.exports = function(identifier, options) {
|
|
13884
|
+
options = options || {};
|
|
13885
|
+
var upgrade = options.upgrade === void 0 ? true : !!options.upgrade;
|
|
13886
|
+
function postprocess(value) {
|
|
13887
|
+
return upgrade ? upgradeGPLs(value) : value;
|
|
13888
|
+
}
|
|
13889
|
+
var validArugment = typeof identifier === "string" && identifier.trim().length !== 0;
|
|
13890
|
+
if (!validArugment) {
|
|
13891
|
+
throw Error("Invalid argument. Expected non-empty string.");
|
|
13892
|
+
}
|
|
13893
|
+
identifier = identifier.trim();
|
|
13894
|
+
if (valid(identifier)) {
|
|
13895
|
+
return postprocess(identifier);
|
|
13896
|
+
}
|
|
13897
|
+
var noPlus = identifier.replace(/\+$/, "").trim();
|
|
13898
|
+
if (valid(noPlus)) {
|
|
13899
|
+
return postprocess(noPlus);
|
|
13900
|
+
}
|
|
13901
|
+
var transformed = validTransformation(identifier);
|
|
13902
|
+
if (transformed !== null) {
|
|
13903
|
+
return postprocess(transformed);
|
|
13904
|
+
}
|
|
13905
|
+
transformed = anyCorrection(identifier, function(argument) {
|
|
13906
|
+
if (valid(argument)) {
|
|
13907
|
+
return argument;
|
|
13908
|
+
}
|
|
13909
|
+
return validTransformation(argument);
|
|
13910
|
+
});
|
|
13911
|
+
if (transformed !== null) {
|
|
13912
|
+
return postprocess(transformed);
|
|
13913
|
+
}
|
|
13914
|
+
transformed = validLastResort(identifier);
|
|
13915
|
+
if (transformed !== null) {
|
|
13916
|
+
return postprocess(transformed);
|
|
13917
|
+
}
|
|
13918
|
+
transformed = anyCorrection(identifier, validLastResort);
|
|
13919
|
+
if (transformed !== null) {
|
|
13920
|
+
return postprocess(transformed);
|
|
13921
|
+
}
|
|
13922
|
+
return null;
|
|
13923
|
+
};
|
|
13924
|
+
function upgradeGPLs(value) {
|
|
13925
|
+
if ([
|
|
13926
|
+
"GPL-1.0",
|
|
13927
|
+
"LGPL-1.0",
|
|
13928
|
+
"AGPL-1.0",
|
|
13929
|
+
"GPL-2.0",
|
|
13930
|
+
"LGPL-2.0",
|
|
13931
|
+
"AGPL-2.0",
|
|
13932
|
+
"LGPL-2.1"
|
|
13933
|
+
].indexOf(value) !== -1) {
|
|
13934
|
+
return value + "-only";
|
|
13935
|
+
} else if ([
|
|
13936
|
+
"GPL-1.0+",
|
|
13937
|
+
"GPL-2.0+",
|
|
13938
|
+
"GPL-3.0+",
|
|
13939
|
+
"LGPL-2.0+",
|
|
13940
|
+
"LGPL-2.1+",
|
|
13941
|
+
"LGPL-3.0+",
|
|
13942
|
+
"AGPL-1.0+",
|
|
13943
|
+
"AGPL-3.0+"
|
|
13944
|
+
].indexOf(value) !== -1) {
|
|
13945
|
+
return value.replace(/\+$/, "-or-later");
|
|
13946
|
+
} else if (["GPL-3.0", "LGPL-3.0", "AGPL-3.0"].indexOf(value) !== -1) {
|
|
13947
|
+
return value + "-or-later";
|
|
13948
|
+
} else {
|
|
13949
|
+
return value;
|
|
13950
|
+
}
|
|
13951
|
+
}
|
|
13952
|
+
}
|
|
13953
|
+
});
|
|
13954
|
+
|
|
13955
|
+
// node_modules/validate-npm-package-license/index.js
|
|
13956
|
+
var require_validate_npm_package_license = __commonJS({
|
|
13957
|
+
"node_modules/validate-npm-package-license/index.js"(exports, module) {
|
|
13958
|
+
var parse2 = require_spdx_expression_parse();
|
|
13959
|
+
var correct = require_spdx_correct();
|
|
13960
|
+
var genericWarning = 'license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"';
|
|
13961
|
+
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
13962
|
+
function startsWith(prefix, string) {
|
|
13963
|
+
return string.slice(0, prefix.length) === prefix;
|
|
13964
|
+
}
|
|
13965
|
+
function usesLicenseRef(ast) {
|
|
13966
|
+
if (ast.hasOwnProperty("license")) {
|
|
13967
|
+
var license = ast.license;
|
|
13968
|
+
return startsWith("LicenseRef", license) || startsWith("DocumentRef", license);
|
|
13969
|
+
} else {
|
|
13970
|
+
return usesLicenseRef(ast.left) || usesLicenseRef(ast.right);
|
|
13971
|
+
}
|
|
13972
|
+
}
|
|
13973
|
+
module.exports = function(argument) {
|
|
13974
|
+
var ast;
|
|
13975
|
+
try {
|
|
13976
|
+
ast = parse2(argument);
|
|
13977
|
+
} catch (e) {
|
|
13978
|
+
var match2;
|
|
13979
|
+
if (argument === "UNLICENSED" || argument === "UNLICENCED") {
|
|
13980
|
+
return {
|
|
13981
|
+
validForOldPackages: true,
|
|
13982
|
+
validForNewPackages: true,
|
|
13983
|
+
unlicensed: true
|
|
13984
|
+
};
|
|
13985
|
+
} else if (match2 = fileReferenceRE.exec(argument)) {
|
|
13986
|
+
return {
|
|
13987
|
+
validForOldPackages: true,
|
|
13988
|
+
validForNewPackages: true,
|
|
13989
|
+
inFile: match2[1]
|
|
13990
|
+
};
|
|
13991
|
+
} else {
|
|
13992
|
+
var result = {
|
|
13993
|
+
validForOldPackages: false,
|
|
13994
|
+
validForNewPackages: false,
|
|
13995
|
+
warnings: [genericWarning]
|
|
13996
|
+
};
|
|
13997
|
+
if (argument.trim().length !== 0) {
|
|
13998
|
+
var corrected = correct(argument);
|
|
13999
|
+
if (corrected) {
|
|
14000
|
+
result.warnings.push(
|
|
14001
|
+
'license is similar to the valid expression "' + corrected + '"'
|
|
14002
|
+
);
|
|
14003
|
+
}
|
|
14004
|
+
}
|
|
14005
|
+
return result;
|
|
14006
|
+
}
|
|
14007
|
+
}
|
|
14008
|
+
if (usesLicenseRef(ast)) {
|
|
14009
|
+
return {
|
|
14010
|
+
validForNewPackages: false,
|
|
14011
|
+
validForOldPackages: false,
|
|
14012
|
+
spdx: true,
|
|
14013
|
+
warnings: [genericWarning]
|
|
14014
|
+
};
|
|
14015
|
+
} else {
|
|
14016
|
+
return {
|
|
14017
|
+
validForNewPackages: true,
|
|
14018
|
+
validForOldPackages: true,
|
|
14019
|
+
spdx: true
|
|
14020
|
+
};
|
|
14021
|
+
}
|
|
14022
|
+
};
|
|
14023
|
+
}
|
|
14024
|
+
});
|
|
14025
|
+
|
|
14026
|
+
// node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/node/index.min.js
|
|
14027
|
+
var require_index_min2 = __commonJS({
|
|
14028
|
+
"node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
|
|
14029
|
+
"use strict";
|
|
14030
|
+
var M = (c3, t) => () => (t || c3((t = { exports: {} }).exports, t), t.exports);
|
|
14031
|
+
var U = M((O) => {
|
|
14032
|
+
"use strict";
|
|
14033
|
+
Object.defineProperty(O, "__esModule", { value: true });
|
|
14034
|
+
O.tracing = O.metrics = void 0;
|
|
14035
|
+
var j = __require("node:diagnostics_channel");
|
|
14036
|
+
O.metrics = (0, j.channel)("lru-cache:metrics");
|
|
14037
|
+
O.tracing = (0, j.tracingChannel)("lru-cache");
|
|
14038
|
+
});
|
|
14039
|
+
var I = M((R) => {
|
|
14040
|
+
"use strict";
|
|
14041
|
+
Object.defineProperty(R, "__esModule", { value: true });
|
|
14042
|
+
R.defaultPerf = void 0;
|
|
14043
|
+
R.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
14044
|
+
});
|
|
14045
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14046
|
+
exports.LRUCache = void 0;
|
|
14047
|
+
var u2 = U();
|
|
14048
|
+
var N = I();
|
|
14049
|
+
var C = () => u2.metrics.hasSubscribers || u2.tracing.hasSubscribers;
|
|
14050
|
+
var G = /* @__PURE__ */ new Set();
|
|
14051
|
+
var P = typeof process == "object" && process ? process : {};
|
|
14052
|
+
var k = (c3, t, e, i2) => {
|
|
14053
|
+
typeof P.emitWarning == "function" ? P.emitWarning(c3, t, e, i2) : console.error(`[${e}] ${t}: ${c3}`);
|
|
14054
|
+
};
|
|
14055
|
+
var q = (c3) => !G.has(c3);
|
|
14056
|
+
var F = (c3) => !!c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
|
|
14057
|
+
var H = (c3) => F(c3) ? c3 <= Math.pow(2, 8) ? Uint8Array : c3 <= Math.pow(2, 16) ? Uint16Array : c3 <= Math.pow(2, 32) ? Uint32Array : c3 <= Number.MAX_SAFE_INTEGER ? W : null : null;
|
|
14058
|
+
var W = class extends Array {
|
|
14059
|
+
constructor(t) {
|
|
14060
|
+
super(t), this.fill(0);
|
|
14061
|
+
}
|
|
14062
|
+
};
|
|
14063
|
+
var x = class c3 {
|
|
14064
|
+
heap;
|
|
14065
|
+
length;
|
|
14066
|
+
static #o = false;
|
|
14067
|
+
static create(t) {
|
|
14068
|
+
let e = H(t);
|
|
14069
|
+
if (!e) return [];
|
|
14070
|
+
c3.#o = true;
|
|
14071
|
+
let i2 = new c3(t, e);
|
|
14072
|
+
return c3.#o = false, i2;
|
|
14073
|
+
}
|
|
14074
|
+
constructor(t, e) {
|
|
14075
|
+
if (!c3.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
14076
|
+
this.heap = new e(t), this.length = 0;
|
|
14077
|
+
}
|
|
14078
|
+
push(t) {
|
|
14079
|
+
this.heap[this.length++] = t;
|
|
14080
|
+
}
|
|
14081
|
+
pop() {
|
|
14082
|
+
return this.heap[--this.length];
|
|
14083
|
+
}
|
|
14084
|
+
};
|
|
14085
|
+
var L = class c3 {
|
|
14086
|
+
#o;
|
|
14087
|
+
#c;
|
|
14088
|
+
#m;
|
|
14089
|
+
#D;
|
|
14090
|
+
#w;
|
|
14091
|
+
#M;
|
|
14092
|
+
#j;
|
|
14093
|
+
#S;
|
|
14094
|
+
get perf() {
|
|
14095
|
+
return this.#S;
|
|
14096
|
+
}
|
|
14097
|
+
ttl;
|
|
14098
|
+
ttlResolution;
|
|
14099
|
+
ttlAutopurge;
|
|
14100
|
+
updateAgeOnGet;
|
|
14101
|
+
updateAgeOnHas;
|
|
14102
|
+
allowStale;
|
|
14103
|
+
noDisposeOnSet;
|
|
14104
|
+
noUpdateTTL;
|
|
14105
|
+
maxEntrySize;
|
|
14106
|
+
sizeCalculation;
|
|
14107
|
+
noDeleteOnFetchRejection;
|
|
14108
|
+
noDeleteOnStaleGet;
|
|
14109
|
+
allowStaleOnFetchAbort;
|
|
14110
|
+
allowStaleOnFetchRejection;
|
|
14111
|
+
ignoreFetchAbort;
|
|
14112
|
+
#n;
|
|
14113
|
+
#b;
|
|
14114
|
+
#s;
|
|
14115
|
+
#i;
|
|
14116
|
+
#t;
|
|
14117
|
+
#l;
|
|
14118
|
+
#u;
|
|
14119
|
+
#a;
|
|
14120
|
+
#h;
|
|
14121
|
+
#_;
|
|
14122
|
+
#r;
|
|
14123
|
+
#y;
|
|
14124
|
+
#F;
|
|
14125
|
+
#d;
|
|
14126
|
+
#g;
|
|
14127
|
+
#T;
|
|
14128
|
+
#O;
|
|
14129
|
+
#f;
|
|
14130
|
+
#U;
|
|
14131
|
+
static unsafeExposeInternals(t) {
|
|
14132
|
+
return { starts: t.#F, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#y, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#l, prev: t.#u, get head() {
|
|
14133
|
+
return t.#a;
|
|
14134
|
+
}, get tail() {
|
|
14135
|
+
return t.#h;
|
|
14136
|
+
}, free: t.#_, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i2, s, n2) => t.#G(e, i2, s, n2), moveToTail: (e) => t.#L(e), indexes: (e) => t.#A(e), rindexes: (e) => t.#v(e), isStale: (e) => t.#p(e) };
|
|
14137
|
+
}
|
|
14138
|
+
get max() {
|
|
14139
|
+
return this.#o;
|
|
14140
|
+
}
|
|
14141
|
+
get maxSize() {
|
|
14142
|
+
return this.#c;
|
|
14143
|
+
}
|
|
14144
|
+
get calculatedSize() {
|
|
14145
|
+
return this.#b;
|
|
14146
|
+
}
|
|
14147
|
+
get size() {
|
|
14148
|
+
return this.#n;
|
|
14149
|
+
}
|
|
14150
|
+
get fetchMethod() {
|
|
14151
|
+
return this.#M;
|
|
14152
|
+
}
|
|
14153
|
+
get memoMethod() {
|
|
14154
|
+
return this.#j;
|
|
14155
|
+
}
|
|
14156
|
+
get dispose() {
|
|
14157
|
+
return this.#m;
|
|
14158
|
+
}
|
|
14159
|
+
get onInsert() {
|
|
14160
|
+
return this.#D;
|
|
14161
|
+
}
|
|
14162
|
+
get disposeAfter() {
|
|
14163
|
+
return this.#w;
|
|
14164
|
+
}
|
|
14165
|
+
constructor(t) {
|
|
14166
|
+
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n2, updateAgeOnGet: o2, updateAgeOnHas: r, allowStale: h2, dispose: a2, onInsert: d, disposeAfter: f, noDisposeOnSet: p, noUpdateTTL: m, maxSize: T = 0, maxEntrySize: w = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: y, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: g, allowStaleOnFetchAbort: A, ignoreFetchAbort: v, perf: D } = t;
|
|
14167
|
+
if (D !== void 0 && typeof D?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
14168
|
+
if (this.#S = D ?? N.defaultPerf, e !== 0 && !F(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
14169
|
+
let z = e ? H(e) : Array;
|
|
14170
|
+
if (!z) throw new Error("invalid max value: " + e);
|
|
14171
|
+
if (this.#o = e, this.#c = T, this.maxEntrySize = w || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
|
|
14172
|
+
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
14173
|
+
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
14174
|
+
}
|
|
14175
|
+
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
14176
|
+
if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
14177
|
+
if (this.#M = l, this.#O = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: e }).fill(void 0), this.#t = Array.from({ length: e }).fill(void 0), this.#l = new z(e), this.#u = new z(e), this.#a = 0, this.#h = 0, this.#_ = x.create(e), this.#n = 0, this.#b = 0, typeof a2 == "function" && (this.#m = a2), typeof d == "function" && (this.#D = d), typeof f == "function" ? (this.#w = f, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#m, this.#U = !!this.#D, this.#f = !!this.#w, this.noDisposeOnSet = !!p, this.noUpdateTTL = !!m, this.noDeleteOnFetchRejection = !!y, this.allowStaleOnFetchRejection = !!g, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!v, this.maxEntrySize !== 0) {
|
|
14178
|
+
if (this.#c !== 0 && !F(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
14179
|
+
if (!F(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
14180
|
+
this.#X();
|
|
14181
|
+
}
|
|
14182
|
+
if (this.allowStale = !!h2, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o2, this.updateAgeOnHas = !!r, this.ttlResolution = F(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n2, this.ttl = i2 || 0, this.ttl) {
|
|
14183
|
+
if (!F(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
14184
|
+
this.#H();
|
|
14185
|
+
}
|
|
14186
|
+
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
14187
|
+
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
14188
|
+
let E = "LRU_CACHE_UNBOUNDED";
|
|
14189
|
+
q(E) && (G.add(E), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c3));
|
|
14190
|
+
}
|
|
14191
|
+
}
|
|
14192
|
+
getRemainingTTL(t) {
|
|
14193
|
+
return this.#s.has(t) ? 1 / 0 : 0;
|
|
14194
|
+
}
|
|
14195
|
+
#H() {
|
|
14196
|
+
let t = new W(this.#o), e = new W(this.#o);
|
|
14197
|
+
this.#d = t, this.#F = e;
|
|
14198
|
+
let i2 = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
14199
|
+
this.#g = i2, this.#N = (r, h2, a2 = this.#S.now()) => {
|
|
14200
|
+
e[r] = h2 !== 0 ? a2 : 0, t[r] = h2, s(r, h2);
|
|
14201
|
+
}, this.#R = (r) => {
|
|
14202
|
+
e[r] = t[r] !== 0 ? this.#S.now() : 0, s(r, t[r]);
|
|
14203
|
+
};
|
|
14204
|
+
let s = this.ttlAutopurge ? (r, h2) => {
|
|
14205
|
+
if (i2?.[r] && (clearTimeout(i2[r]), i2[r] = void 0), h2 && h2 !== 0 && i2) {
|
|
14206
|
+
let a2 = setTimeout(() => {
|
|
14207
|
+
this.#p(r) && this.#z(this.#i[r], "expire");
|
|
14208
|
+
}, h2 + 1);
|
|
14209
|
+
a2.unref && a2.unref(), i2[r] = a2;
|
|
14210
|
+
}
|
|
14211
|
+
} : () => {
|
|
14212
|
+
};
|
|
14213
|
+
this.#E = (r, h2) => {
|
|
14214
|
+
if (t[h2]) {
|
|
14215
|
+
let a2 = t[h2], d = e[h2];
|
|
14216
|
+
if (!a2 || !d) return;
|
|
14217
|
+
r.ttl = a2, r.start = d, r.now = n2 || o2();
|
|
14218
|
+
let f = r.now - d;
|
|
14219
|
+
r.remainingTTL = a2 - f;
|
|
14220
|
+
}
|
|
14221
|
+
};
|
|
14222
|
+
let n2 = 0, o2 = () => {
|
|
14223
|
+
let r = this.#S.now();
|
|
14224
|
+
if (this.ttlResolution > 0) {
|
|
14225
|
+
n2 = r;
|
|
14226
|
+
let h2 = setTimeout(() => n2 = 0, this.ttlResolution);
|
|
14227
|
+
h2.unref && h2.unref();
|
|
14228
|
+
}
|
|
14229
|
+
return r;
|
|
14230
|
+
};
|
|
14231
|
+
this.getRemainingTTL = (r) => {
|
|
14232
|
+
let h2 = this.#s.get(r);
|
|
14233
|
+
if (h2 === void 0) return 0;
|
|
14234
|
+
let a2 = t[h2], d = e[h2];
|
|
14235
|
+
if (!a2 || !d) return 1 / 0;
|
|
14236
|
+
let f = (n2 || o2()) - d;
|
|
14237
|
+
return a2 - f;
|
|
14238
|
+
}, this.#p = (r) => {
|
|
14239
|
+
let h2 = e[r], a2 = t[r];
|
|
14240
|
+
return !!a2 && !!h2 && (n2 || o2()) - h2 > a2;
|
|
14241
|
+
};
|
|
14242
|
+
}
|
|
14243
|
+
#R = () => {
|
|
14244
|
+
};
|
|
14245
|
+
#E = () => {
|
|
14246
|
+
};
|
|
14247
|
+
#N = () => {
|
|
14248
|
+
};
|
|
14249
|
+
#p = () => false;
|
|
14250
|
+
#X() {
|
|
14251
|
+
let t = new W(this.#o);
|
|
14252
|
+
this.#b = 0, this.#y = t, this.#C = (e) => {
|
|
14253
|
+
this.#b -= t[e], t[e] = 0;
|
|
14254
|
+
}, this.#k = (e, i2, s, n2) => {
|
|
14255
|
+
if (this.#e(i2)) return 0;
|
|
14256
|
+
if (!F(s)) if (n2) {
|
|
14257
|
+
if (typeof n2 != "function") throw new TypeError("sizeCalculation must be a function");
|
|
14258
|
+
if (s = n2(i2, e), !F(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
14259
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
14260
|
+
return s;
|
|
14261
|
+
}, this.#I = (e, i2, s) => {
|
|
14262
|
+
if (t[e] = i2, this.#c) {
|
|
14263
|
+
let n2 = this.#c - t[e];
|
|
14264
|
+
for (; this.#b > n2; ) this.#P(true);
|
|
14265
|
+
}
|
|
14266
|
+
this.#b += t[e], s && (s.entrySize = i2, s.totalCalculatedSize = this.#b);
|
|
14267
|
+
};
|
|
14268
|
+
}
|
|
14269
|
+
#C = (t) => {
|
|
14270
|
+
};
|
|
14271
|
+
#I = (t, e, i2) => {
|
|
14272
|
+
};
|
|
14273
|
+
#k = (t, e, i2, s) => {
|
|
14274
|
+
if (i2 || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
14275
|
+
return 0;
|
|
14276
|
+
};
|
|
14277
|
+
*#A({ allowStale: t = this.allowStale } = {}) {
|
|
14278
|
+
if (this.#n) for (let e = this.#h; this.#q(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a); ) e = this.#u[e];
|
|
14279
|
+
}
|
|
14280
|
+
*#v({ allowStale: t = this.allowStale } = {}) {
|
|
14281
|
+
if (this.#n) for (let e = this.#a; this.#q(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h); ) e = this.#l[e];
|
|
14282
|
+
}
|
|
14283
|
+
#q(t) {
|
|
14284
|
+
return t !== void 0 && this.#s.get(this.#i[t]) === t;
|
|
14285
|
+
}
|
|
14286
|
+
*entries() {
|
|
14287
|
+
for (let t of this.#A()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
14288
|
+
}
|
|
14289
|
+
*rentries() {
|
|
14290
|
+
for (let t of this.#v()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
14291
|
+
}
|
|
14292
|
+
*keys() {
|
|
14293
|
+
for (let t of this.#A()) {
|
|
14294
|
+
let e = this.#i[t];
|
|
14295
|
+
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
14296
|
+
}
|
|
14297
|
+
}
|
|
14298
|
+
*rkeys() {
|
|
14299
|
+
for (let t of this.#v()) {
|
|
14300
|
+
let e = this.#i[t];
|
|
14301
|
+
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
14302
|
+
}
|
|
14303
|
+
}
|
|
14304
|
+
*values() {
|
|
14305
|
+
for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
14306
|
+
}
|
|
14307
|
+
*rvalues() {
|
|
14308
|
+
for (let t of this.#v()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
14309
|
+
}
|
|
14310
|
+
[Symbol.iterator]() {
|
|
14311
|
+
return this.entries();
|
|
14312
|
+
}
|
|
14313
|
+
[Symbol.toStringTag] = "LRUCache";
|
|
14314
|
+
find(t, e = {}) {
|
|
14315
|
+
for (let i2 of this.#A()) {
|
|
14316
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14317
|
+
if (n2 !== void 0 && t(n2, this.#i[i2], this)) return this.#x(this.#i[i2], e);
|
|
14318
|
+
}
|
|
14319
|
+
}
|
|
14320
|
+
forEach(t, e = this) {
|
|
14321
|
+
for (let i2 of this.#A()) {
|
|
14322
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14323
|
+
n2 !== void 0 && t.call(e, n2, this.#i[i2], this);
|
|
14324
|
+
}
|
|
14325
|
+
}
|
|
14326
|
+
rforEach(t, e = this) {
|
|
14327
|
+
for (let i2 of this.#v()) {
|
|
14328
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14329
|
+
n2 !== void 0 && t.call(e, n2, this.#i[i2], this);
|
|
14330
|
+
}
|
|
14331
|
+
}
|
|
14332
|
+
purgeStale() {
|
|
14333
|
+
let t = false;
|
|
14334
|
+
for (let e of this.#v({ allowStale: true })) this.#p(e) && (this.#z(this.#i[e], "expire"), t = true);
|
|
14335
|
+
return t;
|
|
14336
|
+
}
|
|
14337
|
+
info(t) {
|
|
14338
|
+
let e = this.#s.get(t);
|
|
14339
|
+
if (e === void 0) return;
|
|
14340
|
+
let i2 = this.#t[e], s = this.#e(i2) ? i2.__staleWhileFetching : i2;
|
|
14341
|
+
if (s === void 0) return;
|
|
14342
|
+
let n2 = { value: s };
|
|
14343
|
+
if (this.#d && this.#F) {
|
|
14344
|
+
let o2 = this.#d[e], r = this.#F[e];
|
|
14345
|
+
if (o2 && r) {
|
|
14346
|
+
let h2 = o2 - (this.#S.now() - r);
|
|
14347
|
+
n2.ttl = h2, n2.start = Date.now();
|
|
14348
|
+
}
|
|
14349
|
+
}
|
|
14350
|
+
return this.#y && (n2.size = this.#y[e]), n2;
|
|
14351
|
+
}
|
|
14352
|
+
dump() {
|
|
14353
|
+
let t = [];
|
|
14354
|
+
for (let e of this.#A({ allowStale: true })) {
|
|
14355
|
+
let i2 = this.#i[e], s = this.#t[e], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14356
|
+
if (n2 === void 0 || i2 === void 0) continue;
|
|
14357
|
+
let o2 = { value: n2 };
|
|
14358
|
+
if (this.#d && this.#F) {
|
|
14359
|
+
o2.ttl = this.#d[e];
|
|
14360
|
+
let r = this.#S.now() - this.#F[e];
|
|
14361
|
+
o2.start = Math.floor(Date.now() - r);
|
|
14362
|
+
}
|
|
14363
|
+
this.#y && (o2.size = this.#y[e]), t.unshift([i2, o2]);
|
|
14364
|
+
}
|
|
14365
|
+
return t;
|
|
14366
|
+
}
|
|
14367
|
+
load(t) {
|
|
14368
|
+
this.clear();
|
|
14369
|
+
for (let [e, i2] of t) {
|
|
14370
|
+
if (i2.start) {
|
|
14371
|
+
let s = Date.now() - i2.start;
|
|
14372
|
+
i2.start = this.#S.now() - s;
|
|
14373
|
+
}
|
|
14374
|
+
this.#W(e, i2.value, i2);
|
|
14375
|
+
}
|
|
14376
|
+
}
|
|
14377
|
+
set(t, e, i2 = {}) {
|
|
14378
|
+
let { status: s = u2.metrics.hasSubscribers ? {} : void 0 } = i2;
|
|
14379
|
+
i2.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e));
|
|
14380
|
+
let n2 = this.#W(t, e, i2);
|
|
14381
|
+
return s && u2.metrics.hasSubscribers && u2.metrics.publish(s), n2;
|
|
14382
|
+
}
|
|
14383
|
+
#W(t, e, i2 = {}) {
|
|
14384
|
+
let { ttl: s = this.ttl, start: n2, noDisposeOnSet: o2 = this.noDisposeOnSet, sizeCalculation: r = this.sizeCalculation, status: h2 } = i2;
|
|
14385
|
+
if (e === void 0) return h2 && (h2.set = "deleted"), this.delete(t), this;
|
|
14386
|
+
let { noUpdateTTL: a2 = this.noUpdateTTL } = i2;
|
|
14387
|
+
h2 && !this.#e(e) && (h2.value = e);
|
|
14388
|
+
let d = this.#k(t, e, i2.size || 0, r, h2);
|
|
14389
|
+
if (this.maxEntrySize && d > this.maxEntrySize) return this.#z(t, "set"), h2 && (h2.set = "miss", h2.maxEntrySizeExceeded = true), this;
|
|
14390
|
+
let f = this.#n === 0 ? void 0 : this.#s.get(t);
|
|
14391
|
+
if (f === void 0) f = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(false) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#l[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#I(f, d, h2), h2 && (h2.set = "add"), a2 = false, this.#U && this.#D?.(e, t, "add");
|
|
14392
|
+
else {
|
|
14393
|
+
this.#L(f);
|
|
14394
|
+
let p = this.#t[f];
|
|
14395
|
+
if (e !== p) {
|
|
14396
|
+
if (this.#O && this.#e(p)) {
|
|
14397
|
+
p.__abortController.abort(new Error("replaced"));
|
|
14398
|
+
let { __staleWhileFetching: m } = p;
|
|
14399
|
+
m !== void 0 && !o2 && (this.#T && this.#m?.(m, t, "set"), this.#f && this.#r?.push([m, t, "set"]));
|
|
14400
|
+
} else o2 || (this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([p, t, "set"]));
|
|
14401
|
+
if (this.#C(f), this.#I(f, d, h2), this.#t[f] = e, h2) {
|
|
14402
|
+
h2.set = "replace";
|
|
14403
|
+
let m = p && this.#e(p) ? p.__staleWhileFetching : p;
|
|
14404
|
+
m !== void 0 && (h2.oldValue = m);
|
|
14405
|
+
}
|
|
14406
|
+
} else h2 && (h2.set = "update");
|
|
14407
|
+
this.#U && this.onInsert?.(e, t, e === p ? "update" : "replace");
|
|
14408
|
+
}
|
|
14409
|
+
if (s !== 0 && !this.#d && this.#H(), this.#d && (a2 || this.#N(f, s, n2), h2 && this.#E(h2, f)), !o2 && this.#f && this.#r) {
|
|
14410
|
+
let p = this.#r, m;
|
|
14411
|
+
for (; m = p?.shift(); ) this.#w?.(...m);
|
|
14412
|
+
}
|
|
14413
|
+
return this;
|
|
14414
|
+
}
|
|
14415
|
+
pop() {
|
|
14416
|
+
try {
|
|
14417
|
+
for (; this.#n; ) {
|
|
14418
|
+
let t = this.#t[this.#a];
|
|
14419
|
+
if (this.#P(true), this.#e(t)) {
|
|
14420
|
+
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
14421
|
+
} else if (t !== void 0) return t;
|
|
14422
|
+
}
|
|
14423
|
+
} finally {
|
|
14424
|
+
if (this.#f && this.#r) {
|
|
14425
|
+
let t = this.#r, e;
|
|
14426
|
+
for (; e = t?.shift(); ) this.#w?.(...e);
|
|
14427
|
+
}
|
|
14428
|
+
}
|
|
14429
|
+
}
|
|
14430
|
+
#P(t) {
|
|
14431
|
+
let e = this.#a, i2 = this.#i[e], s = this.#t[e];
|
|
14432
|
+
return this.#O && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#m?.(s, i2, "evict"), this.#f && this.#r?.push([s, i2, "evict"])), this.#C(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#_.push(e)), this.#n === 1 ? (this.#a = this.#h = 0, this.#_.length = 0) : this.#a = this.#l[e], this.#s.delete(i2), this.#n--, e;
|
|
14433
|
+
}
|
|
14434
|
+
has(t, e = {}) {
|
|
14435
|
+
let { status: i2 = u2.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14436
|
+
e.status = i2, i2 && (i2.op = "has", i2.key = t);
|
|
14437
|
+
let s = this.#Y(t, e);
|
|
14438
|
+
return u2.metrics.hasSubscribers && u2.metrics.publish(i2), s;
|
|
14439
|
+
}
|
|
14440
|
+
#Y(t, e = {}) {
|
|
14441
|
+
let { updateAgeOnHas: i2 = this.updateAgeOnHas, status: s } = e, n2 = this.#s.get(t);
|
|
14442
|
+
if (n2 !== void 0) {
|
|
14443
|
+
let o2 = this.#t[n2];
|
|
14444
|
+
if (this.#e(o2) && o2.__staleWhileFetching === void 0) return false;
|
|
14445
|
+
if (this.#p(n2)) s && (s.has = "stale", this.#E(s, n2));
|
|
14446
|
+
else return i2 && this.#R(n2), s && (s.has = "hit", this.#E(s, n2)), true;
|
|
14447
|
+
} else s && (s.has = "miss");
|
|
14448
|
+
return false;
|
|
14449
|
+
}
|
|
14450
|
+
peek(t, e = {}) {
|
|
14451
|
+
let { status: i2 = C() ? {} : void 0 } = e;
|
|
14452
|
+
i2 && (i2.op = "peek", i2.key = t), e.status = i2;
|
|
14453
|
+
let s = this.#J(t, e);
|
|
14454
|
+
return u2.metrics.hasSubscribers && u2.metrics.publish(i2), s;
|
|
14455
|
+
}
|
|
14456
|
+
#J(t, e) {
|
|
14457
|
+
let { status: i2, allowStale: s = this.allowStale } = e, n2 = this.#s.get(t);
|
|
14458
|
+
if (n2 === void 0 || !s && this.#p(n2)) {
|
|
14459
|
+
i2 && (i2.peek = n2 === void 0 ? "miss" : "stale");
|
|
14460
|
+
return;
|
|
14461
|
+
}
|
|
14462
|
+
let o2 = this.#t[n2], r = this.#e(o2) ? o2.__staleWhileFetching : o2;
|
|
14463
|
+
return i2 && (r !== void 0 ? (i2.peek = "hit", i2.value = r) : i2.peek = "miss"), r;
|
|
14464
|
+
}
|
|
14465
|
+
#G(t, e, i2, s) {
|
|
14466
|
+
let n2 = e === void 0 ? void 0 : this.#t[e];
|
|
14467
|
+
if (this.#e(n2)) return n2;
|
|
14468
|
+
let o2 = new AbortController(), { signal: r } = i2;
|
|
14469
|
+
r?.addEventListener("abort", () => o2.abort(r.reason), { signal: o2.signal });
|
|
14470
|
+
let h2 = { signal: o2.signal, options: i2, context: s }, a2 = (w, _ = false) => {
|
|
14471
|
+
let { aborted: l } = o2.signal, S = i2.ignoreFetchAbort && w !== void 0, y = i2.ignoreFetchAbort || !!(i2.allowStaleOnFetchAbort && w !== void 0);
|
|
14472
|
+
if (i2.status && (l && !_ ? (i2.status.fetchAborted = true, i2.status.fetchError = o2.signal.reason, S && (i2.status.fetchAbortIgnored = true)) : i2.status.fetchResolved = true), l && !S && !_) return f(o2.signal.reason, y);
|
|
14473
|
+
let b = m, g = this.#t[e];
|
|
14474
|
+
return (g === m || g === void 0 && S && _) && (w === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[e] = b.__staleWhileFetching : this.#z(t, "fetch") : (i2.status && (i2.status.fetchUpdated = true), this.#W(t, w, h2.options))), w;
|
|
14475
|
+
}, d = (w) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = w), f(w, false)), f = (w, _) => {
|
|
14476
|
+
let { aborted: l } = o2.signal, S = l && i2.allowStaleOnFetchAbort, y = S || i2.allowStaleOnFetchRejection, b = y || i2.noDeleteOnFetchRejection, g = m;
|
|
14477
|
+
if (this.#t[e] === m && (!b || !_ && g.__staleWhileFetching === void 0 ? this.#z(t, "fetch") : S || (this.#t[e] = g.__staleWhileFetching)), y) return i2.status && g.__staleWhileFetching !== void 0 && (i2.status.returnedStale = true), g.__staleWhileFetching;
|
|
14478
|
+
if (g.__returned === g) throw w;
|
|
14479
|
+
}, p = (w, _) => {
|
|
14480
|
+
let l = this.#M?.(t, n2, h2);
|
|
14481
|
+
l && l instanceof Promise && l.then((S) => w(S === void 0 ? void 0 : S), _), o2.signal.addEventListener("abort", () => {
|
|
14482
|
+
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (w(void 0), i2.allowStaleOnFetchAbort && (w = (S) => a2(S, true)));
|
|
14483
|
+
});
|
|
14484
|
+
};
|
|
14485
|
+
i2.status && (i2.status.fetchDispatched = true);
|
|
14486
|
+
let m = new Promise(p).then(a2, d), T = Object.assign(m, { __abortController: o2, __staleWhileFetching: n2, __returned: void 0 });
|
|
14487
|
+
return e === void 0 ? (this.#W(t, T, { ...h2.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = T, T;
|
|
14488
|
+
}
|
|
14489
|
+
#e(t) {
|
|
14490
|
+
if (!this.#O) return false;
|
|
14491
|
+
let e = t;
|
|
14492
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
|
|
14493
|
+
}
|
|
14494
|
+
fetch(t, e = {}) {
|
|
14495
|
+
let i2 = u2.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
14496
|
+
e.status = s, s && e.context && (s.context = e.context);
|
|
14497
|
+
let n2 = this.#V(t, e);
|
|
14498
|
+
return s && i2 && (s.trace = true, u2.tracing.tracePromise(() => n2, s).catch(() => {
|
|
14499
|
+
})), n2;
|
|
14500
|
+
}
|
|
14501
|
+
async #V(t, e = {}) {
|
|
14502
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, ttl: o2 = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h2 = 0, sizeCalculation: a2 = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: p = this.allowStaleOnFetchRejection, ignoreFetchAbort: m = this.ignoreFetchAbort, allowStaleOnFetchAbort: T = this.allowStaleOnFetchAbort, context: w, forceRefresh: _ = false, status: l, signal: S } = e;
|
|
14503
|
+
if (l && (l.op = "fetch", l.key = t, _ && (l.forceRefresh = true)), !this.#O) return l && (l.fetch = "get"), this.#x(t, { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, status: l });
|
|
14504
|
+
let y = { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, ttl: o2, noDisposeOnSet: r, size: h2, sizeCalculation: a2, noUpdateTTL: d, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: T, ignoreFetchAbort: m, status: l, signal: S }, b = this.#s.get(t);
|
|
14505
|
+
if (b === void 0) {
|
|
14506
|
+
l && (l.fetch = "miss");
|
|
14507
|
+
let g = this.#G(t, b, y, w);
|
|
14508
|
+
return g.__returned = g;
|
|
14509
|
+
} else {
|
|
14510
|
+
let g = this.#t[b];
|
|
14511
|
+
if (this.#e(g)) {
|
|
14512
|
+
let E = i2 && g.__staleWhileFetching !== void 0;
|
|
14513
|
+
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? g.__staleWhileFetching : g.__returned = g;
|
|
14514
|
+
}
|
|
14515
|
+
let A = this.#p(b);
|
|
14516
|
+
if (!_ && !A) return l && (l.fetch = "hit"), this.#L(b), s && this.#R(b), l && this.#E(l, b), g;
|
|
14517
|
+
let v = this.#G(t, b, y, w), z = v.__staleWhileFetching !== void 0 && i2;
|
|
14518
|
+
return l && (l.fetch = A ? "stale" : "refresh", z && A && (l.returnedStale = true)), z ? v.__staleWhileFetching : v.__returned = v;
|
|
14519
|
+
}
|
|
14520
|
+
}
|
|
14521
|
+
forceFetch(t, e = {}) {
|
|
14522
|
+
let i2 = u2.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
14523
|
+
e.status = s, s && e.context && (s.context = e.context);
|
|
14524
|
+
let n2 = this.#K(t, e);
|
|
14525
|
+
return s && i2 && (s.trace = true, u2.tracing.tracePromise(() => n2, s).catch(() => {
|
|
14526
|
+
})), n2;
|
|
14527
|
+
}
|
|
14528
|
+
async #K(t, e = {}) {
|
|
14529
|
+
let i2 = await this.#V(t, e);
|
|
14530
|
+
if (i2 === void 0) throw new Error("fetch() returned undefined");
|
|
14531
|
+
return i2;
|
|
14532
|
+
}
|
|
14533
|
+
memo(t, e = {}) {
|
|
14534
|
+
let { status: i2 = u2.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14535
|
+
e.status = i2, i2 && (i2.op = "memo", i2.key = t, e.context && (i2.context = e.context));
|
|
14536
|
+
let s = this.#Q(t, e);
|
|
14537
|
+
return i2 && (i2.value = s), u2.metrics.hasSubscribers && u2.metrics.publish(i2), s;
|
|
14538
|
+
}
|
|
14539
|
+
#Q(t, e = {}) {
|
|
14540
|
+
let i2 = this.#j;
|
|
14541
|
+
if (!i2) throw new Error("no memoMethod provided to constructor");
|
|
14542
|
+
let { context: s, status: n2, forceRefresh: o2, ...r } = e;
|
|
14543
|
+
n2 && o2 && (n2.forceRefresh = true);
|
|
14544
|
+
let h2 = this.#x(t, r), a2 = o2 || h2 === void 0;
|
|
14545
|
+
if (n2 && (n2.memo = a2 ? "miss" : "hit", a2 || (n2.value = h2)), !a2) return h2;
|
|
14546
|
+
let d = i2(t, h2, { options: r, context: s });
|
|
14547
|
+
return n2 && (n2.value = d), this.#W(t, d, r), d;
|
|
14548
|
+
}
|
|
14549
|
+
get(t, e = {}) {
|
|
14550
|
+
let { status: i2 = u2.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14551
|
+
e.status = i2, i2 && (i2.op = "get", i2.key = t);
|
|
14552
|
+
let s = this.#x(t, e);
|
|
14553
|
+
return i2 && (s !== void 0 && (i2.value = s), u2.metrics.hasSubscribers && u2.metrics.publish(i2)), s;
|
|
14554
|
+
}
|
|
14555
|
+
#x(t, e = {}) {
|
|
14556
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, status: o2 } = e, r = this.#s.get(t);
|
|
14557
|
+
if (r === void 0) {
|
|
14558
|
+
o2 && (o2.get = "miss");
|
|
14559
|
+
return;
|
|
14560
|
+
}
|
|
14561
|
+
let h2 = this.#t[r], a2 = this.#e(h2);
|
|
14562
|
+
return o2 && this.#E(o2, r), this.#p(r) ? a2 ? (o2 && (o2.get = "stale-fetching"), i2 && h2.__staleWhileFetching !== void 0 ? (o2 && (o2.returnedStale = true), h2.__staleWhileFetching) : void 0) : (n2 || this.#z(t, "expire"), o2 && (o2.get = "stale"), i2 ? (o2 && (o2.returnedStale = true), h2) : void 0) : (o2 && (o2.get = a2 ? "fetching" : "hit"), this.#L(r), s && this.#R(r), a2 ? h2.__staleWhileFetching : h2);
|
|
14563
|
+
}
|
|
14564
|
+
#B(t, e) {
|
|
14565
|
+
this.#u[e] = t, this.#l[t] = e;
|
|
14566
|
+
}
|
|
14567
|
+
#L(t) {
|
|
14568
|
+
t !== this.#h && (t === this.#a ? this.#a = this.#l[t] : this.#B(this.#u[t], this.#l[t]), this.#B(this.#h, t), this.#h = t);
|
|
14569
|
+
}
|
|
14570
|
+
delete(t) {
|
|
14571
|
+
return this.#z(t, "delete");
|
|
14572
|
+
}
|
|
14573
|
+
#z(t, e) {
|
|
14574
|
+
u2.metrics.hasSubscribers && u2.metrics.publish({ op: "delete", delete: e, key: t });
|
|
14575
|
+
let i2 = false;
|
|
14576
|
+
if (this.#n !== 0) {
|
|
14577
|
+
let s = this.#s.get(t);
|
|
14578
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i2 = true, this.#n === 1) this.#$(e);
|
|
14579
|
+
else {
|
|
14580
|
+
this.#C(s);
|
|
14581
|
+
let n2 = this.#t[s];
|
|
14582
|
+
if (this.#e(n2) ? n2.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#m?.(n2, t, e), this.#f && this.#r?.push([n2, t, e])), this.#s.delete(t), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
|
|
14583
|
+
else if (s === this.#a) this.#a = this.#l[s];
|
|
14584
|
+
else {
|
|
14585
|
+
let o2 = this.#u[s];
|
|
14586
|
+
this.#l[o2] = this.#l[s];
|
|
14587
|
+
let r = this.#l[s];
|
|
14588
|
+
this.#u[r] = this.#u[s];
|
|
14589
|
+
}
|
|
14590
|
+
this.#n--, this.#_.push(s);
|
|
14591
|
+
}
|
|
14592
|
+
}
|
|
14593
|
+
if (this.#f && this.#r?.length) {
|
|
14594
|
+
let s = this.#r, n2;
|
|
14595
|
+
for (; n2 = s?.shift(); ) this.#w?.(...n2);
|
|
14596
|
+
}
|
|
14597
|
+
return i2;
|
|
14598
|
+
}
|
|
14599
|
+
clear() {
|
|
14600
|
+
return this.#$("delete");
|
|
14601
|
+
}
|
|
14602
|
+
#$(t) {
|
|
14603
|
+
for (let e of this.#v({ allowStale: true })) {
|
|
14604
|
+
let i2 = this.#t[e];
|
|
14605
|
+
if (this.#e(i2)) i2.__abortController.abort(new Error("deleted"));
|
|
14606
|
+
else {
|
|
14607
|
+
let s = this.#i[e];
|
|
14608
|
+
this.#T && this.#m?.(i2, s, t), this.#f && this.#r?.push([i2, s, t]);
|
|
14609
|
+
}
|
|
14610
|
+
}
|
|
14611
|
+
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
14612
|
+
this.#d.fill(0), this.#F.fill(0);
|
|
14613
|
+
for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
|
|
14614
|
+
this.#g?.fill(void 0);
|
|
14615
|
+
}
|
|
14616
|
+
if (this.#y && this.#y.fill(0), this.#a = 0, this.#h = 0, this.#_.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
14617
|
+
let e = this.#r, i2;
|
|
14618
|
+
for (; i2 = e?.shift(); ) this.#w?.(...i2);
|
|
14619
|
+
}
|
|
14620
|
+
}
|
|
14621
|
+
};
|
|
14622
|
+
exports.LRUCache = L;
|
|
14623
|
+
}
|
|
14624
|
+
});
|
|
14625
|
+
|
|
14626
|
+
// node_modules/hosted-git-info/lib/hosts.js
|
|
14627
|
+
var require_hosts2 = __commonJS({
|
|
14628
|
+
"node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
14629
|
+
"use strict";
|
|
14630
|
+
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
14631
|
+
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
14632
|
+
var formatHashFragment = (f) => f.toLowerCase().replace(/^\W+/g, "").replace(/(?<!\W)\W+$/, "").replace(/\//g, "").replace(/\W+/g, "-");
|
|
14633
|
+
var defaults2 = {
|
|
14634
|
+
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14635
|
+
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14636
|
+
edittemplate: ({ domain, user, project, committish, editpath, path: path26 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path26)}`,
|
|
14637
|
+
browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
|
|
14638
|
+
browsetreetemplate: ({ domain, user, project, committish, treepath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14639
|
+
browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14640
|
+
docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
|
|
14641
|
+
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14642
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
14643
|
+
shortcuttemplate: ({ type: type2, user, project, committish }) => `${type2}:${user}/${project}${maybeJoin("#", committish)}`,
|
|
14644
|
+
pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
|
|
14645
|
+
bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
|
|
14646
|
+
hashformat: formatHashFragment
|
|
14647
|
+
};
|
|
14648
|
+
var hosts = {};
|
|
14649
|
+
hosts.github = {
|
|
14650
|
+
// First two are insecure and generally shouldn't be used any more, but
|
|
14651
|
+
// they are still supported.
|
|
14652
|
+
protocols: ["git:", "http:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14653
|
+
domain: "github.com",
|
|
14654
|
+
treepath: "tree",
|
|
14655
|
+
blobpath: "blob",
|
|
14656
|
+
editpath: "edit",
|
|
14657
|
+
filetemplate: ({ auth, user, project, committish, path: path26 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
14658
|
+
gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14659
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
14660
|
+
extract: (url) => {
|
|
14661
|
+
let [, user, project, type2, committish] = url.pathname.split("/", 5);
|
|
14662
|
+
if (type2 && type2 !== "tree") {
|
|
14663
|
+
return;
|
|
14664
|
+
}
|
|
14665
|
+
if (!type2) {
|
|
14666
|
+
committish = url.hash.slice(1);
|
|
14667
|
+
}
|
|
14668
|
+
if (project && project.endsWith(".git")) {
|
|
14669
|
+
project = project.slice(0, -4);
|
|
14670
|
+
}
|
|
14671
|
+
if (!user || !project) {
|
|
14672
|
+
return;
|
|
14673
|
+
}
|
|
14674
|
+
return { user, project, committish };
|
|
14675
|
+
}
|
|
14676
|
+
};
|
|
14677
|
+
hosts.bitbucket = {
|
|
14678
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14679
|
+
domain: "bitbucket.org",
|
|
14680
|
+
treepath: "src",
|
|
14681
|
+
blobpath: "src",
|
|
14682
|
+
editpath: "?mode=edit",
|
|
14683
|
+
edittemplate: ({ domain, user, project, committish, treepath, path: path26, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path26, editpath)}`,
|
|
14684
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
|
|
14685
|
+
extract: (url) => {
|
|
14686
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14687
|
+
if (["get"].includes(aux)) {
|
|
14688
|
+
return;
|
|
14689
|
+
}
|
|
14690
|
+
if (project && project.endsWith(".git")) {
|
|
14691
|
+
project = project.slice(0, -4);
|
|
14692
|
+
}
|
|
14693
|
+
if (!user || !project) {
|
|
14694
|
+
return;
|
|
14695
|
+
}
|
|
14696
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14697
|
+
}
|
|
14698
|
+
};
|
|
14699
|
+
hosts.gitlab = {
|
|
14700
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14701
|
+
domain: "gitlab.com",
|
|
14702
|
+
treepath: "tree",
|
|
14703
|
+
blobpath: "tree",
|
|
14704
|
+
editpath: "-/edit",
|
|
14705
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/api/v4/projects/${maybeEncode(user + "/" + project)}/repository/archive.tar.gz?sha=${maybeEncode(committish || "HEAD")}`,
|
|
14706
|
+
extract: (url) => {
|
|
14707
|
+
const path26 = url.pathname.slice(1);
|
|
14708
|
+
if (path26.includes("/-/") || path26.includes("/archive.tar.gz")) {
|
|
14709
|
+
return;
|
|
14710
|
+
}
|
|
14711
|
+
const segments = path26.split("/");
|
|
14712
|
+
let project = segments.pop();
|
|
14713
|
+
if (project.endsWith(".git")) {
|
|
14714
|
+
project = project.slice(0, -4);
|
|
14715
|
+
}
|
|
14716
|
+
const user = segments.join("/");
|
|
14717
|
+
if (!user || !project) {
|
|
14718
|
+
return;
|
|
14719
|
+
}
|
|
14720
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14721
|
+
}
|
|
14722
|
+
};
|
|
14723
|
+
hosts.gist = {
|
|
14724
|
+
protocols: ["git:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14725
|
+
domain: "gist.github.com",
|
|
14726
|
+
editpath: "edit",
|
|
14727
|
+
sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin("#", committish)}`,
|
|
14728
|
+
sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14729
|
+
edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
|
|
14730
|
+
browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14731
|
+
browsetreetemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
14732
|
+
browseblobtemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
14733
|
+
docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14734
|
+
httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14735
|
+
filetemplate: ({ user, project, committish, path: path26 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path26}`,
|
|
14736
|
+
shortcuttemplate: ({ type: type2, project, committish }) => `${type2}:${project}${maybeJoin("#", committish)}`,
|
|
14737
|
+
pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
|
|
14738
|
+
bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
|
|
14739
|
+
gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14740
|
+
tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
14741
|
+
extract: (url) => {
|
|
14742
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14743
|
+
if (aux === "raw") {
|
|
14744
|
+
return;
|
|
14745
|
+
}
|
|
14746
|
+
if (!project) {
|
|
14747
|
+
if (!user) {
|
|
14748
|
+
return;
|
|
14749
|
+
}
|
|
14750
|
+
project = user;
|
|
14751
|
+
user = null;
|
|
14752
|
+
}
|
|
14753
|
+
if (project.endsWith(".git")) {
|
|
14754
|
+
project = project.slice(0, -4);
|
|
14755
|
+
}
|
|
14756
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14757
|
+
},
|
|
14758
|
+
hashformat: function(fragment) {
|
|
14759
|
+
return fragment && "file-" + formatHashFragment(fragment);
|
|
14760
|
+
}
|
|
14761
|
+
};
|
|
14762
|
+
hosts.sourcehut = {
|
|
14763
|
+
protocols: ["git+ssh:", "https:"],
|
|
14764
|
+
domain: "git.sr.ht",
|
|
14765
|
+
treepath: "tree",
|
|
14766
|
+
blobpath: "tree",
|
|
14767
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path26}`,
|
|
14768
|
+
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}${maybeJoin("#", committish)}`,
|
|
14769
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
14770
|
+
bugstemplate: () => null,
|
|
14771
|
+
extract: (url) => {
|
|
14772
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14773
|
+
if (["archive"].includes(aux)) {
|
|
14774
|
+
return;
|
|
14775
|
+
}
|
|
14776
|
+
if (project && project.endsWith(".git")) {
|
|
14777
|
+
project = project.slice(0, -4);
|
|
14778
|
+
}
|
|
14779
|
+
if (!user || !project) {
|
|
14780
|
+
return;
|
|
14781
|
+
}
|
|
14782
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14783
|
+
}
|
|
14784
|
+
};
|
|
14785
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
14786
|
+
hosts[name] = Object.assign({}, defaults2, host);
|
|
14787
|
+
}
|
|
14788
|
+
module.exports = hosts;
|
|
14789
|
+
}
|
|
14790
|
+
});
|
|
14791
|
+
|
|
14792
|
+
// node_modules/hosted-git-info/lib/parse-url.js
|
|
14793
|
+
var require_parse_url2 = __commonJS({
|
|
14794
|
+
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
14795
|
+
var url = __require("url");
|
|
14796
|
+
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
14797
|
+
const startPosition = str2.indexOf(beforeChar);
|
|
14798
|
+
return str2.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
14799
|
+
};
|
|
14800
|
+
var safeUrl = (u2) => {
|
|
14801
|
+
try {
|
|
14802
|
+
return new url.URL(u2);
|
|
14803
|
+
} catch {
|
|
14804
|
+
}
|
|
14805
|
+
};
|
|
14806
|
+
var correctProtocol = (arg, protocols) => {
|
|
14807
|
+
const firstColon = arg.indexOf(":");
|
|
14808
|
+
const proto = arg.slice(0, firstColon + 1);
|
|
14809
|
+
if (Object.prototype.hasOwnProperty.call(protocols, proto)) {
|
|
14810
|
+
return arg;
|
|
14811
|
+
}
|
|
14812
|
+
if (arg.substr(firstColon, 3) === "://") {
|
|
14813
|
+
return arg;
|
|
14814
|
+
}
|
|
14815
|
+
const firstAt = arg.indexOf("@");
|
|
14816
|
+
if (firstAt > -1) {
|
|
14817
|
+
if (firstAt > firstColon) {
|
|
14818
|
+
return `git+ssh://${arg}`;
|
|
14819
|
+
} else {
|
|
14820
|
+
return arg;
|
|
14821
|
+
}
|
|
14822
|
+
}
|
|
14823
|
+
return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
|
|
14824
|
+
};
|
|
14825
|
+
var correctUrl = (giturl) => {
|
|
14826
|
+
const firstAt = lastIndexOfBefore(giturl, "@", "#");
|
|
14827
|
+
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
|
|
14828
|
+
if (lastColonBeforeHash > firstAt) {
|
|
14829
|
+
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
|
|
14830
|
+
}
|
|
14831
|
+
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
|
|
14832
|
+
giturl = `git+ssh://${giturl}`;
|
|
14833
|
+
}
|
|
14834
|
+
return giturl;
|
|
14835
|
+
};
|
|
14836
|
+
module.exports = (giturl, protocols) => {
|
|
14837
|
+
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
|
|
14838
|
+
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
|
|
14839
|
+
};
|
|
14840
|
+
}
|
|
14841
|
+
});
|
|
14842
|
+
|
|
14843
|
+
// node_modules/hosted-git-info/lib/from-url.js
|
|
14844
|
+
var require_from_url2 = __commonJS({
|
|
14845
|
+
"node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
14846
|
+
"use strict";
|
|
14847
|
+
var parseUrl = require_parse_url2();
|
|
14848
|
+
var isGitHubShorthand = (arg) => {
|
|
14849
|
+
const firstHash = arg.indexOf("#");
|
|
14850
|
+
const firstSlash = arg.indexOf("/");
|
|
14851
|
+
const secondSlash = arg.indexOf("/", firstSlash + 1);
|
|
14852
|
+
const firstColon = arg.indexOf(":");
|
|
14853
|
+
const firstSpace = /\s/.exec(arg);
|
|
14854
|
+
const firstAt = arg.indexOf("@");
|
|
14855
|
+
const spaceOnlyAfterHash = !firstSpace || firstHash > -1 && firstSpace.index > firstHash;
|
|
14856
|
+
const atOnlyAfterHash = firstAt === -1 || firstHash > -1 && firstAt > firstHash;
|
|
14857
|
+
const colonOnlyAfterHash = firstColon === -1 || firstHash > -1 && firstColon > firstHash;
|
|
14858
|
+
const secondSlashOnlyAfterHash = secondSlash === -1 || firstHash > -1 && secondSlash > firstHash;
|
|
14859
|
+
const hasSlash = firstSlash > 0;
|
|
14860
|
+
const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== "/" : !arg.endsWith("/");
|
|
14861
|
+
const doesNotStartWithDot = !arg.startsWith(".");
|
|
14862
|
+
return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash;
|
|
14863
|
+
};
|
|
14864
|
+
module.exports = (giturl, opts, { gitHosts, protocols }) => {
|
|
14865
|
+
if (!giturl) {
|
|
14866
|
+
return;
|
|
14867
|
+
}
|
|
14868
|
+
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
|
|
14869
|
+
const parsed = parseUrl(correctedUrl, protocols);
|
|
14870
|
+
if (!parsed) {
|
|
14871
|
+
return;
|
|
14872
|
+
}
|
|
14873
|
+
const gitHostShortcut = gitHosts.byShortcut[parsed.protocol];
|
|
14874
|
+
const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname];
|
|
14875
|
+
const gitHostName = gitHostShortcut || gitHostDomain;
|
|
14876
|
+
if (!gitHostName) {
|
|
14877
|
+
return;
|
|
14878
|
+
}
|
|
14879
|
+
const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain];
|
|
14880
|
+
let auth = null;
|
|
14881
|
+
if (protocols[parsed.protocol]?.auth && (parsed.username || parsed.password)) {
|
|
14882
|
+
auth = `${parsed.username}${parsed.password ? ":" + parsed.password : ""}`;
|
|
14883
|
+
}
|
|
14884
|
+
let committish = null;
|
|
14885
|
+
let user = null;
|
|
14886
|
+
let project = null;
|
|
14887
|
+
let defaultRepresentation = null;
|
|
14888
|
+
try {
|
|
14889
|
+
if (gitHostShortcut) {
|
|
14890
|
+
let pathname = parsed.pathname.startsWith("/") ? parsed.pathname.slice(1) : parsed.pathname;
|
|
14891
|
+
const firstAt = pathname.indexOf("@");
|
|
14892
|
+
if (firstAt > -1) {
|
|
14893
|
+
pathname = pathname.slice(firstAt + 1);
|
|
14894
|
+
}
|
|
14895
|
+
const lastSlash = pathname.lastIndexOf("/");
|
|
14896
|
+
if (lastSlash > -1) {
|
|
14897
|
+
user = decodeURIComponent(pathname.slice(0, lastSlash));
|
|
14898
|
+
if (!user) {
|
|
14899
|
+
user = null;
|
|
14900
|
+
}
|
|
14901
|
+
project = decodeURIComponent(pathname.slice(lastSlash + 1));
|
|
14902
|
+
} else {
|
|
14903
|
+
project = decodeURIComponent(pathname);
|
|
14904
|
+
}
|
|
14905
|
+
if (project.endsWith(".git")) {
|
|
14906
|
+
project = project.slice(0, -4);
|
|
14907
|
+
}
|
|
14908
|
+
if (parsed.hash) {
|
|
14909
|
+
committish = decodeURIComponent(parsed.hash.slice(1));
|
|
14910
|
+
}
|
|
14911
|
+
defaultRepresentation = "shortcut";
|
|
14912
|
+
} else {
|
|
14913
|
+
if (!gitHostInfo.protocols.includes(parsed.protocol)) {
|
|
14914
|
+
return;
|
|
14915
|
+
}
|
|
14916
|
+
const segments = gitHostInfo.extract(parsed);
|
|
14917
|
+
if (!segments) {
|
|
14918
|
+
return;
|
|
14919
|
+
}
|
|
14920
|
+
user = segments.user && decodeURIComponent(segments.user);
|
|
14921
|
+
project = decodeURIComponent(segments.project);
|
|
14922
|
+
committish = decodeURIComponent(segments.committish);
|
|
14923
|
+
defaultRepresentation = protocols[parsed.protocol]?.name || parsed.protocol.slice(0, -1);
|
|
14924
|
+
}
|
|
14925
|
+
} catch (err) {
|
|
14926
|
+
if (err instanceof URIError) {
|
|
14927
|
+
return;
|
|
14928
|
+
} else {
|
|
14929
|
+
throw err;
|
|
14930
|
+
}
|
|
14931
|
+
}
|
|
14932
|
+
return [gitHostName, user, auth, project, committish, defaultRepresentation, opts];
|
|
14933
|
+
};
|
|
14934
|
+
}
|
|
14935
|
+
});
|
|
14936
|
+
|
|
14937
|
+
// node_modules/hosted-git-info/lib/index.js
|
|
14938
|
+
var require_lib6 = __commonJS({
|
|
14939
|
+
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
14940
|
+
"use strict";
|
|
14941
|
+
var { LRUCache } = require_index_min2();
|
|
14942
|
+
var hosts = require_hosts2();
|
|
14943
|
+
var fromUrl = require_from_url2();
|
|
14944
|
+
var parseUrl = require_parse_url2();
|
|
14945
|
+
var cache2 = new LRUCache({ max: 1e3 });
|
|
14946
|
+
function unknownHostedUrl(url) {
|
|
14947
|
+
try {
|
|
14948
|
+
const {
|
|
14949
|
+
protocol,
|
|
14950
|
+
hostname,
|
|
14951
|
+
pathname
|
|
14952
|
+
} = new URL(url);
|
|
14953
|
+
if (!hostname) {
|
|
14954
|
+
return null;
|
|
14955
|
+
}
|
|
14956
|
+
const proto = /(?:git\+)http:$/.test(protocol) ? "http:" : "https:";
|
|
14957
|
+
const path26 = pathname.replace(/\.git$/, "");
|
|
14958
|
+
return `${proto}//${hostname}${path26}`;
|
|
14959
|
+
} catch {
|
|
14960
|
+
return null;
|
|
14961
|
+
}
|
|
14962
|
+
}
|
|
14963
|
+
var GitHost = class _GitHost {
|
|
14964
|
+
constructor(type2, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
14965
|
+
Object.assign(this, _GitHost.#gitHosts[type2], {
|
|
14966
|
+
type: type2,
|
|
14967
|
+
user,
|
|
14968
|
+
auth,
|
|
14969
|
+
project,
|
|
14970
|
+
committish,
|
|
14971
|
+
default: defaultRepresentation,
|
|
14972
|
+
opts
|
|
14973
|
+
});
|
|
14974
|
+
}
|
|
14975
|
+
static #gitHosts = { byShortcut: {}, byDomain: {} };
|
|
14976
|
+
static #protocols = {
|
|
14977
|
+
"git+ssh:": { name: "sshurl" },
|
|
14978
|
+
"ssh:": { name: "sshurl" },
|
|
14979
|
+
"git+https:": { name: "https", auth: true },
|
|
14980
|
+
"git:": { auth: true },
|
|
14981
|
+
"http:": { auth: true },
|
|
14982
|
+
"https:": { auth: true },
|
|
14983
|
+
"git+http:": { auth: true }
|
|
14984
|
+
};
|
|
14985
|
+
static addHost(name, host) {
|
|
14986
|
+
_GitHost.#gitHosts[name] = host;
|
|
14987
|
+
_GitHost.#gitHosts.byDomain[host.domain] = name;
|
|
14988
|
+
_GitHost.#gitHosts.byShortcut[`${name}:`] = name;
|
|
14989
|
+
_GitHost.#protocols[`${name}:`] = { name };
|
|
14990
|
+
}
|
|
14991
|
+
static fromUrl(giturl, opts) {
|
|
14992
|
+
if (typeof giturl !== "string") {
|
|
14993
|
+
return;
|
|
14994
|
+
}
|
|
14995
|
+
const key = giturl + JSON.stringify(opts || {});
|
|
14996
|
+
if (!cache2.has(key)) {
|
|
14997
|
+
const hostArgs = fromUrl(giturl, opts, {
|
|
14998
|
+
gitHosts: _GitHost.#gitHosts,
|
|
14999
|
+
protocols: _GitHost.#protocols
|
|
15000
|
+
});
|
|
15001
|
+
cache2.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0);
|
|
13814
15002
|
}
|
|
15003
|
+
return cache2.get(key);
|
|
13815
15004
|
}
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
if (
|
|
13823
|
-
|
|
13824
|
-
|
|
13825
|
-
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
if (checked !== null) {
|
|
13829
|
-
return checked;
|
|
13830
|
-
}
|
|
15005
|
+
static fromManifest(manifest, opts = {}) {
|
|
15006
|
+
if (!manifest || typeof manifest !== "object") {
|
|
15007
|
+
return;
|
|
15008
|
+
}
|
|
15009
|
+
const r = manifest.repository;
|
|
15010
|
+
const rurl = r && (typeof r === "string" ? r : typeof r === "object" && typeof r.url === "string" ? r.url : null);
|
|
15011
|
+
if (!rurl) {
|
|
15012
|
+
throw new Error("no repository");
|
|
15013
|
+
}
|
|
15014
|
+
const info = rurl && _GitHost.fromUrl(rurl.replace(/^git\+/, ""), opts) || null;
|
|
15015
|
+
if (info) {
|
|
15016
|
+
return info;
|
|
13831
15017
|
}
|
|
15018
|
+
const unk = unknownHostedUrl(rurl);
|
|
15019
|
+
return _GitHost.fromUrl(unk, opts) || unk;
|
|
13832
15020
|
}
|
|
13833
|
-
|
|
13834
|
-
|
|
13835
|
-
module.exports = function(identifier, options) {
|
|
13836
|
-
options = options || {};
|
|
13837
|
-
var upgrade = options.upgrade === void 0 ? true : !!options.upgrade;
|
|
13838
|
-
function postprocess(value) {
|
|
13839
|
-
return upgrade ? upgradeGPLs(value) : value;
|
|
15021
|
+
static parseUrl(url) {
|
|
15022
|
+
return parseUrl(url);
|
|
13840
15023
|
}
|
|
13841
|
-
|
|
13842
|
-
|
|
13843
|
-
|
|
15024
|
+
#fill(template, opts) {
|
|
15025
|
+
if (typeof template !== "function") {
|
|
15026
|
+
return null;
|
|
15027
|
+
}
|
|
15028
|
+
const options = { ...this, ...this.opts, ...opts };
|
|
15029
|
+
if (!options.path) {
|
|
15030
|
+
options.path = "";
|
|
15031
|
+
}
|
|
15032
|
+
if (options.path.startsWith("/")) {
|
|
15033
|
+
options.path = options.path.slice(1);
|
|
15034
|
+
}
|
|
15035
|
+
if (options.noCommittish) {
|
|
15036
|
+
options.committish = null;
|
|
15037
|
+
}
|
|
15038
|
+
const result = template(options);
|
|
15039
|
+
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
13844
15040
|
}
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
return postprocess(identifier);
|
|
15041
|
+
hash() {
|
|
15042
|
+
return this.committish ? `#${this.committish}` : "";
|
|
13848
15043
|
}
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
return postprocess(noPlus);
|
|
15044
|
+
ssh(opts) {
|
|
15045
|
+
return this.#fill(this.sshtemplate, opts);
|
|
13852
15046
|
}
|
|
13853
|
-
|
|
13854
|
-
|
|
13855
|
-
return postprocess(transformed);
|
|
15047
|
+
sshurl(opts) {
|
|
15048
|
+
return this.#fill(this.sshurltemplate, opts);
|
|
13856
15049
|
}
|
|
13857
|
-
|
|
13858
|
-
if (
|
|
13859
|
-
return
|
|
15050
|
+
browse(path26, ...args) {
|
|
15051
|
+
if (typeof path26 !== "string") {
|
|
15052
|
+
return this.#fill(this.browsetemplate, path26);
|
|
13860
15053
|
}
|
|
13861
|
-
|
|
13862
|
-
|
|
13863
|
-
|
|
13864
|
-
return
|
|
15054
|
+
if (typeof args[0] !== "string") {
|
|
15055
|
+
return this.#fill(this.browsetreetemplate, { ...args[0], path: path26 });
|
|
15056
|
+
}
|
|
15057
|
+
return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
13865
15058
|
}
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
15059
|
+
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
15060
|
+
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
15061
|
+
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
15062
|
+
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
15063
|
+
// does not redirect to a different commit.
|
|
15064
|
+
browseFile(path26, ...args) {
|
|
15065
|
+
if (typeof args[0] !== "string") {
|
|
15066
|
+
return this.#fill(this.browseblobtemplate, { ...args[0], path: path26 });
|
|
15067
|
+
}
|
|
15068
|
+
return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
13869
15069
|
}
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
return postprocess(transformed);
|
|
15070
|
+
docs(opts) {
|
|
15071
|
+
return this.#fill(this.docstemplate, opts);
|
|
13873
15072
|
}
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
function upgradeGPLs(value) {
|
|
13877
|
-
if ([
|
|
13878
|
-
"GPL-1.0",
|
|
13879
|
-
"LGPL-1.0",
|
|
13880
|
-
"AGPL-1.0",
|
|
13881
|
-
"GPL-2.0",
|
|
13882
|
-
"LGPL-2.0",
|
|
13883
|
-
"AGPL-2.0",
|
|
13884
|
-
"LGPL-2.1"
|
|
13885
|
-
].indexOf(value) !== -1) {
|
|
13886
|
-
return value + "-only";
|
|
13887
|
-
} else if ([
|
|
13888
|
-
"GPL-1.0+",
|
|
13889
|
-
"GPL-2.0+",
|
|
13890
|
-
"GPL-3.0+",
|
|
13891
|
-
"LGPL-2.0+",
|
|
13892
|
-
"LGPL-2.1+",
|
|
13893
|
-
"LGPL-3.0+",
|
|
13894
|
-
"AGPL-1.0+",
|
|
13895
|
-
"AGPL-3.0+"
|
|
13896
|
-
].indexOf(value) !== -1) {
|
|
13897
|
-
return value.replace(/\+$/, "-or-later");
|
|
13898
|
-
} else if (["GPL-3.0", "LGPL-3.0", "AGPL-3.0"].indexOf(value) !== -1) {
|
|
13899
|
-
return value + "-or-later";
|
|
13900
|
-
} else {
|
|
13901
|
-
return value;
|
|
15073
|
+
bugs(opts) {
|
|
15074
|
+
return this.#fill(this.bugstemplate, opts);
|
|
13902
15075
|
}
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
});
|
|
13906
|
-
|
|
13907
|
-
// node_modules/validate-npm-package-license/index.js
|
|
13908
|
-
var require_validate_npm_package_license = __commonJS({
|
|
13909
|
-
"node_modules/validate-npm-package-license/index.js"(exports, module) {
|
|
13910
|
-
var parse2 = require_spdx_expression_parse();
|
|
13911
|
-
var correct = require_spdx_correct();
|
|
13912
|
-
var genericWarning = 'license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"';
|
|
13913
|
-
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
13914
|
-
function startsWith(prefix, string) {
|
|
13915
|
-
return string.slice(0, prefix.length) === prefix;
|
|
13916
|
-
}
|
|
13917
|
-
function usesLicenseRef(ast) {
|
|
13918
|
-
if (ast.hasOwnProperty("license")) {
|
|
13919
|
-
var license = ast.license;
|
|
13920
|
-
return startsWith("LicenseRef", license) || startsWith("DocumentRef", license);
|
|
13921
|
-
} else {
|
|
13922
|
-
return usesLicenseRef(ast.left) || usesLicenseRef(ast.right);
|
|
15076
|
+
https(opts) {
|
|
15077
|
+
return this.#fill(this.httpstemplate, opts);
|
|
13923
15078
|
}
|
|
13924
|
-
|
|
13925
|
-
|
|
13926
|
-
var ast;
|
|
13927
|
-
try {
|
|
13928
|
-
ast = parse2(argument);
|
|
13929
|
-
} catch (e) {
|
|
13930
|
-
var match2;
|
|
13931
|
-
if (argument === "UNLICENSED" || argument === "UNLICENCED") {
|
|
13932
|
-
return {
|
|
13933
|
-
validForOldPackages: true,
|
|
13934
|
-
validForNewPackages: true,
|
|
13935
|
-
unlicensed: true
|
|
13936
|
-
};
|
|
13937
|
-
} else if (match2 = fileReferenceRE.exec(argument)) {
|
|
13938
|
-
return {
|
|
13939
|
-
validForOldPackages: true,
|
|
13940
|
-
validForNewPackages: true,
|
|
13941
|
-
inFile: match2[1]
|
|
13942
|
-
};
|
|
13943
|
-
} else {
|
|
13944
|
-
var result = {
|
|
13945
|
-
validForOldPackages: false,
|
|
13946
|
-
validForNewPackages: false,
|
|
13947
|
-
warnings: [genericWarning]
|
|
13948
|
-
};
|
|
13949
|
-
if (argument.trim().length !== 0) {
|
|
13950
|
-
var corrected = correct(argument);
|
|
13951
|
-
if (corrected) {
|
|
13952
|
-
result.warnings.push(
|
|
13953
|
-
'license is similar to the valid expression "' + corrected + '"'
|
|
13954
|
-
);
|
|
13955
|
-
}
|
|
13956
|
-
}
|
|
13957
|
-
return result;
|
|
13958
|
-
}
|
|
15079
|
+
git(opts) {
|
|
15080
|
+
return this.#fill(this.gittemplate, opts);
|
|
13959
15081
|
}
|
|
13960
|
-
|
|
13961
|
-
return
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
15082
|
+
shortcut(opts) {
|
|
15083
|
+
return this.#fill(this.shortcuttemplate, opts);
|
|
15084
|
+
}
|
|
15085
|
+
path(opts) {
|
|
15086
|
+
return this.#fill(this.pathtemplate, opts);
|
|
15087
|
+
}
|
|
15088
|
+
tarball(opts) {
|
|
15089
|
+
return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false });
|
|
15090
|
+
}
|
|
15091
|
+
file(path26, opts) {
|
|
15092
|
+
return this.#fill(this.filetemplate, { ...opts, path: path26 });
|
|
15093
|
+
}
|
|
15094
|
+
edit(path26, opts) {
|
|
15095
|
+
return this.#fill(this.edittemplate, { ...opts, path: path26 });
|
|
15096
|
+
}
|
|
15097
|
+
getDefaultRepresentation() {
|
|
15098
|
+
return this.default;
|
|
15099
|
+
}
|
|
15100
|
+
toString(opts) {
|
|
15101
|
+
if (this.default && typeof this[this.default] === "function") {
|
|
15102
|
+
return this[this.default](opts);
|
|
15103
|
+
}
|
|
15104
|
+
return this.sshurl(opts);
|
|
13973
15105
|
}
|
|
13974
15106
|
};
|
|
15107
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
15108
|
+
GitHost.addHost(name, host);
|
|
15109
|
+
}
|
|
15110
|
+
module.exports = GitHost;
|
|
13975
15111
|
}
|
|
13976
15112
|
});
|
|
13977
15113
|
|
|
@@ -14039,7 +15175,7 @@ var require_fixer = __commonJS({
|
|
|
14039
15175
|
var isValidSemver = require_valid();
|
|
14040
15176
|
var cleanSemver = require_clean();
|
|
14041
15177
|
var validateLicense = require_validate_npm_package_license();
|
|
14042
|
-
var hostedGitInfo =
|
|
15178
|
+
var hostedGitInfo = require_lib6();
|
|
14043
15179
|
var { isBuiltin } = __require("node:module");
|
|
14044
15180
|
var depTypes = ["dependencies", "devDependencies", "optionalDependencies"];
|
|
14045
15181
|
var extractDescription = require_extract_description();
|
|
@@ -25996,7 +27132,7 @@ function expand_(str2, max, isTop) {
|
|
|
25996
27132
|
}
|
|
25997
27133
|
const pad = n2.some(isPadded);
|
|
25998
27134
|
N = [];
|
|
25999
|
-
for (let i2 = x; test(i2, y); i2 += incr) {
|
|
27135
|
+
for (let i2 = x; test(i2, y) && N.length < max; i2 += incr) {
|
|
26000
27136
|
let c3;
|
|
26001
27137
|
if (isAlphaSequence) {
|
|
26002
27138
|
c3 = String.fromCharCode(i2);
|
|
@@ -28352,6 +29488,9 @@ var getCustomProtocol = (urlString) => {
|
|
|
28352
29488
|
try {
|
|
28353
29489
|
const { protocol } = new URL(urlString);
|
|
28354
29490
|
const hasAuthority = urlString.slice(0, protocol.length + 2).toLowerCase() === `${protocol}//`;
|
|
29491
|
+
if (protocol === "localhost:" && !hasAuthority && /^\d{1,5}([/?#]|$)/.test(urlString.slice(protocol.length))) {
|
|
29492
|
+
return void 0;
|
|
29493
|
+
}
|
|
28355
29494
|
if (protocol.endsWith(":") && (!protocol.includes(".") || hasAuthority) && !supportedProtocols.has(protocol)) {
|
|
28356
29495
|
return protocol;
|
|
28357
29496
|
}
|