semantic-release-lerna 3.0.1 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1479 -380
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1516,6 +1516,7 @@ var require_range = __commonJS({
|
|
|
1516
1516
|
return this.range;
|
|
1517
1517
|
}
|
|
1518
1518
|
parseRange(range2) {
|
|
1519
|
+
range2 = range2.replace(BUILDSTRIPRE, "");
|
|
1519
1520
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
1520
1521
|
const memoKey = memoOpts + ":" + range2;
|
|
1521
1522
|
const cached = cache2.get(memoKey);
|
|
@@ -1598,12 +1599,14 @@ var require_range = __commonJS({
|
|
|
1598
1599
|
var SemVer = require_semver();
|
|
1599
1600
|
var {
|
|
1600
1601
|
safeRe: re,
|
|
1602
|
+
src,
|
|
1601
1603
|
t,
|
|
1602
1604
|
comparatorTrimReplace,
|
|
1603
1605
|
tildeTrimReplace,
|
|
1604
1606
|
caretTrimReplace
|
|
1605
1607
|
} = require_re();
|
|
1606
1608
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1609
|
+
var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
1607
1610
|
var isNullSet = (c3) => c3.value === "<0.0.0-0";
|
|
1608
1611
|
var isAny = (c3) => c3.value === "";
|
|
1609
1612
|
var isSatisfiable = (comparators, options) => {
|
|
@@ -2359,7 +2362,7 @@ var require_subset = __commonJS({
|
|
|
2359
2362
|
if (higher === c3 && higher !== gt) {
|
|
2360
2363
|
return false;
|
|
2361
2364
|
}
|
|
2362
|
-
} else if (gt.operator === ">=" && !
|
|
2365
|
+
} else if (gt.operator === ">=" && !c3.test(gt.semver)) {
|
|
2363
2366
|
return false;
|
|
2364
2367
|
}
|
|
2365
2368
|
}
|
|
@@ -2374,7 +2377,7 @@ var require_subset = __commonJS({
|
|
|
2374
2377
|
if (lower === c3 && lower !== lt) {
|
|
2375
2378
|
return false;
|
|
2376
2379
|
}
|
|
2377
|
-
} else if (lt.operator === "<=" && !
|
|
2380
|
+
} else if (lt.operator === "<=" && !c3.test(lt.semver)) {
|
|
2378
2381
|
return false;
|
|
2379
2382
|
}
|
|
2380
2383
|
}
|
|
@@ -2508,38 +2511,38 @@ var require_semver2 = __commonJS({
|
|
|
2508
2511
|
}
|
|
2509
2512
|
});
|
|
2510
2513
|
|
|
2511
|
-
// node_modules/
|
|
2514
|
+
// node_modules/npm-package-arg/node_modules/lru-cache/dist/commonjs/node/index.min.js
|
|
2512
2515
|
var require_index_min = __commonJS({
|
|
2513
|
-
"node_modules/
|
|
2516
|
+
"node_modules/npm-package-arg/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
|
|
2514
2517
|
"use strict";
|
|
2515
|
-
var
|
|
2516
|
-
var
|
|
2518
|
+
var j = (c3, t) => () => (t || c3((t = { exports: {} }).exports, t), t.exports);
|
|
2519
|
+
var I = j((O) => {
|
|
2517
2520
|
"use strict";
|
|
2518
2521
|
Object.defineProperty(O, "__esModule", { value: true });
|
|
2519
2522
|
O.tracing = O.metrics = void 0;
|
|
2520
|
-
var
|
|
2521
|
-
O.metrics = (0,
|
|
2522
|
-
O.tracing = (0,
|
|
2523
|
+
var U = __require("node:diagnostics_channel");
|
|
2524
|
+
O.metrics = (0, U.channel)("lru-cache:metrics");
|
|
2525
|
+
O.tracing = (0, U.tracingChannel)("lru-cache");
|
|
2523
2526
|
});
|
|
2524
|
-
var
|
|
2527
|
+
var P = j((D) => {
|
|
2525
2528
|
"use strict";
|
|
2526
|
-
Object.defineProperty(
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
+
Object.defineProperty(D, "__esModule", { value: true });
|
|
2530
|
+
D.defaultPerf = void 0;
|
|
2531
|
+
D.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
2529
2532
|
});
|
|
2530
2533
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2531
2534
|
exports.LRUCache = void 0;
|
|
2532
|
-
var
|
|
2533
|
-
var N =
|
|
2534
|
-
var C = () =>
|
|
2535
|
-
var
|
|
2536
|
-
var
|
|
2537
|
-
var
|
|
2538
|
-
typeof
|
|
2539
|
-
};
|
|
2540
|
-
var q = (c3) => !
|
|
2541
|
-
var
|
|
2542
|
-
var H = (c3) =>
|
|
2535
|
+
var g = I();
|
|
2536
|
+
var N = P();
|
|
2537
|
+
var C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers;
|
|
2538
|
+
var k = /* @__PURE__ */ new Set();
|
|
2539
|
+
var G = typeof process == "object" && process ? process : {};
|
|
2540
|
+
var V = (c3, t, e, i2) => {
|
|
2541
|
+
typeof G.emitWarning == "function" ? G.emitWarning(c3, t, e, i2) : console.error(`[${e}] ${t}: ${c3}`);
|
|
2542
|
+
};
|
|
2543
|
+
var q = (c3) => !k.has(c3);
|
|
2544
|
+
var T = (c3) => !!c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
|
|
2545
|
+
var H = (c3) => T(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;
|
|
2543
2546
|
var W = class extends Array {
|
|
2544
2547
|
constructor(t) {
|
|
2545
2548
|
super(t), this.fill(0);
|
|
@@ -2571,13 +2574,13 @@ var require_index_min = __commonJS({
|
|
|
2571
2574
|
#o;
|
|
2572
2575
|
#c;
|
|
2573
2576
|
#m;
|
|
2574
|
-
#
|
|
2575
|
-
#
|
|
2577
|
+
#W;
|
|
2578
|
+
#S;
|
|
2576
2579
|
#M;
|
|
2577
2580
|
#j;
|
|
2578
|
-
#
|
|
2581
|
+
#w;
|
|
2579
2582
|
get perf() {
|
|
2580
|
-
return this.#
|
|
2583
|
+
return this.#w;
|
|
2581
2584
|
}
|
|
2582
2585
|
ttl;
|
|
2583
2586
|
ttlResolution;
|
|
@@ -2594,6 +2597,7 @@ var require_index_min = __commonJS({
|
|
|
2594
2597
|
allowStaleOnFetchAbort;
|
|
2595
2598
|
allowStaleOnFetchRejection;
|
|
2596
2599
|
ignoreFetchAbort;
|
|
2600
|
+
backgroundFetchSize;
|
|
2597
2601
|
#n;
|
|
2598
2602
|
#b;
|
|
2599
2603
|
#s;
|
|
@@ -2610,15 +2614,15 @@ var require_index_min = __commonJS({
|
|
|
2610
2614
|
#d;
|
|
2611
2615
|
#g;
|
|
2612
2616
|
#T;
|
|
2613
|
-
#O;
|
|
2614
|
-
#f;
|
|
2615
2617
|
#U;
|
|
2618
|
+
#f;
|
|
2619
|
+
#D;
|
|
2616
2620
|
static unsafeExposeInternals(t) {
|
|
2617
2621
|
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() {
|
|
2618
2622
|
return t.#a;
|
|
2619
2623
|
}, get tail() {
|
|
2620
2624
|
return t.#h;
|
|
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.#
|
|
2625
|
+
}, 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.#z(e), isStale: (e) => t.#p(e) };
|
|
2622
2626
|
}
|
|
2623
2627
|
get max() {
|
|
2624
2628
|
return this.#o;
|
|
@@ -2642,106 +2646,108 @@ var require_index_min = __commonJS({
|
|
|
2642
2646
|
return this.#m;
|
|
2643
2647
|
}
|
|
2644
2648
|
get onInsert() {
|
|
2645
|
-
return this.#
|
|
2649
|
+
return this.#W;
|
|
2646
2650
|
}
|
|
2647
2651
|
get disposeAfter() {
|
|
2648
|
-
return this.#
|
|
2652
|
+
return this.#S;
|
|
2649
2653
|
}
|
|
2650
2654
|
constructor(t) {
|
|
2651
|
-
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n2, updateAgeOnGet:
|
|
2652
|
-
if (
|
|
2653
|
-
if (this.#
|
|
2654
|
-
let
|
|
2655
|
-
if (!
|
|
2656
|
-
if (this.#o = e, this.#c =
|
|
2655
|
+
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n2, updateAgeOnGet: r, updateAgeOnHas: h2, allowStale: a2, dispose: o2, onInsert: d, disposeAfter: _, noDisposeOnSet: y, noUpdateTTL: u2, maxSize: p = 0, maxEntrySize: f = 0, sizeCalculation: b, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: w, allowStaleOnFetchRejection: m, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: M = 1, perf: v } = t;
|
|
2656
|
+
if (this.backgroundFetchSize = M, v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
2657
|
+
if (this.#w = v ?? N.defaultPerf, e !== 0 && !T(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
2658
|
+
let E = e ? H(e) : Array;
|
|
2659
|
+
if (!E) throw new Error("invalid max value: " + e);
|
|
2660
|
+
if (this.#o = e, this.#c = p, this.maxEntrySize = f || this.#c, this.sizeCalculation = b, this.sizeCalculation) {
|
|
2657
2661
|
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
2658
2662
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
2659
2663
|
}
|
|
2660
2664
|
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
2661
2665
|
if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
2662
|
-
if (this.#M = l, this.#
|
|
2663
|
-
if (this.#c !== 0 && !
|
|
2664
|
-
if (!
|
|
2666
|
+
if (this.#M = l, this.#U = !!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 E(e), this.#u = new E(e), this.#a = 0, this.#h = 0, this.#_ = x.create(e), this.#n = 0, this.#b = 0, typeof o2 == "function" && (this.#m = o2), typeof d == "function" && (this.#W = d), typeof _ == "function" ? (this.#S = _, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#m, this.#D = !!this.#W, this.#f = !!this.#S, this.noDisposeOnSet = !!y, this.noUpdateTTL = !!u2, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!m, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
2667
|
+
if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
2668
|
+
if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
2665
2669
|
this.#X();
|
|
2666
2670
|
}
|
|
2667
|
-
if (this.allowStale = !!
|
|
2668
|
-
if (!
|
|
2669
|
-
this.#
|
|
2671
|
+
if (this.allowStale = !!a2, this.noDeleteOnStaleGet = !!w, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!h2, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n2, this.ttl = i2 || 0, this.ttl) {
|
|
2672
|
+
if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
2673
|
+
this.#k();
|
|
2670
2674
|
}
|
|
2671
2675
|
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
2672
2676
|
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
2673
|
-
let
|
|
2674
|
-
q(
|
|
2677
|
+
let R = "LRU_CACHE_UNBOUNDED";
|
|
2678
|
+
q(R) && (k.add(R), V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", R, c3));
|
|
2675
2679
|
}
|
|
2676
2680
|
}
|
|
2677
2681
|
getRemainingTTL(t) {
|
|
2678
2682
|
return this.#s.has(t) ? 1 / 0 : 0;
|
|
2679
2683
|
}
|
|
2680
|
-
#
|
|
2684
|
+
#k() {
|
|
2681
2685
|
let t = new W(this.#o), e = new W(this.#o);
|
|
2682
2686
|
this.#d = t, this.#F = e;
|
|
2683
2687
|
let i2 = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
2684
|
-
this.#g = i2, this.#
|
|
2685
|
-
e[
|
|
2686
|
-
}, this.#R = (
|
|
2687
|
-
e[
|
|
2688
|
+
this.#g = i2, this.#H = (h2, a2, o2 = this.#w.now()) => {
|
|
2689
|
+
e[h2] = a2 !== 0 ? o2 : 0, t[h2] = a2, s(h2, a2);
|
|
2690
|
+
}, this.#R = (h2) => {
|
|
2691
|
+
e[h2] = t[h2] !== 0 ? this.#w.now() : 0, s(h2, t[h2]);
|
|
2688
2692
|
};
|
|
2689
|
-
let s = this.ttlAutopurge ? (
|
|
2690
|
-
if (i2?.[
|
|
2691
|
-
let
|
|
2692
|
-
this.#p(
|
|
2693
|
-
},
|
|
2694
|
-
|
|
2693
|
+
let s = this.ttlAutopurge ? (h2, a2) => {
|
|
2694
|
+
if (i2?.[h2] && (clearTimeout(i2[h2]), i2[h2] = void 0), a2 && a2 !== 0 && i2) {
|
|
2695
|
+
let o2 = setTimeout(() => {
|
|
2696
|
+
this.#p(h2) && this.#v(this.#i[h2], "expire");
|
|
2697
|
+
}, a2 + 1);
|
|
2698
|
+
o2.unref && o2.unref(), i2[h2] = o2;
|
|
2695
2699
|
}
|
|
2696
2700
|
} : () => {
|
|
2697
2701
|
};
|
|
2698
|
-
this.#E = (
|
|
2699
|
-
if (t[
|
|
2700
|
-
let
|
|
2701
|
-
if (!
|
|
2702
|
-
|
|
2703
|
-
let
|
|
2704
|
-
|
|
2702
|
+
this.#E = (h2, a2) => {
|
|
2703
|
+
if (t[a2]) {
|
|
2704
|
+
let o2 = t[a2], d = e[a2];
|
|
2705
|
+
if (!o2 || !d) return;
|
|
2706
|
+
h2.ttl = o2, h2.start = d, h2.now = n2 || r();
|
|
2707
|
+
let _ = h2.now - d;
|
|
2708
|
+
h2.remainingTTL = o2 - _;
|
|
2705
2709
|
}
|
|
2706
2710
|
};
|
|
2707
|
-
let n2 = 0,
|
|
2708
|
-
let
|
|
2711
|
+
let n2 = 0, r = () => {
|
|
2712
|
+
let h2 = this.#w.now();
|
|
2709
2713
|
if (this.ttlResolution > 0) {
|
|
2710
|
-
n2 =
|
|
2711
|
-
let
|
|
2712
|
-
|
|
2714
|
+
n2 = h2;
|
|
2715
|
+
let a2 = setTimeout(() => n2 = 0, this.ttlResolution);
|
|
2716
|
+
a2.unref && a2.unref();
|
|
2713
2717
|
}
|
|
2714
|
-
return
|
|
2718
|
+
return h2;
|
|
2715
2719
|
};
|
|
2716
|
-
this.getRemainingTTL = (
|
|
2717
|
-
let
|
|
2718
|
-
if (
|
|
2719
|
-
let
|
|
2720
|
-
if (!
|
|
2721
|
-
let
|
|
2722
|
-
return
|
|
2723
|
-
}, this.#p = (
|
|
2724
|
-
let
|
|
2725
|
-
return !!
|
|
2720
|
+
this.getRemainingTTL = (h2) => {
|
|
2721
|
+
let a2 = this.#s.get(h2);
|
|
2722
|
+
if (a2 === void 0) return 0;
|
|
2723
|
+
let o2 = t[a2], d = e[a2];
|
|
2724
|
+
if (!o2 || !d) return 1 / 0;
|
|
2725
|
+
let _ = (n2 || r()) - d;
|
|
2726
|
+
return o2 - _;
|
|
2727
|
+
}, this.#p = (h2) => {
|
|
2728
|
+
let a2 = e[h2], o2 = t[h2];
|
|
2729
|
+
return !!o2 && !!a2 && (n2 || r()) - a2 > o2;
|
|
2726
2730
|
};
|
|
2727
2731
|
}
|
|
2728
2732
|
#R = () => {
|
|
2729
2733
|
};
|
|
2730
2734
|
#E = () => {
|
|
2731
2735
|
};
|
|
2732
|
-
#
|
|
2736
|
+
#H = () => {
|
|
2733
2737
|
};
|
|
2734
2738
|
#p = () => false;
|
|
2735
2739
|
#X() {
|
|
2736
2740
|
let t = new W(this.#o);
|
|
2737
2741
|
this.#b = 0, this.#y = t, this.#C = (e) => {
|
|
2738
2742
|
this.#b -= t[e], t[e] = 0;
|
|
2739
|
-
}, this.#
|
|
2740
|
-
if (
|
|
2741
|
-
|
|
2742
|
-
if (
|
|
2743
|
-
|
|
2744
|
-
|
|
2743
|
+
}, this.#N = (e, i2, s, n2) => {
|
|
2744
|
+
if (!T(s)) {
|
|
2745
|
+
if (this.#e(i2)) return this.backgroundFetchSize;
|
|
2746
|
+
if (n2) {
|
|
2747
|
+
if (typeof n2 != "function") throw new TypeError("sizeCalculation must be a function");
|
|
2748
|
+
if (s = n2(i2, e), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
2749
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
2750
|
+
}
|
|
2745
2751
|
return s;
|
|
2746
2752
|
}, this.#I = (e, i2, s) => {
|
|
2747
2753
|
if (t[e] = i2, this.#c) {
|
|
@@ -2755,24 +2761,24 @@ var require_index_min = __commonJS({
|
|
|
2755
2761
|
};
|
|
2756
2762
|
#I = (t, e, i2) => {
|
|
2757
2763
|
};
|
|
2758
|
-
#
|
|
2764
|
+
#N = (t, e, i2, s) => {
|
|
2759
2765
|
if (i2 || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
2760
2766
|
return 0;
|
|
2761
2767
|
};
|
|
2762
2768
|
*#A({ allowStale: t = this.allowStale } = {}) {
|
|
2763
|
-
if (this.#n) for (let e = this.#h; this.#
|
|
2769
|
+
if (this.#n) for (let e = this.#h; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a); ) e = this.#u[e];
|
|
2764
2770
|
}
|
|
2765
|
-
*#
|
|
2766
|
-
if (this.#n) for (let e = this.#a; this.#
|
|
2771
|
+
*#z({ allowStale: t = this.allowStale } = {}) {
|
|
2772
|
+
if (this.#n) for (let e = this.#a; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h); ) e = this.#l[e];
|
|
2767
2773
|
}
|
|
2768
|
-
#
|
|
2774
|
+
#V(t) {
|
|
2769
2775
|
return t !== void 0 && this.#s.get(this.#i[t]) === t;
|
|
2770
2776
|
}
|
|
2771
2777
|
*entries() {
|
|
2772
2778
|
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]]);
|
|
2773
2779
|
}
|
|
2774
2780
|
*rentries() {
|
|
2775
|
-
for (let t of this.#
|
|
2781
|
+
for (let t of this.#z()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
2776
2782
|
}
|
|
2777
2783
|
*keys() {
|
|
2778
2784
|
for (let t of this.#A()) {
|
|
@@ -2781,7 +2787,7 @@ var require_index_min = __commonJS({
|
|
|
2781
2787
|
}
|
|
2782
2788
|
}
|
|
2783
2789
|
*rkeys() {
|
|
2784
|
-
for (let t of this.#
|
|
2790
|
+
for (let t of this.#z()) {
|
|
2785
2791
|
let e = this.#i[t];
|
|
2786
2792
|
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
2787
2793
|
}
|
|
@@ -2790,7 +2796,7 @@ var require_index_min = __commonJS({
|
|
|
2790
2796
|
for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
2791
2797
|
}
|
|
2792
2798
|
*rvalues() {
|
|
2793
|
-
for (let t of this.#
|
|
2799
|
+
for (let t of this.#z()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
2794
2800
|
}
|
|
2795
2801
|
[Symbol.iterator]() {
|
|
2796
2802
|
return this.entries();
|
|
@@ -2809,14 +2815,14 @@ var require_index_min = __commonJS({
|
|
|
2809
2815
|
}
|
|
2810
2816
|
}
|
|
2811
2817
|
rforEach(t, e = this) {
|
|
2812
|
-
for (let i2 of this.#
|
|
2818
|
+
for (let i2 of this.#z()) {
|
|
2813
2819
|
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
2814
2820
|
n2 !== void 0 && t.call(e, n2, this.#i[i2], this);
|
|
2815
2821
|
}
|
|
2816
2822
|
}
|
|
2817
2823
|
purgeStale() {
|
|
2818
2824
|
let t = false;
|
|
2819
|
-
for (let e of this.#
|
|
2825
|
+
for (let e of this.#z({ allowStale: true })) this.#p(e) && (this.#v(this.#i[e], "expire"), t = true);
|
|
2820
2826
|
return t;
|
|
2821
2827
|
}
|
|
2822
2828
|
info(t) {
|
|
@@ -2826,10 +2832,10 @@ var require_index_min = __commonJS({
|
|
|
2826
2832
|
if (s === void 0) return;
|
|
2827
2833
|
let n2 = { value: s };
|
|
2828
2834
|
if (this.#d && this.#F) {
|
|
2829
|
-
let
|
|
2830
|
-
if (
|
|
2831
|
-
let
|
|
2832
|
-
n2.ttl =
|
|
2835
|
+
let r = this.#d[e], h2 = this.#F[e];
|
|
2836
|
+
if (r && h2) {
|
|
2837
|
+
let a2 = r - (this.#w.now() - h2);
|
|
2838
|
+
n2.ttl = a2, n2.start = Date.now();
|
|
2833
2839
|
}
|
|
2834
2840
|
}
|
|
2835
2841
|
return this.#y && (n2.size = this.#y[e]), n2;
|
|
@@ -2839,13 +2845,13 @@ var require_index_min = __commonJS({
|
|
|
2839
2845
|
for (let e of this.#A({ allowStale: true })) {
|
|
2840
2846
|
let i2 = this.#i[e], s = this.#t[e], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
2841
2847
|
if (n2 === void 0 || i2 === void 0) continue;
|
|
2842
|
-
let
|
|
2848
|
+
let r = { value: n2 };
|
|
2843
2849
|
if (this.#d && this.#F) {
|
|
2844
|
-
|
|
2845
|
-
let
|
|
2846
|
-
|
|
2850
|
+
r.ttl = this.#d[e];
|
|
2851
|
+
let h2 = this.#w.now() - this.#F[e];
|
|
2852
|
+
r.start = Math.floor(Date.now() - h2);
|
|
2847
2853
|
}
|
|
2848
|
-
this.#y && (
|
|
2854
|
+
this.#y && (r.size = this.#y[e]), t.unshift([i2, r]);
|
|
2849
2855
|
}
|
|
2850
2856
|
return t;
|
|
2851
2857
|
}
|
|
@@ -2854,46 +2860,44 @@ var require_index_min = __commonJS({
|
|
|
2854
2860
|
for (let [e, i2] of t) {
|
|
2855
2861
|
if (i2.start) {
|
|
2856
2862
|
let s = Date.now() - i2.start;
|
|
2857
|
-
i2.start = this.#
|
|
2863
|
+
i2.start = this.#w.now() - s;
|
|
2858
2864
|
}
|
|
2859
|
-
this.#
|
|
2865
|
+
this.#O(e, i2.value, i2);
|
|
2860
2866
|
}
|
|
2861
2867
|
}
|
|
2862
2868
|
set(t, e, i2 = {}) {
|
|
2863
|
-
let { status: s =
|
|
2864
|
-
i2.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e));
|
|
2865
|
-
let n2 = this.#
|
|
2866
|
-
return s &&
|
|
2867
|
-
}
|
|
2868
|
-
#
|
|
2869
|
-
let { ttl:
|
|
2870
|
-
if (e === void 0) return
|
|
2871
|
-
let { noUpdateTTL:
|
|
2872
|
-
|
|
2873
|
-
let
|
|
2874
|
-
if (this.maxEntrySize &&
|
|
2875
|
-
let
|
|
2876
|
-
if (
|
|
2869
|
+
let { status: s = g.metrics.hasSubscribers ? {} : void 0 } = i2;
|
|
2870
|
+
i2.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e), s.cache = this);
|
|
2871
|
+
let n2 = this.#O(t, e, i2);
|
|
2872
|
+
return s && g.metrics.hasSubscribers && g.metrics.publish(s), n2;
|
|
2873
|
+
}
|
|
2874
|
+
#O(t, e, i2, s) {
|
|
2875
|
+
let { ttl: n2 = this.ttl, start: r, noDisposeOnSet: h2 = this.noDisposeOnSet, sizeCalculation: a2 = this.sizeCalculation, status: o2 } = i2, d = this.#e(e);
|
|
2876
|
+
if (e === void 0) return o2 && (o2.set = "deleted"), this.delete(t), this;
|
|
2877
|
+
let { noUpdateTTL: _ = this.noUpdateTTL } = i2;
|
|
2878
|
+
o2 && !d && (o2.value = e);
|
|
2879
|
+
let y = this.#N(t, e, i2.size || 0, a2, o2);
|
|
2880
|
+
if (this.maxEntrySize && y > this.maxEntrySize) return this.#v(t, "set"), o2 && (o2.set = "miss", o2.maxEntrySizeExceeded = true), this;
|
|
2881
|
+
let u2 = this.#n === 0 ? void 0 : this.#s.get(t);
|
|
2882
|
+
if (u2 === void 0) u2 = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(false) : this.#n, this.#i[u2] = t, this.#t[u2] = e, this.#s.set(t, u2), this.#l[this.#h] = u2, this.#u[u2] = this.#h, this.#h = u2, this.#n++, this.#I(u2, y, o2), o2 && (o2.set = "add"), _ = false, this.#D && !d && this.#W?.(e, t, "add");
|
|
2877
2883
|
else {
|
|
2878
|
-
this.#L(
|
|
2879
|
-
let p = this.#t[
|
|
2884
|
+
this.#L(u2);
|
|
2885
|
+
let p = this.#t[u2];
|
|
2880
2886
|
if (e !== p) {
|
|
2881
|
-
if (
|
|
2882
|
-
p.__abortController.abort(new Error("replaced"));
|
|
2883
|
-
let { __staleWhileFetching:
|
|
2884
|
-
|
|
2885
|
-
} else
|
|
2886
|
-
if (this.#C(
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
m !== void 0 && (h2.oldValue = m);
|
|
2887
|
+
if (!h2) if (this.#e(p)) {
|
|
2888
|
+
p !== s && p.__abortController.abort(new Error("replaced"));
|
|
2889
|
+
let { __staleWhileFetching: f } = p;
|
|
2890
|
+
f !== void 0 && f !== e && (this.#T && this.#m?.(f, t, "set"), this.#f && this.#r?.push([f, t, "set"]));
|
|
2891
|
+
} else this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([p, t, "set"]);
|
|
2892
|
+
if (this.#C(u2), this.#I(u2, y, o2), this.#t[u2] = e, !d) {
|
|
2893
|
+
let f = p && this.#e(p) ? p.__staleWhileFetching : p, b = f === void 0 ? "add" : e !== f ? "replace" : "update";
|
|
2894
|
+
o2 && (o2.set = b, f !== void 0 && (o2.oldValue = f)), this.#D && this.onInsert?.(e, t, b);
|
|
2890
2895
|
}
|
|
2891
|
-
} else
|
|
2892
|
-
this.#U && this.onInsert?.(e, t, e === p ? "update" : "replace");
|
|
2896
|
+
} else d || (o2 && (o2.set = "update"), this.#D && this.onInsert?.(e, t, "update"));
|
|
2893
2897
|
}
|
|
2894
|
-
if (
|
|
2895
|
-
let p = this.#r,
|
|
2896
|
-
for (;
|
|
2898
|
+
if (n2 !== 0 && !this.#d && this.#k(), this.#d && (_ || this.#H(u2, n2, r), o2 && this.#E(o2, u2)), !h2 && this.#f && this.#r) {
|
|
2899
|
+
let p = this.#r, f;
|
|
2900
|
+
for (; f = p?.shift(); ) this.#S?.(...f);
|
|
2897
2901
|
}
|
|
2898
2902
|
return this;
|
|
2899
2903
|
}
|
|
@@ -2908,25 +2912,27 @@ var require_index_min = __commonJS({
|
|
|
2908
2912
|
} finally {
|
|
2909
2913
|
if (this.#f && this.#r) {
|
|
2910
2914
|
let t = this.#r, e;
|
|
2911
|
-
for (; e = t?.shift(); ) this.#
|
|
2915
|
+
for (; e = t?.shift(); ) this.#S?.(...e);
|
|
2912
2916
|
}
|
|
2913
2917
|
}
|
|
2914
2918
|
}
|
|
2915
2919
|
#P(t) {
|
|
2916
|
-
let e = this.#a, i2 = this.#i[e], s = this.#t[e];
|
|
2917
|
-
|
|
2920
|
+
let e = this.#a, i2 = this.#i[e], s = this.#t[e], n2 = this.#e(s);
|
|
2921
|
+
n2 && s.__abortController.abort(new Error("evicted"));
|
|
2922
|
+
let r = n2 ? s.__staleWhileFetching : s;
|
|
2923
|
+
return (this.#T || this.#f) && r !== void 0 && (this.#T && this.#m?.(r, i2, "evict"), this.#f && this.#r?.push([r, 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;
|
|
2918
2924
|
}
|
|
2919
2925
|
has(t, e = {}) {
|
|
2920
|
-
let { status: i2 =
|
|
2921
|
-
e.status = i2, i2 && (i2.op = "has", i2.key = t);
|
|
2926
|
+
let { status: i2 = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
2927
|
+
e.status = i2, i2 && (i2.op = "has", i2.key = t, i2.cache = this);
|
|
2922
2928
|
let s = this.#Y(t, e);
|
|
2923
|
-
return
|
|
2929
|
+
return g.metrics.hasSubscribers && g.metrics.publish(i2), s;
|
|
2924
2930
|
}
|
|
2925
2931
|
#Y(t, e = {}) {
|
|
2926
2932
|
let { updateAgeOnHas: i2 = this.updateAgeOnHas, status: s } = e, n2 = this.#s.get(t);
|
|
2927
2933
|
if (n2 !== void 0) {
|
|
2928
|
-
let
|
|
2929
|
-
if (this.#e(
|
|
2934
|
+
let r = this.#t[n2];
|
|
2935
|
+
if (this.#e(r) && r.__staleWhileFetching === void 0) return false;
|
|
2930
2936
|
if (this.#p(n2)) s && (s.has = "stale", this.#E(s, n2));
|
|
2931
2937
|
else return i2 && this.#R(n2), s && (s.has = "hit", this.#E(s, n2)), true;
|
|
2932
2938
|
} else s && (s.has = "miss");
|
|
@@ -2934,9 +2940,9 @@ var require_index_min = __commonJS({
|
|
|
2934
2940
|
}
|
|
2935
2941
|
peek(t, e = {}) {
|
|
2936
2942
|
let { status: i2 = C() ? {} : void 0 } = e;
|
|
2937
|
-
i2 && (i2.op = "peek", i2.key = t), e.status = i2;
|
|
2943
|
+
i2 && (i2.op = "peek", i2.key = t, i2.cache = this), e.status = i2;
|
|
2938
2944
|
let s = this.#J(t, e);
|
|
2939
|
-
return
|
|
2945
|
+
return g.metrics.hasSubscribers && g.metrics.publish(i2), s;
|
|
2940
2946
|
}
|
|
2941
2947
|
#J(t, e) {
|
|
2942
2948
|
let { status: i2, allowStale: s = this.allowStale } = e, n2 = this.#s.get(t);
|
|
@@ -2944,107 +2950,107 @@ var require_index_min = __commonJS({
|
|
|
2944
2950
|
i2 && (i2.peek = n2 === void 0 ? "miss" : "stale");
|
|
2945
2951
|
return;
|
|
2946
2952
|
}
|
|
2947
|
-
let
|
|
2948
|
-
return i2 && (
|
|
2953
|
+
let r = this.#t[n2], h2 = this.#e(r) ? r.__staleWhileFetching : r;
|
|
2954
|
+
return i2 && (h2 !== void 0 ? (i2.peek = "hit", i2.value = h2) : i2.peek = "miss"), h2;
|
|
2949
2955
|
}
|
|
2950
2956
|
#G(t, e, i2, s) {
|
|
2951
2957
|
let n2 = e === void 0 ? void 0 : this.#t[e];
|
|
2952
2958
|
if (this.#e(n2)) return n2;
|
|
2953
|
-
let
|
|
2954
|
-
|
|
2955
|
-
let
|
|
2956
|
-
let { aborted: l } =
|
|
2957
|
-
if (i2.status && (l && !
|
|
2958
|
-
let
|
|
2959
|
-
return (
|
|
2960
|
-
}, d = (
|
|
2961
|
-
let { aborted: l } =
|
|
2962
|
-
if (this.#t[e] ===
|
|
2963
|
-
if (
|
|
2964
|
-
},
|
|
2965
|
-
let l = this.#M?.(t, n2,
|
|
2966
|
-
|
|
2967
|
-
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (
|
|
2968
|
-
});
|
|
2959
|
+
let r = new AbortController(), { signal: h2 } = i2;
|
|
2960
|
+
h2?.addEventListener("abort", () => r.abort(h2.reason), { signal: r.signal });
|
|
2961
|
+
let a2 = { signal: r.signal, options: i2, context: s }, o2 = (f, b = false) => {
|
|
2962
|
+
let { aborted: l } = r.signal, S = i2.ignoreFetchAbort && f !== void 0, F = i2.ignoreFetchAbort || !!(i2.allowStaleOnFetchAbort && f !== void 0);
|
|
2963
|
+
if (i2.status && (l && !b ? (i2.status.fetchAborted = true, i2.status.fetchError = r.signal.reason, S && (i2.status.fetchAbortIgnored = true)) : i2.status.fetchResolved = true), l && !S && !b) return _(r.signal.reason, F);
|
|
2964
|
+
let w = u2, m = this.#t[e];
|
|
2965
|
+
return (m === u2 || m === void 0 && S && b) && (f === void 0 ? w.__staleWhileFetching !== void 0 ? this.#t[e] = w.__staleWhileFetching : this.#v(t, "fetch") : (i2.status && (i2.status.fetchUpdated = true), this.#O(t, f, a2.options, w))), f;
|
|
2966
|
+
}, d = (f) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = f), _(f, false)), _ = (f, b) => {
|
|
2967
|
+
let { aborted: l } = r.signal, S = l && i2.allowStaleOnFetchAbort, F = S || i2.allowStaleOnFetchRejection, w = F || i2.noDeleteOnFetchRejection, m = u2;
|
|
2968
|
+
if (this.#t[e] === u2 && (!w || !b && m.__staleWhileFetching === void 0 ? this.#v(t, "fetch") : S || (this.#t[e] = m.__staleWhileFetching)), F) return i2.status && m.__staleWhileFetching !== void 0 && (i2.status.returnedStale = true), m.__staleWhileFetching;
|
|
2969
|
+
if (m.__returned === m) throw f;
|
|
2970
|
+
}, y = (f, b) => {
|
|
2971
|
+
let l = this.#M?.(t, n2, a2);
|
|
2972
|
+
r.signal.addEventListener("abort", () => {
|
|
2973
|
+
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (f(void 0), i2.allowStaleOnFetchAbort && (f = (S) => o2(S, true)));
|
|
2974
|
+
}), l && l instanceof Promise ? l.then((S) => f(S === void 0 ? void 0 : S), b) : l !== void 0 && f(l);
|
|
2969
2975
|
};
|
|
2970
2976
|
i2.status && (i2.status.fetchDispatched = true);
|
|
2971
|
-
let
|
|
2972
|
-
return e === void 0 ? (this.#
|
|
2977
|
+
let u2 = new Promise(y).then(o2, d), p = Object.assign(u2, { __abortController: r, __staleWhileFetching: n2, __returned: void 0 });
|
|
2978
|
+
return e === void 0 ? (this.#O(t, p, { ...a2.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = p, p;
|
|
2973
2979
|
}
|
|
2974
2980
|
#e(t) {
|
|
2975
|
-
if (!this.#
|
|
2981
|
+
if (!this.#U) return false;
|
|
2976
2982
|
let e = t;
|
|
2977
2983
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
|
|
2978
2984
|
}
|
|
2979
2985
|
fetch(t, e = {}) {
|
|
2980
|
-
let i2 =
|
|
2986
|
+
let i2 = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
2981
2987
|
e.status = s, s && e.context && (s.context = e.context);
|
|
2982
|
-
let n2 = this.#
|
|
2983
|
-
return s && i2 && (s.trace = true,
|
|
2988
|
+
let n2 = this.#q(t, e);
|
|
2989
|
+
return s && i2 && (s.trace = true, g.tracing.tracePromise(() => n2, s).catch(() => {
|
|
2984
2990
|
})), n2;
|
|
2985
2991
|
}
|
|
2986
|
-
async #
|
|
2987
|
-
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, ttl:
|
|
2988
|
-
if (l && (l.op = "fetch", l.key = t,
|
|
2989
|
-
let
|
|
2990
|
-
if (
|
|
2992
|
+
async #q(t, e = {}) {
|
|
2993
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: h2 = this.noDisposeOnSet, size: a2 = 0, sizeCalculation: o2 = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: _ = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: y = this.allowStaleOnFetchRejection, ignoreFetchAbort: u2 = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: f, forceRefresh: b = false, status: l, signal: S } = e;
|
|
2994
|
+
if (l && (l.op = "fetch", l.key = t, b && (l.forceRefresh = true), l.cache = this), !this.#U) return l && (l.fetch = "get"), this.#x(t, { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, status: l });
|
|
2995
|
+
let F = { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, ttl: r, noDisposeOnSet: h2, size: a2, sizeCalculation: o2, noUpdateTTL: d, noDeleteOnFetchRejection: _, allowStaleOnFetchRejection: y, allowStaleOnFetchAbort: p, ignoreFetchAbort: u2, status: l, signal: S }, w = this.#s.get(t);
|
|
2996
|
+
if (w === void 0) {
|
|
2991
2997
|
l && (l.fetch = "miss");
|
|
2992
|
-
let
|
|
2993
|
-
return
|
|
2998
|
+
let m = this.#G(t, w, F, f);
|
|
2999
|
+
return m.__returned = m;
|
|
2994
3000
|
} else {
|
|
2995
|
-
let
|
|
2996
|
-
if (this.#e(
|
|
2997
|
-
let E = i2 &&
|
|
2998
|
-
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ?
|
|
3001
|
+
let m = this.#t[w];
|
|
3002
|
+
if (this.#e(m)) {
|
|
3003
|
+
let E = i2 && m.__staleWhileFetching !== void 0;
|
|
3004
|
+
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? m.__staleWhileFetching : m.__returned = m;
|
|
2999
3005
|
}
|
|
3000
|
-
let A = this.#p(
|
|
3001
|
-
if (!
|
|
3002
|
-
let
|
|
3003
|
-
return l && (l.fetch = A ? "stale" : "refresh",
|
|
3006
|
+
let A = this.#p(w);
|
|
3007
|
+
if (!b && !A) return l && (l.fetch = "hit"), this.#L(w), s && this.#R(w), l && this.#E(l, w), m;
|
|
3008
|
+
let z = this.#G(t, w, F, f), v = z.__staleWhileFetching !== void 0 && i2;
|
|
3009
|
+
return l && (l.fetch = A ? "stale" : "refresh", v && A && (l.returnedStale = true)), v ? z.__staleWhileFetching : z.__returned = z;
|
|
3004
3010
|
}
|
|
3005
3011
|
}
|
|
3006
3012
|
forceFetch(t, e = {}) {
|
|
3007
|
-
let i2 =
|
|
3013
|
+
let i2 = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
3008
3014
|
e.status = s, s && e.context && (s.context = e.context);
|
|
3009
3015
|
let n2 = this.#K(t, e);
|
|
3010
|
-
return s && i2 && (s.trace = true,
|
|
3016
|
+
return s && i2 && (s.trace = true, g.tracing.tracePromise(() => n2, s).catch(() => {
|
|
3011
3017
|
})), n2;
|
|
3012
3018
|
}
|
|
3013
3019
|
async #K(t, e = {}) {
|
|
3014
|
-
let i2 = await this.#
|
|
3020
|
+
let i2 = await this.#q(t, e);
|
|
3015
3021
|
if (i2 === void 0) throw new Error("fetch() returned undefined");
|
|
3016
3022
|
return i2;
|
|
3017
3023
|
}
|
|
3018
3024
|
memo(t, e = {}) {
|
|
3019
|
-
let { status: i2 =
|
|
3020
|
-
e.status = i2, i2 && (i2.op = "memo", i2.key = t, e.context && (i2.context = e.context));
|
|
3025
|
+
let { status: i2 = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
3026
|
+
e.status = i2, i2 && (i2.op = "memo", i2.key = t, e.context && (i2.context = e.context), i2.cache = this);
|
|
3021
3027
|
let s = this.#Q(t, e);
|
|
3022
|
-
return i2 && (i2.value = s),
|
|
3028
|
+
return i2 && (i2.value = s), g.metrics.hasSubscribers && g.metrics.publish(i2), s;
|
|
3023
3029
|
}
|
|
3024
3030
|
#Q(t, e = {}) {
|
|
3025
3031
|
let i2 = this.#j;
|
|
3026
3032
|
if (!i2) throw new Error("no memoMethod provided to constructor");
|
|
3027
|
-
let { context: s, status: n2, forceRefresh:
|
|
3028
|
-
n2 &&
|
|
3029
|
-
let
|
|
3030
|
-
if (n2 && (n2.memo =
|
|
3031
|
-
let d = i2(t,
|
|
3032
|
-
return n2 && (n2.value = d), this.#
|
|
3033
|
+
let { context: s, status: n2, forceRefresh: r, ...h2 } = e;
|
|
3034
|
+
n2 && r && (n2.forceRefresh = true);
|
|
3035
|
+
let a2 = this.#x(t, h2), o2 = r || a2 === void 0;
|
|
3036
|
+
if (n2 && (n2.memo = o2 ? "miss" : "hit", o2 || (n2.value = a2)), !o2) return a2;
|
|
3037
|
+
let d = i2(t, a2, { options: h2, context: s });
|
|
3038
|
+
return n2 && (n2.value = d), this.#O(t, d, h2), d;
|
|
3033
3039
|
}
|
|
3034
3040
|
get(t, e = {}) {
|
|
3035
|
-
let { status: i2 =
|
|
3036
|
-
e.status = i2, i2 && (i2.op = "get", i2.key = t);
|
|
3041
|
+
let { status: i2 = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
3042
|
+
e.status = i2, i2 && (i2.op = "get", i2.key = t, i2.cache = this);
|
|
3037
3043
|
let s = this.#x(t, e);
|
|
3038
|
-
return i2 && (s !== void 0 && (i2.value = s),
|
|
3044
|
+
return i2 && (s !== void 0 && (i2.value = s), g.metrics.hasSubscribers && g.metrics.publish(i2)), s;
|
|
3039
3045
|
}
|
|
3040
3046
|
#x(t, e = {}) {
|
|
3041
|
-
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, status:
|
|
3042
|
-
if (
|
|
3043
|
-
|
|
3047
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, status: r } = e, h2 = this.#s.get(t);
|
|
3048
|
+
if (h2 === void 0) {
|
|
3049
|
+
r && (r.get = "miss");
|
|
3044
3050
|
return;
|
|
3045
3051
|
}
|
|
3046
|
-
let
|
|
3047
|
-
return
|
|
3052
|
+
let a2 = this.#t[h2], o2 = this.#e(a2);
|
|
3053
|
+
return r && this.#E(r, h2), this.#p(h2) ? o2 ? (r && (r.get = "stale-fetching"), i2 && a2.__staleWhileFetching !== void 0 ? (r && (r.returnedStale = true), a2.__staleWhileFetching) : void 0) : (n2 || this.#v(t, "expire"), r && (r.get = "stale"), i2 ? (r && (r.returnedStale = true), a2) : void 0) : (r && (r.get = o2 ? "fetching" : "hit"), this.#L(h2), s && this.#R(h2), o2 ? a2.__staleWhileFetching : a2);
|
|
3048
3054
|
}
|
|
3049
3055
|
#B(t, e) {
|
|
3050
3056
|
this.#u[e] = t, this.#l[t] = e;
|
|
@@ -3053,10 +3059,10 @@ var require_index_min = __commonJS({
|
|
|
3053
3059
|
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);
|
|
3054
3060
|
}
|
|
3055
3061
|
delete(t) {
|
|
3056
|
-
return this.#
|
|
3062
|
+
return this.#v(t, "delete");
|
|
3057
3063
|
}
|
|
3058
|
-
#
|
|
3059
|
-
|
|
3064
|
+
#v(t, e) {
|
|
3065
|
+
g.metrics.hasSubscribers && g.metrics.publish({ op: "delete", delete: e, key: t, cache: this });
|
|
3060
3066
|
let i2 = false;
|
|
3061
3067
|
if (this.#n !== 0) {
|
|
3062
3068
|
let s = this.#s.get(t);
|
|
@@ -3067,17 +3073,17 @@ var require_index_min = __commonJS({
|
|
|
3067
3073
|
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];
|
|
3068
3074
|
else if (s === this.#a) this.#a = this.#l[s];
|
|
3069
3075
|
else {
|
|
3070
|
-
let
|
|
3071
|
-
this.#l[
|
|
3072
|
-
let
|
|
3073
|
-
this.#u[
|
|
3076
|
+
let r = this.#u[s];
|
|
3077
|
+
this.#l[r] = this.#l[s];
|
|
3078
|
+
let h2 = this.#l[s];
|
|
3079
|
+
this.#u[h2] = this.#u[s];
|
|
3074
3080
|
}
|
|
3075
3081
|
this.#n--, this.#_.push(s);
|
|
3076
3082
|
}
|
|
3077
3083
|
}
|
|
3078
3084
|
if (this.#f && this.#r?.length) {
|
|
3079
3085
|
let s = this.#r, n2;
|
|
3080
|
-
for (; n2 = s?.shift(); ) this.#
|
|
3086
|
+
for (; n2 = s?.shift(); ) this.#S?.(...n2);
|
|
3081
3087
|
}
|
|
3082
3088
|
return i2;
|
|
3083
3089
|
}
|
|
@@ -3085,7 +3091,7 @@ var require_index_min = __commonJS({
|
|
|
3085
3091
|
return this.#$("delete");
|
|
3086
3092
|
}
|
|
3087
3093
|
#$(t) {
|
|
3088
|
-
for (let e of this.#
|
|
3094
|
+
for (let e of this.#z({ allowStale: true })) {
|
|
3089
3095
|
let i2 = this.#t[e];
|
|
3090
3096
|
if (this.#e(i2)) i2.__abortController.abort(new Error("deleted"));
|
|
3091
3097
|
else {
|
|
@@ -3100,7 +3106,7 @@ var require_index_min = __commonJS({
|
|
|
3100
3106
|
}
|
|
3101
3107
|
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) {
|
|
3102
3108
|
let e = this.#r, i2;
|
|
3103
|
-
for (; i2 = e?.shift(); ) this.#
|
|
3109
|
+
for (; i2 = e?.shift(); ) this.#S?.(...i2);
|
|
3104
3110
|
}
|
|
3105
3111
|
}
|
|
3106
3112
|
};
|
|
@@ -3108,9 +3114,9 @@ var require_index_min = __commonJS({
|
|
|
3108
3114
|
}
|
|
3109
3115
|
});
|
|
3110
3116
|
|
|
3111
|
-
// node_modules/hosted-git-info/lib/hosts.js
|
|
3117
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/hosts.js
|
|
3112
3118
|
var require_hosts = __commonJS({
|
|
3113
|
-
"node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
3119
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
3114
3120
|
"use strict";
|
|
3115
3121
|
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
3116
3122
|
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
@@ -3274,17 +3280,16 @@ var require_hosts = __commonJS({
|
|
|
3274
3280
|
}
|
|
3275
3281
|
});
|
|
3276
3282
|
|
|
3277
|
-
// node_modules/hosted-git-info/lib/parse-url.js
|
|
3283
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/parse-url.js
|
|
3278
3284
|
var require_parse_url = __commonJS({
|
|
3279
|
-
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
3280
|
-
var url = __require("url");
|
|
3285
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
3281
3286
|
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
3282
3287
|
const startPosition = str2.indexOf(beforeChar);
|
|
3283
3288
|
return str2.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
3284
3289
|
};
|
|
3285
3290
|
var safeUrl = (u2) => {
|
|
3286
3291
|
try {
|
|
3287
|
-
return new
|
|
3292
|
+
return new URL(u2);
|
|
3288
3293
|
} catch {
|
|
3289
3294
|
}
|
|
3290
3295
|
};
|
|
@@ -3325,9 +3330,9 @@ var require_parse_url = __commonJS({
|
|
|
3325
3330
|
}
|
|
3326
3331
|
});
|
|
3327
3332
|
|
|
3328
|
-
// node_modules/hosted-git-info/lib/from-url.js
|
|
3333
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/from-url.js
|
|
3329
3334
|
var require_from_url = __commonJS({
|
|
3330
|
-
"node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
3335
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
3331
3336
|
"use strict";
|
|
3332
3337
|
var parseUrl = require_parse_url();
|
|
3333
3338
|
var isGitHubShorthand = (arg) => {
|
|
@@ -3419,9 +3424,9 @@ var require_from_url = __commonJS({
|
|
|
3419
3424
|
}
|
|
3420
3425
|
});
|
|
3421
3426
|
|
|
3422
|
-
// node_modules/hosted-git-info/lib/index.js
|
|
3427
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/index.js
|
|
3423
3428
|
var require_lib = __commonJS({
|
|
3424
|
-
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
3429
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
3425
3430
|
"use strict";
|
|
3426
3431
|
var { LRUCache } = require_index_min();
|
|
3427
3432
|
var hosts = require_hosts();
|
|
@@ -13852,175 +13857,1266 @@ var require_spdx_correct = __commonJS({
|
|
|
13852
13857
|
return transformed;
|
|
13853
13858
|
}
|
|
13854
13859
|
}
|
|
13855
|
-
return null;
|
|
13856
|
-
};
|
|
13857
|
-
var validLastResort = function(identifier) {
|
|
13858
|
-
var upperCased = identifier.toUpperCase();
|
|
13859
|
-
for (var i2 = 0; i2 < lastResorts.length; i2++) {
|
|
13860
|
-
var lastResort = lastResorts[i2];
|
|
13861
|
-
if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
|
|
13862
|
-
return lastResort[IDENTIFIER];
|
|
13860
|
+
return null;
|
|
13861
|
+
};
|
|
13862
|
+
var validLastResort = function(identifier) {
|
|
13863
|
+
var upperCased = identifier.toUpperCase();
|
|
13864
|
+
for (var i2 = 0; i2 < lastResorts.length; i2++) {
|
|
13865
|
+
var lastResort = lastResorts[i2];
|
|
13866
|
+
if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
|
|
13867
|
+
return lastResort[IDENTIFIER];
|
|
13868
|
+
}
|
|
13869
|
+
}
|
|
13870
|
+
return null;
|
|
13871
|
+
};
|
|
13872
|
+
var anyCorrection = function(identifier, check) {
|
|
13873
|
+
for (var i2 = 0; i2 < transpositions.length; i2++) {
|
|
13874
|
+
var transposition = transpositions[i2];
|
|
13875
|
+
var transposed = transposition[TRANSPOSED];
|
|
13876
|
+
if (identifier.indexOf(transposed) > -1) {
|
|
13877
|
+
var corrected = identifier.replace(
|
|
13878
|
+
transposed,
|
|
13879
|
+
transposition[CORRECT]
|
|
13880
|
+
);
|
|
13881
|
+
var checked = check(corrected);
|
|
13882
|
+
if (checked !== null) {
|
|
13883
|
+
return checked;
|
|
13884
|
+
}
|
|
13885
|
+
}
|
|
13886
|
+
}
|
|
13887
|
+
return null;
|
|
13888
|
+
};
|
|
13889
|
+
module.exports = function(identifier, options) {
|
|
13890
|
+
options = options || {};
|
|
13891
|
+
var upgrade = options.upgrade === void 0 ? true : !!options.upgrade;
|
|
13892
|
+
function postprocess(value) {
|
|
13893
|
+
return upgrade ? upgradeGPLs(value) : value;
|
|
13894
|
+
}
|
|
13895
|
+
var validArugment = typeof identifier === "string" && identifier.trim().length !== 0;
|
|
13896
|
+
if (!validArugment) {
|
|
13897
|
+
throw Error("Invalid argument. Expected non-empty string.");
|
|
13898
|
+
}
|
|
13899
|
+
identifier = identifier.trim();
|
|
13900
|
+
if (valid(identifier)) {
|
|
13901
|
+
return postprocess(identifier);
|
|
13902
|
+
}
|
|
13903
|
+
var noPlus = identifier.replace(/\+$/, "").trim();
|
|
13904
|
+
if (valid(noPlus)) {
|
|
13905
|
+
return postprocess(noPlus);
|
|
13906
|
+
}
|
|
13907
|
+
var transformed = validTransformation(identifier);
|
|
13908
|
+
if (transformed !== null) {
|
|
13909
|
+
return postprocess(transformed);
|
|
13910
|
+
}
|
|
13911
|
+
transformed = anyCorrection(identifier, function(argument) {
|
|
13912
|
+
if (valid(argument)) {
|
|
13913
|
+
return argument;
|
|
13914
|
+
}
|
|
13915
|
+
return validTransformation(argument);
|
|
13916
|
+
});
|
|
13917
|
+
if (transformed !== null) {
|
|
13918
|
+
return postprocess(transformed);
|
|
13919
|
+
}
|
|
13920
|
+
transformed = validLastResort(identifier);
|
|
13921
|
+
if (transformed !== null) {
|
|
13922
|
+
return postprocess(transformed);
|
|
13923
|
+
}
|
|
13924
|
+
transformed = anyCorrection(identifier, validLastResort);
|
|
13925
|
+
if (transformed !== null) {
|
|
13926
|
+
return postprocess(transformed);
|
|
13927
|
+
}
|
|
13928
|
+
return null;
|
|
13929
|
+
};
|
|
13930
|
+
function upgradeGPLs(value) {
|
|
13931
|
+
if ([
|
|
13932
|
+
"GPL-1.0",
|
|
13933
|
+
"LGPL-1.0",
|
|
13934
|
+
"AGPL-1.0",
|
|
13935
|
+
"GPL-2.0",
|
|
13936
|
+
"LGPL-2.0",
|
|
13937
|
+
"AGPL-2.0",
|
|
13938
|
+
"LGPL-2.1"
|
|
13939
|
+
].indexOf(value) !== -1) {
|
|
13940
|
+
return value + "-only";
|
|
13941
|
+
} else if ([
|
|
13942
|
+
"GPL-1.0+",
|
|
13943
|
+
"GPL-2.0+",
|
|
13944
|
+
"GPL-3.0+",
|
|
13945
|
+
"LGPL-2.0+",
|
|
13946
|
+
"LGPL-2.1+",
|
|
13947
|
+
"LGPL-3.0+",
|
|
13948
|
+
"AGPL-1.0+",
|
|
13949
|
+
"AGPL-3.0+"
|
|
13950
|
+
].indexOf(value) !== -1) {
|
|
13951
|
+
return value.replace(/\+$/, "-or-later");
|
|
13952
|
+
} else if (["GPL-3.0", "LGPL-3.0", "AGPL-3.0"].indexOf(value) !== -1) {
|
|
13953
|
+
return value + "-or-later";
|
|
13954
|
+
} else {
|
|
13955
|
+
return value;
|
|
13956
|
+
}
|
|
13957
|
+
}
|
|
13958
|
+
}
|
|
13959
|
+
});
|
|
13960
|
+
|
|
13961
|
+
// node_modules/validate-npm-package-license/index.js
|
|
13962
|
+
var require_validate_npm_package_license = __commonJS({
|
|
13963
|
+
"node_modules/validate-npm-package-license/index.js"(exports, module) {
|
|
13964
|
+
var parse2 = require_spdx_expression_parse();
|
|
13965
|
+
var correct = require_spdx_correct();
|
|
13966
|
+
var genericWarning = 'license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"';
|
|
13967
|
+
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
13968
|
+
function startsWith(prefix, string) {
|
|
13969
|
+
return string.slice(0, prefix.length) === prefix;
|
|
13970
|
+
}
|
|
13971
|
+
function usesLicenseRef(ast) {
|
|
13972
|
+
if (ast.hasOwnProperty("license")) {
|
|
13973
|
+
var license = ast.license;
|
|
13974
|
+
return startsWith("LicenseRef", license) || startsWith("DocumentRef", license);
|
|
13975
|
+
} else {
|
|
13976
|
+
return usesLicenseRef(ast.left) || usesLicenseRef(ast.right);
|
|
13977
|
+
}
|
|
13978
|
+
}
|
|
13979
|
+
module.exports = function(argument) {
|
|
13980
|
+
var ast;
|
|
13981
|
+
try {
|
|
13982
|
+
ast = parse2(argument);
|
|
13983
|
+
} catch (e) {
|
|
13984
|
+
var match2;
|
|
13985
|
+
if (argument === "UNLICENSED" || argument === "UNLICENCED") {
|
|
13986
|
+
return {
|
|
13987
|
+
validForOldPackages: true,
|
|
13988
|
+
validForNewPackages: true,
|
|
13989
|
+
unlicensed: true
|
|
13990
|
+
};
|
|
13991
|
+
} else if (match2 = fileReferenceRE.exec(argument)) {
|
|
13992
|
+
return {
|
|
13993
|
+
validForOldPackages: true,
|
|
13994
|
+
validForNewPackages: true,
|
|
13995
|
+
inFile: match2[1]
|
|
13996
|
+
};
|
|
13997
|
+
} else {
|
|
13998
|
+
var result = {
|
|
13999
|
+
validForOldPackages: false,
|
|
14000
|
+
validForNewPackages: false,
|
|
14001
|
+
warnings: [genericWarning]
|
|
14002
|
+
};
|
|
14003
|
+
if (argument.trim().length !== 0) {
|
|
14004
|
+
var corrected = correct(argument);
|
|
14005
|
+
if (corrected) {
|
|
14006
|
+
result.warnings.push(
|
|
14007
|
+
'license is similar to the valid expression "' + corrected + '"'
|
|
14008
|
+
);
|
|
14009
|
+
}
|
|
14010
|
+
}
|
|
14011
|
+
return result;
|
|
14012
|
+
}
|
|
14013
|
+
}
|
|
14014
|
+
if (usesLicenseRef(ast)) {
|
|
14015
|
+
return {
|
|
14016
|
+
validForNewPackages: false,
|
|
14017
|
+
validForOldPackages: false,
|
|
14018
|
+
spdx: true,
|
|
14019
|
+
warnings: [genericWarning]
|
|
14020
|
+
};
|
|
14021
|
+
} else {
|
|
14022
|
+
return {
|
|
14023
|
+
validForNewPackages: true,
|
|
14024
|
+
validForOldPackages: true,
|
|
14025
|
+
spdx: true
|
|
14026
|
+
};
|
|
14027
|
+
}
|
|
14028
|
+
};
|
|
14029
|
+
}
|
|
14030
|
+
});
|
|
14031
|
+
|
|
14032
|
+
// node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/node/index.min.js
|
|
14033
|
+
var require_index_min2 = __commonJS({
|
|
14034
|
+
"node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
|
|
14035
|
+
"use strict";
|
|
14036
|
+
var j = (c3, t) => () => (t || c3((t = { exports: {} }).exports, t), t.exports);
|
|
14037
|
+
var I = j((O) => {
|
|
14038
|
+
"use strict";
|
|
14039
|
+
Object.defineProperty(O, "__esModule", { value: true });
|
|
14040
|
+
O.tracing = O.metrics = void 0;
|
|
14041
|
+
var U = __require("node:diagnostics_channel");
|
|
14042
|
+
O.metrics = (0, U.channel)("lru-cache:metrics");
|
|
14043
|
+
O.tracing = (0, U.tracingChannel)("lru-cache");
|
|
14044
|
+
});
|
|
14045
|
+
var P = j((D) => {
|
|
14046
|
+
"use strict";
|
|
14047
|
+
Object.defineProperty(D, "__esModule", { value: true });
|
|
14048
|
+
D.defaultPerf = void 0;
|
|
14049
|
+
D.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
14050
|
+
});
|
|
14051
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14052
|
+
exports.LRUCache = void 0;
|
|
14053
|
+
var g = I();
|
|
14054
|
+
var N = P();
|
|
14055
|
+
var C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers;
|
|
14056
|
+
var k = /* @__PURE__ */ new Set();
|
|
14057
|
+
var G = typeof process == "object" && process ? process : {};
|
|
14058
|
+
var V = (c3, t, e, i2) => {
|
|
14059
|
+
typeof G.emitWarning == "function" ? G.emitWarning(c3, t, e, i2) : console.error(`[${e}] ${t}: ${c3}`);
|
|
14060
|
+
};
|
|
14061
|
+
var q = (c3) => !k.has(c3);
|
|
14062
|
+
var T = (c3) => !!c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
|
|
14063
|
+
var H = (c3) => T(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;
|
|
14064
|
+
var W = class extends Array {
|
|
14065
|
+
constructor(t) {
|
|
14066
|
+
super(t), this.fill(0);
|
|
14067
|
+
}
|
|
14068
|
+
};
|
|
14069
|
+
var x = class c3 {
|
|
14070
|
+
heap;
|
|
14071
|
+
length;
|
|
14072
|
+
static #o = false;
|
|
14073
|
+
static create(t) {
|
|
14074
|
+
let e = H(t);
|
|
14075
|
+
if (!e) return [];
|
|
14076
|
+
c3.#o = true;
|
|
14077
|
+
let i2 = new c3(t, e);
|
|
14078
|
+
return c3.#o = false, i2;
|
|
14079
|
+
}
|
|
14080
|
+
constructor(t, e) {
|
|
14081
|
+
if (!c3.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
14082
|
+
this.heap = new e(t), this.length = 0;
|
|
14083
|
+
}
|
|
14084
|
+
push(t) {
|
|
14085
|
+
this.heap[this.length++] = t;
|
|
14086
|
+
}
|
|
14087
|
+
pop() {
|
|
14088
|
+
return this.heap[--this.length];
|
|
14089
|
+
}
|
|
14090
|
+
};
|
|
14091
|
+
var L = class c3 {
|
|
14092
|
+
#o;
|
|
14093
|
+
#c;
|
|
14094
|
+
#m;
|
|
14095
|
+
#W;
|
|
14096
|
+
#S;
|
|
14097
|
+
#M;
|
|
14098
|
+
#j;
|
|
14099
|
+
#w;
|
|
14100
|
+
get perf() {
|
|
14101
|
+
return this.#w;
|
|
14102
|
+
}
|
|
14103
|
+
ttl;
|
|
14104
|
+
ttlResolution;
|
|
14105
|
+
ttlAutopurge;
|
|
14106
|
+
updateAgeOnGet;
|
|
14107
|
+
updateAgeOnHas;
|
|
14108
|
+
allowStale;
|
|
14109
|
+
noDisposeOnSet;
|
|
14110
|
+
noUpdateTTL;
|
|
14111
|
+
maxEntrySize;
|
|
14112
|
+
sizeCalculation;
|
|
14113
|
+
noDeleteOnFetchRejection;
|
|
14114
|
+
noDeleteOnStaleGet;
|
|
14115
|
+
allowStaleOnFetchAbort;
|
|
14116
|
+
allowStaleOnFetchRejection;
|
|
14117
|
+
ignoreFetchAbort;
|
|
14118
|
+
backgroundFetchSize;
|
|
14119
|
+
#n;
|
|
14120
|
+
#b;
|
|
14121
|
+
#s;
|
|
14122
|
+
#i;
|
|
14123
|
+
#t;
|
|
14124
|
+
#l;
|
|
14125
|
+
#u;
|
|
14126
|
+
#a;
|
|
14127
|
+
#h;
|
|
14128
|
+
#_;
|
|
14129
|
+
#r;
|
|
14130
|
+
#y;
|
|
14131
|
+
#F;
|
|
14132
|
+
#d;
|
|
14133
|
+
#g;
|
|
14134
|
+
#T;
|
|
14135
|
+
#U;
|
|
14136
|
+
#f;
|
|
14137
|
+
#D;
|
|
14138
|
+
static unsafeExposeInternals(t) {
|
|
14139
|
+
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() {
|
|
14140
|
+
return t.#a;
|
|
14141
|
+
}, get tail() {
|
|
14142
|
+
return t.#h;
|
|
14143
|
+
}, 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.#z(e), isStale: (e) => t.#p(e) };
|
|
14144
|
+
}
|
|
14145
|
+
get max() {
|
|
14146
|
+
return this.#o;
|
|
14147
|
+
}
|
|
14148
|
+
get maxSize() {
|
|
14149
|
+
return this.#c;
|
|
14150
|
+
}
|
|
14151
|
+
get calculatedSize() {
|
|
14152
|
+
return this.#b;
|
|
14153
|
+
}
|
|
14154
|
+
get size() {
|
|
14155
|
+
return this.#n;
|
|
14156
|
+
}
|
|
14157
|
+
get fetchMethod() {
|
|
14158
|
+
return this.#M;
|
|
14159
|
+
}
|
|
14160
|
+
get memoMethod() {
|
|
14161
|
+
return this.#j;
|
|
14162
|
+
}
|
|
14163
|
+
get dispose() {
|
|
14164
|
+
return this.#m;
|
|
14165
|
+
}
|
|
14166
|
+
get onInsert() {
|
|
14167
|
+
return this.#W;
|
|
14168
|
+
}
|
|
14169
|
+
get disposeAfter() {
|
|
14170
|
+
return this.#S;
|
|
14171
|
+
}
|
|
14172
|
+
constructor(t) {
|
|
14173
|
+
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n2, updateAgeOnGet: r, updateAgeOnHas: h2, allowStale: a2, dispose: o2, onInsert: d, disposeAfter: _, noDisposeOnSet: y, noUpdateTTL: u2, maxSize: p = 0, maxEntrySize: f = 0, sizeCalculation: b, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: w, allowStaleOnFetchRejection: m, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: M = 1, perf: v } = t;
|
|
14174
|
+
if (this.backgroundFetchSize = M, v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
14175
|
+
if (this.#w = v ?? N.defaultPerf, e !== 0 && !T(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
14176
|
+
let E = e ? H(e) : Array;
|
|
14177
|
+
if (!E) throw new Error("invalid max value: " + e);
|
|
14178
|
+
if (this.#o = e, this.#c = p, this.maxEntrySize = f || this.#c, this.sizeCalculation = b, this.sizeCalculation) {
|
|
14179
|
+
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
14180
|
+
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
14181
|
+
}
|
|
14182
|
+
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
14183
|
+
if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
14184
|
+
if (this.#M = l, this.#U = !!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 E(e), this.#u = new E(e), this.#a = 0, this.#h = 0, this.#_ = x.create(e), this.#n = 0, this.#b = 0, typeof o2 == "function" && (this.#m = o2), typeof d == "function" && (this.#W = d), typeof _ == "function" ? (this.#S = _, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#m, this.#D = !!this.#W, this.#f = !!this.#S, this.noDisposeOnSet = !!y, this.noUpdateTTL = !!u2, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!m, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
14185
|
+
if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
14186
|
+
if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
14187
|
+
this.#X();
|
|
14188
|
+
}
|
|
14189
|
+
if (this.allowStale = !!a2, this.noDeleteOnStaleGet = !!w, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!h2, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n2, this.ttl = i2 || 0, this.ttl) {
|
|
14190
|
+
if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
14191
|
+
this.#k();
|
|
14192
|
+
}
|
|
14193
|
+
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
14194
|
+
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
14195
|
+
let R = "LRU_CACHE_UNBOUNDED";
|
|
14196
|
+
q(R) && (k.add(R), V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", R, c3));
|
|
14197
|
+
}
|
|
14198
|
+
}
|
|
14199
|
+
getRemainingTTL(t) {
|
|
14200
|
+
return this.#s.has(t) ? 1 / 0 : 0;
|
|
14201
|
+
}
|
|
14202
|
+
#k() {
|
|
14203
|
+
let t = new W(this.#o), e = new W(this.#o);
|
|
14204
|
+
this.#d = t, this.#F = e;
|
|
14205
|
+
let i2 = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
14206
|
+
this.#g = i2, this.#H = (h2, a2, o2 = this.#w.now()) => {
|
|
14207
|
+
e[h2] = a2 !== 0 ? o2 : 0, t[h2] = a2, s(h2, a2);
|
|
14208
|
+
}, this.#R = (h2) => {
|
|
14209
|
+
e[h2] = t[h2] !== 0 ? this.#w.now() : 0, s(h2, t[h2]);
|
|
14210
|
+
};
|
|
14211
|
+
let s = this.ttlAutopurge ? (h2, a2) => {
|
|
14212
|
+
if (i2?.[h2] && (clearTimeout(i2[h2]), i2[h2] = void 0), a2 && a2 !== 0 && i2) {
|
|
14213
|
+
let o2 = setTimeout(() => {
|
|
14214
|
+
this.#p(h2) && this.#v(this.#i[h2], "expire");
|
|
14215
|
+
}, a2 + 1);
|
|
14216
|
+
o2.unref && o2.unref(), i2[h2] = o2;
|
|
14217
|
+
}
|
|
14218
|
+
} : () => {
|
|
14219
|
+
};
|
|
14220
|
+
this.#E = (h2, a2) => {
|
|
14221
|
+
if (t[a2]) {
|
|
14222
|
+
let o2 = t[a2], d = e[a2];
|
|
14223
|
+
if (!o2 || !d) return;
|
|
14224
|
+
h2.ttl = o2, h2.start = d, h2.now = n2 || r();
|
|
14225
|
+
let _ = h2.now - d;
|
|
14226
|
+
h2.remainingTTL = o2 - _;
|
|
14227
|
+
}
|
|
14228
|
+
};
|
|
14229
|
+
let n2 = 0, r = () => {
|
|
14230
|
+
let h2 = this.#w.now();
|
|
14231
|
+
if (this.ttlResolution > 0) {
|
|
14232
|
+
n2 = h2;
|
|
14233
|
+
let a2 = setTimeout(() => n2 = 0, this.ttlResolution);
|
|
14234
|
+
a2.unref && a2.unref();
|
|
14235
|
+
}
|
|
14236
|
+
return h2;
|
|
14237
|
+
};
|
|
14238
|
+
this.getRemainingTTL = (h2) => {
|
|
14239
|
+
let a2 = this.#s.get(h2);
|
|
14240
|
+
if (a2 === void 0) return 0;
|
|
14241
|
+
let o2 = t[a2], d = e[a2];
|
|
14242
|
+
if (!o2 || !d) return 1 / 0;
|
|
14243
|
+
let _ = (n2 || r()) - d;
|
|
14244
|
+
return o2 - _;
|
|
14245
|
+
}, this.#p = (h2) => {
|
|
14246
|
+
let a2 = e[h2], o2 = t[h2];
|
|
14247
|
+
return !!o2 && !!a2 && (n2 || r()) - a2 > o2;
|
|
14248
|
+
};
|
|
14249
|
+
}
|
|
14250
|
+
#R = () => {
|
|
14251
|
+
};
|
|
14252
|
+
#E = () => {
|
|
14253
|
+
};
|
|
14254
|
+
#H = () => {
|
|
14255
|
+
};
|
|
14256
|
+
#p = () => false;
|
|
14257
|
+
#X() {
|
|
14258
|
+
let t = new W(this.#o);
|
|
14259
|
+
this.#b = 0, this.#y = t, this.#C = (e) => {
|
|
14260
|
+
this.#b -= t[e], t[e] = 0;
|
|
14261
|
+
}, this.#N = (e, i2, s, n2) => {
|
|
14262
|
+
if (!T(s)) {
|
|
14263
|
+
if (this.#e(i2)) return this.backgroundFetchSize;
|
|
14264
|
+
if (n2) {
|
|
14265
|
+
if (typeof n2 != "function") throw new TypeError("sizeCalculation must be a function");
|
|
14266
|
+
if (s = n2(i2, e), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
14267
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
14268
|
+
}
|
|
14269
|
+
return s;
|
|
14270
|
+
}, this.#I = (e, i2, s) => {
|
|
14271
|
+
if (t[e] = i2, this.#c) {
|
|
14272
|
+
let n2 = this.#c - t[e];
|
|
14273
|
+
for (; this.#b > n2; ) this.#P(true);
|
|
14274
|
+
}
|
|
14275
|
+
this.#b += t[e], s && (s.entrySize = i2, s.totalCalculatedSize = this.#b);
|
|
14276
|
+
};
|
|
14277
|
+
}
|
|
14278
|
+
#C = (t) => {
|
|
14279
|
+
};
|
|
14280
|
+
#I = (t, e, i2) => {
|
|
14281
|
+
};
|
|
14282
|
+
#N = (t, e, i2, s) => {
|
|
14283
|
+
if (i2 || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
14284
|
+
return 0;
|
|
14285
|
+
};
|
|
14286
|
+
*#A({ allowStale: t = this.allowStale } = {}) {
|
|
14287
|
+
if (this.#n) for (let e = this.#h; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a); ) e = this.#u[e];
|
|
14288
|
+
}
|
|
14289
|
+
*#z({ allowStale: t = this.allowStale } = {}) {
|
|
14290
|
+
if (this.#n) for (let e = this.#a; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h); ) e = this.#l[e];
|
|
14291
|
+
}
|
|
14292
|
+
#V(t) {
|
|
14293
|
+
return t !== void 0 && this.#s.get(this.#i[t]) === t;
|
|
14294
|
+
}
|
|
14295
|
+
*entries() {
|
|
14296
|
+
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]]);
|
|
14297
|
+
}
|
|
14298
|
+
*rentries() {
|
|
14299
|
+
for (let t of this.#z()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
14300
|
+
}
|
|
14301
|
+
*keys() {
|
|
14302
|
+
for (let t of this.#A()) {
|
|
14303
|
+
let e = this.#i[t];
|
|
14304
|
+
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
14305
|
+
}
|
|
14306
|
+
}
|
|
14307
|
+
*rkeys() {
|
|
14308
|
+
for (let t of this.#z()) {
|
|
14309
|
+
let e = this.#i[t];
|
|
14310
|
+
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
14311
|
+
}
|
|
14312
|
+
}
|
|
14313
|
+
*values() {
|
|
14314
|
+
for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
14315
|
+
}
|
|
14316
|
+
*rvalues() {
|
|
14317
|
+
for (let t of this.#z()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
14318
|
+
}
|
|
14319
|
+
[Symbol.iterator]() {
|
|
14320
|
+
return this.entries();
|
|
14321
|
+
}
|
|
14322
|
+
[Symbol.toStringTag] = "LRUCache";
|
|
14323
|
+
find(t, e = {}) {
|
|
14324
|
+
for (let i2 of this.#A()) {
|
|
14325
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14326
|
+
if (n2 !== void 0 && t(n2, this.#i[i2], this)) return this.#x(this.#i[i2], e);
|
|
14327
|
+
}
|
|
14328
|
+
}
|
|
14329
|
+
forEach(t, e = this) {
|
|
14330
|
+
for (let i2 of this.#A()) {
|
|
14331
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14332
|
+
n2 !== void 0 && t.call(e, n2, this.#i[i2], this);
|
|
14333
|
+
}
|
|
14334
|
+
}
|
|
14335
|
+
rforEach(t, e = this) {
|
|
14336
|
+
for (let i2 of this.#z()) {
|
|
14337
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14338
|
+
n2 !== void 0 && t.call(e, n2, this.#i[i2], this);
|
|
14339
|
+
}
|
|
14340
|
+
}
|
|
14341
|
+
purgeStale() {
|
|
14342
|
+
let t = false;
|
|
14343
|
+
for (let e of this.#z({ allowStale: true })) this.#p(e) && (this.#v(this.#i[e], "expire"), t = true);
|
|
14344
|
+
return t;
|
|
14345
|
+
}
|
|
14346
|
+
info(t) {
|
|
14347
|
+
let e = this.#s.get(t);
|
|
14348
|
+
if (e === void 0) return;
|
|
14349
|
+
let i2 = this.#t[e], s = this.#e(i2) ? i2.__staleWhileFetching : i2;
|
|
14350
|
+
if (s === void 0) return;
|
|
14351
|
+
let n2 = { value: s };
|
|
14352
|
+
if (this.#d && this.#F) {
|
|
14353
|
+
let r = this.#d[e], h2 = this.#F[e];
|
|
14354
|
+
if (r && h2) {
|
|
14355
|
+
let a2 = r - (this.#w.now() - h2);
|
|
14356
|
+
n2.ttl = a2, n2.start = Date.now();
|
|
14357
|
+
}
|
|
14358
|
+
}
|
|
14359
|
+
return this.#y && (n2.size = this.#y[e]), n2;
|
|
14360
|
+
}
|
|
14361
|
+
dump() {
|
|
14362
|
+
let t = [];
|
|
14363
|
+
for (let e of this.#A({ allowStale: true })) {
|
|
14364
|
+
let i2 = this.#i[e], s = this.#t[e], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14365
|
+
if (n2 === void 0 || i2 === void 0) continue;
|
|
14366
|
+
let r = { value: n2 };
|
|
14367
|
+
if (this.#d && this.#F) {
|
|
14368
|
+
r.ttl = this.#d[e];
|
|
14369
|
+
let h2 = this.#w.now() - this.#F[e];
|
|
14370
|
+
r.start = Math.floor(Date.now() - h2);
|
|
14371
|
+
}
|
|
14372
|
+
this.#y && (r.size = this.#y[e]), t.unshift([i2, r]);
|
|
14373
|
+
}
|
|
14374
|
+
return t;
|
|
14375
|
+
}
|
|
14376
|
+
load(t) {
|
|
14377
|
+
this.clear();
|
|
14378
|
+
for (let [e, i2] of t) {
|
|
14379
|
+
if (i2.start) {
|
|
14380
|
+
let s = Date.now() - i2.start;
|
|
14381
|
+
i2.start = this.#w.now() - s;
|
|
14382
|
+
}
|
|
14383
|
+
this.#O(e, i2.value, i2);
|
|
14384
|
+
}
|
|
14385
|
+
}
|
|
14386
|
+
set(t, e, i2 = {}) {
|
|
14387
|
+
let { status: s = g.metrics.hasSubscribers ? {} : void 0 } = i2;
|
|
14388
|
+
i2.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e), s.cache = this);
|
|
14389
|
+
let n2 = this.#O(t, e, i2);
|
|
14390
|
+
return s && g.metrics.hasSubscribers && g.metrics.publish(s), n2;
|
|
14391
|
+
}
|
|
14392
|
+
#O(t, e, i2, s) {
|
|
14393
|
+
let { ttl: n2 = this.ttl, start: r, noDisposeOnSet: h2 = this.noDisposeOnSet, sizeCalculation: a2 = this.sizeCalculation, status: o2 } = i2, d = this.#e(e);
|
|
14394
|
+
if (e === void 0) return o2 && (o2.set = "deleted"), this.delete(t), this;
|
|
14395
|
+
let { noUpdateTTL: _ = this.noUpdateTTL } = i2;
|
|
14396
|
+
o2 && !d && (o2.value = e);
|
|
14397
|
+
let y = this.#N(t, e, i2.size || 0, a2, o2);
|
|
14398
|
+
if (this.maxEntrySize && y > this.maxEntrySize) return this.#v(t, "set"), o2 && (o2.set = "miss", o2.maxEntrySizeExceeded = true), this;
|
|
14399
|
+
let u2 = this.#n === 0 ? void 0 : this.#s.get(t);
|
|
14400
|
+
if (u2 === void 0) u2 = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(false) : this.#n, this.#i[u2] = t, this.#t[u2] = e, this.#s.set(t, u2), this.#l[this.#h] = u2, this.#u[u2] = this.#h, this.#h = u2, this.#n++, this.#I(u2, y, o2), o2 && (o2.set = "add"), _ = false, this.#D && !d && this.#W?.(e, t, "add");
|
|
14401
|
+
else {
|
|
14402
|
+
this.#L(u2);
|
|
14403
|
+
let p = this.#t[u2];
|
|
14404
|
+
if (e !== p) {
|
|
14405
|
+
if (!h2) if (this.#e(p)) {
|
|
14406
|
+
p !== s && p.__abortController.abort(new Error("replaced"));
|
|
14407
|
+
let { __staleWhileFetching: f } = p;
|
|
14408
|
+
f !== void 0 && f !== e && (this.#T && this.#m?.(f, t, "set"), this.#f && this.#r?.push([f, t, "set"]));
|
|
14409
|
+
} else this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([p, t, "set"]);
|
|
14410
|
+
if (this.#C(u2), this.#I(u2, y, o2), this.#t[u2] = e, !d) {
|
|
14411
|
+
let f = p && this.#e(p) ? p.__staleWhileFetching : p, b = f === void 0 ? "add" : e !== f ? "replace" : "update";
|
|
14412
|
+
o2 && (o2.set = b, f !== void 0 && (o2.oldValue = f)), this.#D && this.onInsert?.(e, t, b);
|
|
14413
|
+
}
|
|
14414
|
+
} else d || (o2 && (o2.set = "update"), this.#D && this.onInsert?.(e, t, "update"));
|
|
14415
|
+
}
|
|
14416
|
+
if (n2 !== 0 && !this.#d && this.#k(), this.#d && (_ || this.#H(u2, n2, r), o2 && this.#E(o2, u2)), !h2 && this.#f && this.#r) {
|
|
14417
|
+
let p = this.#r, f;
|
|
14418
|
+
for (; f = p?.shift(); ) this.#S?.(...f);
|
|
14419
|
+
}
|
|
14420
|
+
return this;
|
|
14421
|
+
}
|
|
14422
|
+
pop() {
|
|
14423
|
+
try {
|
|
14424
|
+
for (; this.#n; ) {
|
|
14425
|
+
let t = this.#t[this.#a];
|
|
14426
|
+
if (this.#P(true), this.#e(t)) {
|
|
14427
|
+
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
14428
|
+
} else if (t !== void 0) return t;
|
|
14429
|
+
}
|
|
14430
|
+
} finally {
|
|
14431
|
+
if (this.#f && this.#r) {
|
|
14432
|
+
let t = this.#r, e;
|
|
14433
|
+
for (; e = t?.shift(); ) this.#S?.(...e);
|
|
14434
|
+
}
|
|
14435
|
+
}
|
|
14436
|
+
}
|
|
14437
|
+
#P(t) {
|
|
14438
|
+
let e = this.#a, i2 = this.#i[e], s = this.#t[e], n2 = this.#e(s);
|
|
14439
|
+
n2 && s.__abortController.abort(new Error("evicted"));
|
|
14440
|
+
let r = n2 ? s.__staleWhileFetching : s;
|
|
14441
|
+
return (this.#T || this.#f) && r !== void 0 && (this.#T && this.#m?.(r, i2, "evict"), this.#f && this.#r?.push([r, 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;
|
|
14442
|
+
}
|
|
14443
|
+
has(t, e = {}) {
|
|
14444
|
+
let { status: i2 = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14445
|
+
e.status = i2, i2 && (i2.op = "has", i2.key = t, i2.cache = this);
|
|
14446
|
+
let s = this.#Y(t, e);
|
|
14447
|
+
return g.metrics.hasSubscribers && g.metrics.publish(i2), s;
|
|
14448
|
+
}
|
|
14449
|
+
#Y(t, e = {}) {
|
|
14450
|
+
let { updateAgeOnHas: i2 = this.updateAgeOnHas, status: s } = e, n2 = this.#s.get(t);
|
|
14451
|
+
if (n2 !== void 0) {
|
|
14452
|
+
let r = this.#t[n2];
|
|
14453
|
+
if (this.#e(r) && r.__staleWhileFetching === void 0) return false;
|
|
14454
|
+
if (this.#p(n2)) s && (s.has = "stale", this.#E(s, n2));
|
|
14455
|
+
else return i2 && this.#R(n2), s && (s.has = "hit", this.#E(s, n2)), true;
|
|
14456
|
+
} else s && (s.has = "miss");
|
|
14457
|
+
return false;
|
|
14458
|
+
}
|
|
14459
|
+
peek(t, e = {}) {
|
|
14460
|
+
let { status: i2 = C() ? {} : void 0 } = e;
|
|
14461
|
+
i2 && (i2.op = "peek", i2.key = t, i2.cache = this), e.status = i2;
|
|
14462
|
+
let s = this.#J(t, e);
|
|
14463
|
+
return g.metrics.hasSubscribers && g.metrics.publish(i2), s;
|
|
14464
|
+
}
|
|
14465
|
+
#J(t, e) {
|
|
14466
|
+
let { status: i2, allowStale: s = this.allowStale } = e, n2 = this.#s.get(t);
|
|
14467
|
+
if (n2 === void 0 || !s && this.#p(n2)) {
|
|
14468
|
+
i2 && (i2.peek = n2 === void 0 ? "miss" : "stale");
|
|
14469
|
+
return;
|
|
14470
|
+
}
|
|
14471
|
+
let r = this.#t[n2], h2 = this.#e(r) ? r.__staleWhileFetching : r;
|
|
14472
|
+
return i2 && (h2 !== void 0 ? (i2.peek = "hit", i2.value = h2) : i2.peek = "miss"), h2;
|
|
14473
|
+
}
|
|
14474
|
+
#G(t, e, i2, s) {
|
|
14475
|
+
let n2 = e === void 0 ? void 0 : this.#t[e];
|
|
14476
|
+
if (this.#e(n2)) return n2;
|
|
14477
|
+
let r = new AbortController(), { signal: h2 } = i2;
|
|
14478
|
+
h2?.addEventListener("abort", () => r.abort(h2.reason), { signal: r.signal });
|
|
14479
|
+
let a2 = { signal: r.signal, options: i2, context: s }, o2 = (f, b = false) => {
|
|
14480
|
+
let { aborted: l } = r.signal, S = i2.ignoreFetchAbort && f !== void 0, F = i2.ignoreFetchAbort || !!(i2.allowStaleOnFetchAbort && f !== void 0);
|
|
14481
|
+
if (i2.status && (l && !b ? (i2.status.fetchAborted = true, i2.status.fetchError = r.signal.reason, S && (i2.status.fetchAbortIgnored = true)) : i2.status.fetchResolved = true), l && !S && !b) return _(r.signal.reason, F);
|
|
14482
|
+
let w = u2, m = this.#t[e];
|
|
14483
|
+
return (m === u2 || m === void 0 && S && b) && (f === void 0 ? w.__staleWhileFetching !== void 0 ? this.#t[e] = w.__staleWhileFetching : this.#v(t, "fetch") : (i2.status && (i2.status.fetchUpdated = true), this.#O(t, f, a2.options, w))), f;
|
|
14484
|
+
}, d = (f) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = f), _(f, false)), _ = (f, b) => {
|
|
14485
|
+
let { aborted: l } = r.signal, S = l && i2.allowStaleOnFetchAbort, F = S || i2.allowStaleOnFetchRejection, w = F || i2.noDeleteOnFetchRejection, m = u2;
|
|
14486
|
+
if (this.#t[e] === u2 && (!w || !b && m.__staleWhileFetching === void 0 ? this.#v(t, "fetch") : S || (this.#t[e] = m.__staleWhileFetching)), F) return i2.status && m.__staleWhileFetching !== void 0 && (i2.status.returnedStale = true), m.__staleWhileFetching;
|
|
14487
|
+
if (m.__returned === m) throw f;
|
|
14488
|
+
}, y = (f, b) => {
|
|
14489
|
+
let l = this.#M?.(t, n2, a2);
|
|
14490
|
+
r.signal.addEventListener("abort", () => {
|
|
14491
|
+
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (f(void 0), i2.allowStaleOnFetchAbort && (f = (S) => o2(S, true)));
|
|
14492
|
+
}), l && l instanceof Promise ? l.then((S) => f(S === void 0 ? void 0 : S), b) : l !== void 0 && f(l);
|
|
14493
|
+
};
|
|
14494
|
+
i2.status && (i2.status.fetchDispatched = true);
|
|
14495
|
+
let u2 = new Promise(y).then(o2, d), p = Object.assign(u2, { __abortController: r, __staleWhileFetching: n2, __returned: void 0 });
|
|
14496
|
+
return e === void 0 ? (this.#O(t, p, { ...a2.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = p, p;
|
|
14497
|
+
}
|
|
14498
|
+
#e(t) {
|
|
14499
|
+
if (!this.#U) return false;
|
|
14500
|
+
let e = t;
|
|
14501
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
|
|
14502
|
+
}
|
|
14503
|
+
fetch(t, e = {}) {
|
|
14504
|
+
let i2 = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
14505
|
+
e.status = s, s && e.context && (s.context = e.context);
|
|
14506
|
+
let n2 = this.#q(t, e);
|
|
14507
|
+
return s && i2 && (s.trace = true, g.tracing.tracePromise(() => n2, s).catch(() => {
|
|
14508
|
+
})), n2;
|
|
14509
|
+
}
|
|
14510
|
+
async #q(t, e = {}) {
|
|
14511
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: h2 = this.noDisposeOnSet, size: a2 = 0, sizeCalculation: o2 = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: _ = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: y = this.allowStaleOnFetchRejection, ignoreFetchAbort: u2 = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: f, forceRefresh: b = false, status: l, signal: S } = e;
|
|
14512
|
+
if (l && (l.op = "fetch", l.key = t, b && (l.forceRefresh = true), l.cache = this), !this.#U) return l && (l.fetch = "get"), this.#x(t, { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, status: l });
|
|
14513
|
+
let F = { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, ttl: r, noDisposeOnSet: h2, size: a2, sizeCalculation: o2, noUpdateTTL: d, noDeleteOnFetchRejection: _, allowStaleOnFetchRejection: y, allowStaleOnFetchAbort: p, ignoreFetchAbort: u2, status: l, signal: S }, w = this.#s.get(t);
|
|
14514
|
+
if (w === void 0) {
|
|
14515
|
+
l && (l.fetch = "miss");
|
|
14516
|
+
let m = this.#G(t, w, F, f);
|
|
14517
|
+
return m.__returned = m;
|
|
14518
|
+
} else {
|
|
14519
|
+
let m = this.#t[w];
|
|
14520
|
+
if (this.#e(m)) {
|
|
14521
|
+
let E = i2 && m.__staleWhileFetching !== void 0;
|
|
14522
|
+
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? m.__staleWhileFetching : m.__returned = m;
|
|
14523
|
+
}
|
|
14524
|
+
let A = this.#p(w);
|
|
14525
|
+
if (!b && !A) return l && (l.fetch = "hit"), this.#L(w), s && this.#R(w), l && this.#E(l, w), m;
|
|
14526
|
+
let z = this.#G(t, w, F, f), v = z.__staleWhileFetching !== void 0 && i2;
|
|
14527
|
+
return l && (l.fetch = A ? "stale" : "refresh", v && A && (l.returnedStale = true)), v ? z.__staleWhileFetching : z.__returned = z;
|
|
14528
|
+
}
|
|
14529
|
+
}
|
|
14530
|
+
forceFetch(t, e = {}) {
|
|
14531
|
+
let i2 = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
14532
|
+
e.status = s, s && e.context && (s.context = e.context);
|
|
14533
|
+
let n2 = this.#K(t, e);
|
|
14534
|
+
return s && i2 && (s.trace = true, g.tracing.tracePromise(() => n2, s).catch(() => {
|
|
14535
|
+
})), n2;
|
|
14536
|
+
}
|
|
14537
|
+
async #K(t, e = {}) {
|
|
14538
|
+
let i2 = await this.#q(t, e);
|
|
14539
|
+
if (i2 === void 0) throw new Error("fetch() returned undefined");
|
|
14540
|
+
return i2;
|
|
14541
|
+
}
|
|
14542
|
+
memo(t, e = {}) {
|
|
14543
|
+
let { status: i2 = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14544
|
+
e.status = i2, i2 && (i2.op = "memo", i2.key = t, e.context && (i2.context = e.context), i2.cache = this);
|
|
14545
|
+
let s = this.#Q(t, e);
|
|
14546
|
+
return i2 && (i2.value = s), g.metrics.hasSubscribers && g.metrics.publish(i2), s;
|
|
14547
|
+
}
|
|
14548
|
+
#Q(t, e = {}) {
|
|
14549
|
+
let i2 = this.#j;
|
|
14550
|
+
if (!i2) throw new Error("no memoMethod provided to constructor");
|
|
14551
|
+
let { context: s, status: n2, forceRefresh: r, ...h2 } = e;
|
|
14552
|
+
n2 && r && (n2.forceRefresh = true);
|
|
14553
|
+
let a2 = this.#x(t, h2), o2 = r || a2 === void 0;
|
|
14554
|
+
if (n2 && (n2.memo = o2 ? "miss" : "hit", o2 || (n2.value = a2)), !o2) return a2;
|
|
14555
|
+
let d = i2(t, a2, { options: h2, context: s });
|
|
14556
|
+
return n2 && (n2.value = d), this.#O(t, d, h2), d;
|
|
14557
|
+
}
|
|
14558
|
+
get(t, e = {}) {
|
|
14559
|
+
let { status: i2 = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14560
|
+
e.status = i2, i2 && (i2.op = "get", i2.key = t, i2.cache = this);
|
|
14561
|
+
let s = this.#x(t, e);
|
|
14562
|
+
return i2 && (s !== void 0 && (i2.value = s), g.metrics.hasSubscribers && g.metrics.publish(i2)), s;
|
|
14563
|
+
}
|
|
14564
|
+
#x(t, e = {}) {
|
|
14565
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, status: r } = e, h2 = this.#s.get(t);
|
|
14566
|
+
if (h2 === void 0) {
|
|
14567
|
+
r && (r.get = "miss");
|
|
14568
|
+
return;
|
|
14569
|
+
}
|
|
14570
|
+
let a2 = this.#t[h2], o2 = this.#e(a2);
|
|
14571
|
+
return r && this.#E(r, h2), this.#p(h2) ? o2 ? (r && (r.get = "stale-fetching"), i2 && a2.__staleWhileFetching !== void 0 ? (r && (r.returnedStale = true), a2.__staleWhileFetching) : void 0) : (n2 || this.#v(t, "expire"), r && (r.get = "stale"), i2 ? (r && (r.returnedStale = true), a2) : void 0) : (r && (r.get = o2 ? "fetching" : "hit"), this.#L(h2), s && this.#R(h2), o2 ? a2.__staleWhileFetching : a2);
|
|
14572
|
+
}
|
|
14573
|
+
#B(t, e) {
|
|
14574
|
+
this.#u[e] = t, this.#l[t] = e;
|
|
14575
|
+
}
|
|
14576
|
+
#L(t) {
|
|
14577
|
+
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);
|
|
14578
|
+
}
|
|
14579
|
+
delete(t) {
|
|
14580
|
+
return this.#v(t, "delete");
|
|
14581
|
+
}
|
|
14582
|
+
#v(t, e) {
|
|
14583
|
+
g.metrics.hasSubscribers && g.metrics.publish({ op: "delete", delete: e, key: t, cache: this });
|
|
14584
|
+
let i2 = false;
|
|
14585
|
+
if (this.#n !== 0) {
|
|
14586
|
+
let s = this.#s.get(t);
|
|
14587
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i2 = true, this.#n === 1) this.#$(e);
|
|
14588
|
+
else {
|
|
14589
|
+
this.#C(s);
|
|
14590
|
+
let n2 = this.#t[s];
|
|
14591
|
+
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];
|
|
14592
|
+
else if (s === this.#a) this.#a = this.#l[s];
|
|
14593
|
+
else {
|
|
14594
|
+
let r = this.#u[s];
|
|
14595
|
+
this.#l[r] = this.#l[s];
|
|
14596
|
+
let h2 = this.#l[s];
|
|
14597
|
+
this.#u[h2] = this.#u[s];
|
|
14598
|
+
}
|
|
14599
|
+
this.#n--, this.#_.push(s);
|
|
14600
|
+
}
|
|
14601
|
+
}
|
|
14602
|
+
if (this.#f && this.#r?.length) {
|
|
14603
|
+
let s = this.#r, n2;
|
|
14604
|
+
for (; n2 = s?.shift(); ) this.#S?.(...n2);
|
|
14605
|
+
}
|
|
14606
|
+
return i2;
|
|
14607
|
+
}
|
|
14608
|
+
clear() {
|
|
14609
|
+
return this.#$("delete");
|
|
14610
|
+
}
|
|
14611
|
+
#$(t) {
|
|
14612
|
+
for (let e of this.#z({ allowStale: true })) {
|
|
14613
|
+
let i2 = this.#t[e];
|
|
14614
|
+
if (this.#e(i2)) i2.__abortController.abort(new Error("deleted"));
|
|
14615
|
+
else {
|
|
14616
|
+
let s = this.#i[e];
|
|
14617
|
+
this.#T && this.#m?.(i2, s, t), this.#f && this.#r?.push([i2, s, t]);
|
|
14618
|
+
}
|
|
14619
|
+
}
|
|
14620
|
+
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
14621
|
+
this.#d.fill(0), this.#F.fill(0);
|
|
14622
|
+
for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
|
|
14623
|
+
this.#g?.fill(void 0);
|
|
14624
|
+
}
|
|
14625
|
+
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) {
|
|
14626
|
+
let e = this.#r, i2;
|
|
14627
|
+
for (; i2 = e?.shift(); ) this.#S?.(...i2);
|
|
14628
|
+
}
|
|
14629
|
+
}
|
|
14630
|
+
};
|
|
14631
|
+
exports.LRUCache = L;
|
|
14632
|
+
}
|
|
14633
|
+
});
|
|
14634
|
+
|
|
14635
|
+
// node_modules/hosted-git-info/lib/hosts.js
|
|
14636
|
+
var require_hosts2 = __commonJS({
|
|
14637
|
+
"node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
14638
|
+
"use strict";
|
|
14639
|
+
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
14640
|
+
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
14641
|
+
var formatHashFragment = (f) => f.toLowerCase().replace(/^\W+/g, "").replace(/(?<!\W)\W+$/, "").replace(/\//g, "").replace(/\W+/g, "-");
|
|
14642
|
+
var defaults2 = {
|
|
14643
|
+
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14644
|
+
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14645
|
+
edittemplate: ({ domain, user, project, committish, editpath, path: path26 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path26)}`,
|
|
14646
|
+
browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
|
|
14647
|
+
browsetreetemplate: ({ domain, user, project, committish, treepath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14648
|
+
browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14649
|
+
docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
|
|
14650
|
+
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14651
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
14652
|
+
shortcuttemplate: ({ type: type2, user, project, committish }) => `${type2}:${user}/${project}${maybeJoin("#", committish)}`,
|
|
14653
|
+
pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
|
|
14654
|
+
bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
|
|
14655
|
+
hashformat: formatHashFragment
|
|
14656
|
+
};
|
|
14657
|
+
var hosts = {};
|
|
14658
|
+
hosts.github = {
|
|
14659
|
+
// First two are insecure and generally shouldn't be used any more, but
|
|
14660
|
+
// they are still supported.
|
|
14661
|
+
protocols: ["git:", "http:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14662
|
+
domain: "github.com",
|
|
14663
|
+
treepath: "tree",
|
|
14664
|
+
blobpath: "blob",
|
|
14665
|
+
editpath: "edit",
|
|
14666
|
+
filetemplate: ({ auth, user, project, committish, path: path26 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
14667
|
+
gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14668
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
14669
|
+
extract: (url) => {
|
|
14670
|
+
let [, user, project, type2, committish] = url.pathname.split("/", 5);
|
|
14671
|
+
if (type2 && type2 !== "tree") {
|
|
14672
|
+
return;
|
|
14673
|
+
}
|
|
14674
|
+
if (!type2) {
|
|
14675
|
+
committish = url.hash.slice(1);
|
|
14676
|
+
}
|
|
14677
|
+
if (project && project.endsWith(".git")) {
|
|
14678
|
+
project = project.slice(0, -4);
|
|
14679
|
+
}
|
|
14680
|
+
if (!user || !project) {
|
|
14681
|
+
return;
|
|
14682
|
+
}
|
|
14683
|
+
return { user, project, committish };
|
|
14684
|
+
}
|
|
14685
|
+
};
|
|
14686
|
+
hosts.bitbucket = {
|
|
14687
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14688
|
+
domain: "bitbucket.org",
|
|
14689
|
+
treepath: "src",
|
|
14690
|
+
blobpath: "src",
|
|
14691
|
+
editpath: "?mode=edit",
|
|
14692
|
+
edittemplate: ({ domain, user, project, committish, treepath, path: path26, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path26, editpath)}`,
|
|
14693
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
|
|
14694
|
+
extract: (url) => {
|
|
14695
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14696
|
+
if (["get"].includes(aux)) {
|
|
14697
|
+
return;
|
|
14698
|
+
}
|
|
14699
|
+
if (project && project.endsWith(".git")) {
|
|
14700
|
+
project = project.slice(0, -4);
|
|
14701
|
+
}
|
|
14702
|
+
if (!user || !project) {
|
|
14703
|
+
return;
|
|
14704
|
+
}
|
|
14705
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14706
|
+
}
|
|
14707
|
+
};
|
|
14708
|
+
hosts.gitlab = {
|
|
14709
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14710
|
+
domain: "gitlab.com",
|
|
14711
|
+
treepath: "tree",
|
|
14712
|
+
blobpath: "tree",
|
|
14713
|
+
editpath: "-/edit",
|
|
14714
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/api/v4/projects/${maybeEncode(user + "/" + project)}/repository/archive.tar.gz?sha=${maybeEncode(committish || "HEAD")}`,
|
|
14715
|
+
extract: (url) => {
|
|
14716
|
+
const path26 = url.pathname.slice(1);
|
|
14717
|
+
if (path26.includes("/-/") || path26.includes("/archive.tar.gz")) {
|
|
14718
|
+
return;
|
|
14719
|
+
}
|
|
14720
|
+
const segments = path26.split("/");
|
|
14721
|
+
let project = segments.pop();
|
|
14722
|
+
if (project.endsWith(".git")) {
|
|
14723
|
+
project = project.slice(0, -4);
|
|
14724
|
+
}
|
|
14725
|
+
const user = segments.join("/");
|
|
14726
|
+
if (!user || !project) {
|
|
14727
|
+
return;
|
|
14728
|
+
}
|
|
14729
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14730
|
+
}
|
|
14731
|
+
};
|
|
14732
|
+
hosts.gist = {
|
|
14733
|
+
protocols: ["git:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14734
|
+
domain: "gist.github.com",
|
|
14735
|
+
editpath: "edit",
|
|
14736
|
+
sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin("#", committish)}`,
|
|
14737
|
+
sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14738
|
+
edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
|
|
14739
|
+
browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14740
|
+
browsetreetemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
14741
|
+
browseblobtemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
14742
|
+
docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14743
|
+
httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14744
|
+
filetemplate: ({ user, project, committish, path: path26 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path26}`,
|
|
14745
|
+
shortcuttemplate: ({ type: type2, project, committish }) => `${type2}:${project}${maybeJoin("#", committish)}`,
|
|
14746
|
+
pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
|
|
14747
|
+
bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
|
|
14748
|
+
gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14749
|
+
tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
14750
|
+
extract: (url) => {
|
|
14751
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14752
|
+
if (aux === "raw") {
|
|
14753
|
+
return;
|
|
14754
|
+
}
|
|
14755
|
+
if (!project) {
|
|
14756
|
+
if (!user) {
|
|
14757
|
+
return;
|
|
14758
|
+
}
|
|
14759
|
+
project = user;
|
|
14760
|
+
user = null;
|
|
14761
|
+
}
|
|
14762
|
+
if (project.endsWith(".git")) {
|
|
14763
|
+
project = project.slice(0, -4);
|
|
14764
|
+
}
|
|
14765
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14766
|
+
},
|
|
14767
|
+
hashformat: function(fragment) {
|
|
14768
|
+
return fragment && "file-" + formatHashFragment(fragment);
|
|
14769
|
+
}
|
|
14770
|
+
};
|
|
14771
|
+
hosts.sourcehut = {
|
|
14772
|
+
protocols: ["git+ssh:", "https:"],
|
|
14773
|
+
domain: "git.sr.ht",
|
|
14774
|
+
treepath: "tree",
|
|
14775
|
+
blobpath: "tree",
|
|
14776
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path26}`,
|
|
14777
|
+
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}${maybeJoin("#", committish)}`,
|
|
14778
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
14779
|
+
bugstemplate: () => null,
|
|
14780
|
+
extract: (url) => {
|
|
14781
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14782
|
+
if (["archive"].includes(aux)) {
|
|
14783
|
+
return;
|
|
14784
|
+
}
|
|
14785
|
+
if (project && project.endsWith(".git")) {
|
|
14786
|
+
project = project.slice(0, -4);
|
|
14787
|
+
}
|
|
14788
|
+
if (!user || !project) {
|
|
14789
|
+
return;
|
|
14790
|
+
}
|
|
14791
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14792
|
+
}
|
|
14793
|
+
};
|
|
14794
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
14795
|
+
hosts[name] = Object.assign({}, defaults2, host);
|
|
14796
|
+
}
|
|
14797
|
+
module.exports = hosts;
|
|
14798
|
+
}
|
|
14799
|
+
});
|
|
14800
|
+
|
|
14801
|
+
// node_modules/hosted-git-info/lib/parse-url.js
|
|
14802
|
+
var require_parse_url2 = __commonJS({
|
|
14803
|
+
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
14804
|
+
var url = __require("url");
|
|
14805
|
+
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
14806
|
+
const startPosition = str2.indexOf(beforeChar);
|
|
14807
|
+
return str2.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
14808
|
+
};
|
|
14809
|
+
var safeUrl = (u2) => {
|
|
14810
|
+
try {
|
|
14811
|
+
return new url.URL(u2);
|
|
14812
|
+
} catch {
|
|
14813
|
+
}
|
|
14814
|
+
};
|
|
14815
|
+
var correctProtocol = (arg, protocols) => {
|
|
14816
|
+
const firstColon = arg.indexOf(":");
|
|
14817
|
+
const proto = arg.slice(0, firstColon + 1);
|
|
14818
|
+
if (Object.prototype.hasOwnProperty.call(protocols, proto)) {
|
|
14819
|
+
return arg;
|
|
14820
|
+
}
|
|
14821
|
+
if (arg.substr(firstColon, 3) === "://") {
|
|
14822
|
+
return arg;
|
|
14823
|
+
}
|
|
14824
|
+
const firstAt = arg.indexOf("@");
|
|
14825
|
+
if (firstAt > -1) {
|
|
14826
|
+
if (firstAt > firstColon) {
|
|
14827
|
+
return `git+ssh://${arg}`;
|
|
14828
|
+
} else {
|
|
14829
|
+
return arg;
|
|
14830
|
+
}
|
|
14831
|
+
}
|
|
14832
|
+
return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
|
|
14833
|
+
};
|
|
14834
|
+
var correctUrl = (giturl) => {
|
|
14835
|
+
const firstAt = lastIndexOfBefore(giturl, "@", "#");
|
|
14836
|
+
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
|
|
14837
|
+
if (lastColonBeforeHash > firstAt) {
|
|
14838
|
+
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
|
|
14839
|
+
}
|
|
14840
|
+
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
|
|
14841
|
+
giturl = `git+ssh://${giturl}`;
|
|
14842
|
+
}
|
|
14843
|
+
return giturl;
|
|
14844
|
+
};
|
|
14845
|
+
module.exports = (giturl, protocols) => {
|
|
14846
|
+
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
|
|
14847
|
+
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
|
|
14848
|
+
};
|
|
14849
|
+
}
|
|
14850
|
+
});
|
|
14851
|
+
|
|
14852
|
+
// node_modules/hosted-git-info/lib/from-url.js
|
|
14853
|
+
var require_from_url2 = __commonJS({
|
|
14854
|
+
"node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
14855
|
+
"use strict";
|
|
14856
|
+
var parseUrl = require_parse_url2();
|
|
14857
|
+
var isGitHubShorthand = (arg) => {
|
|
14858
|
+
const firstHash = arg.indexOf("#");
|
|
14859
|
+
const firstSlash = arg.indexOf("/");
|
|
14860
|
+
const secondSlash = arg.indexOf("/", firstSlash + 1);
|
|
14861
|
+
const firstColon = arg.indexOf(":");
|
|
14862
|
+
const firstSpace = /\s/.exec(arg);
|
|
14863
|
+
const firstAt = arg.indexOf("@");
|
|
14864
|
+
const spaceOnlyAfterHash = !firstSpace || firstHash > -1 && firstSpace.index > firstHash;
|
|
14865
|
+
const atOnlyAfterHash = firstAt === -1 || firstHash > -1 && firstAt > firstHash;
|
|
14866
|
+
const colonOnlyAfterHash = firstColon === -1 || firstHash > -1 && firstColon > firstHash;
|
|
14867
|
+
const secondSlashOnlyAfterHash = secondSlash === -1 || firstHash > -1 && secondSlash > firstHash;
|
|
14868
|
+
const hasSlash = firstSlash > 0;
|
|
14869
|
+
const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== "/" : !arg.endsWith("/");
|
|
14870
|
+
const doesNotStartWithDot = !arg.startsWith(".");
|
|
14871
|
+
return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash;
|
|
14872
|
+
};
|
|
14873
|
+
module.exports = (giturl, opts, { gitHosts, protocols }) => {
|
|
14874
|
+
if (!giturl) {
|
|
14875
|
+
return;
|
|
14876
|
+
}
|
|
14877
|
+
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
|
|
14878
|
+
const parsed = parseUrl(correctedUrl, protocols);
|
|
14879
|
+
if (!parsed) {
|
|
14880
|
+
return;
|
|
14881
|
+
}
|
|
14882
|
+
const gitHostShortcut = gitHosts.byShortcut[parsed.protocol];
|
|
14883
|
+
const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname];
|
|
14884
|
+
const gitHostName = gitHostShortcut || gitHostDomain;
|
|
14885
|
+
if (!gitHostName) {
|
|
14886
|
+
return;
|
|
14887
|
+
}
|
|
14888
|
+
const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain];
|
|
14889
|
+
let auth = null;
|
|
14890
|
+
if (protocols[parsed.protocol]?.auth && (parsed.username || parsed.password)) {
|
|
14891
|
+
auth = `${parsed.username}${parsed.password ? ":" + parsed.password : ""}`;
|
|
14892
|
+
}
|
|
14893
|
+
let committish = null;
|
|
14894
|
+
let user = null;
|
|
14895
|
+
let project = null;
|
|
14896
|
+
let defaultRepresentation = null;
|
|
14897
|
+
try {
|
|
14898
|
+
if (gitHostShortcut) {
|
|
14899
|
+
let pathname = parsed.pathname.startsWith("/") ? parsed.pathname.slice(1) : parsed.pathname;
|
|
14900
|
+
const firstAt = pathname.indexOf("@");
|
|
14901
|
+
if (firstAt > -1) {
|
|
14902
|
+
pathname = pathname.slice(firstAt + 1);
|
|
14903
|
+
}
|
|
14904
|
+
const lastSlash = pathname.lastIndexOf("/");
|
|
14905
|
+
if (lastSlash > -1) {
|
|
14906
|
+
user = decodeURIComponent(pathname.slice(0, lastSlash));
|
|
14907
|
+
if (!user) {
|
|
14908
|
+
user = null;
|
|
14909
|
+
}
|
|
14910
|
+
project = decodeURIComponent(pathname.slice(lastSlash + 1));
|
|
14911
|
+
} else {
|
|
14912
|
+
project = decodeURIComponent(pathname);
|
|
14913
|
+
}
|
|
14914
|
+
if (project.endsWith(".git")) {
|
|
14915
|
+
project = project.slice(0, -4);
|
|
14916
|
+
}
|
|
14917
|
+
if (parsed.hash) {
|
|
14918
|
+
committish = decodeURIComponent(parsed.hash.slice(1));
|
|
14919
|
+
}
|
|
14920
|
+
defaultRepresentation = "shortcut";
|
|
14921
|
+
} else {
|
|
14922
|
+
if (!gitHostInfo.protocols.includes(parsed.protocol)) {
|
|
14923
|
+
return;
|
|
14924
|
+
}
|
|
14925
|
+
const segments = gitHostInfo.extract(parsed);
|
|
14926
|
+
if (!segments) {
|
|
14927
|
+
return;
|
|
14928
|
+
}
|
|
14929
|
+
user = segments.user && decodeURIComponent(segments.user);
|
|
14930
|
+
project = decodeURIComponent(segments.project);
|
|
14931
|
+
committish = decodeURIComponent(segments.committish);
|
|
14932
|
+
defaultRepresentation = protocols[parsed.protocol]?.name || parsed.protocol.slice(0, -1);
|
|
14933
|
+
}
|
|
14934
|
+
} catch (err) {
|
|
14935
|
+
if (err instanceof URIError) {
|
|
14936
|
+
return;
|
|
14937
|
+
} else {
|
|
14938
|
+
throw err;
|
|
14939
|
+
}
|
|
14940
|
+
}
|
|
14941
|
+
return [gitHostName, user, auth, project, committish, defaultRepresentation, opts];
|
|
14942
|
+
};
|
|
14943
|
+
}
|
|
14944
|
+
});
|
|
14945
|
+
|
|
14946
|
+
// node_modules/hosted-git-info/lib/index.js
|
|
14947
|
+
var require_lib6 = __commonJS({
|
|
14948
|
+
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
14949
|
+
"use strict";
|
|
14950
|
+
var { LRUCache } = require_index_min2();
|
|
14951
|
+
var hosts = require_hosts2();
|
|
14952
|
+
var fromUrl = require_from_url2();
|
|
14953
|
+
var parseUrl = require_parse_url2();
|
|
14954
|
+
var cache2 = new LRUCache({ max: 1e3 });
|
|
14955
|
+
function unknownHostedUrl(url) {
|
|
14956
|
+
try {
|
|
14957
|
+
const {
|
|
14958
|
+
protocol,
|
|
14959
|
+
hostname,
|
|
14960
|
+
pathname
|
|
14961
|
+
} = new URL(url);
|
|
14962
|
+
if (!hostname) {
|
|
14963
|
+
return null;
|
|
14964
|
+
}
|
|
14965
|
+
const proto = /(?:git\+)http:$/.test(protocol) ? "http:" : "https:";
|
|
14966
|
+
const path26 = pathname.replace(/\.git$/, "");
|
|
14967
|
+
return `${proto}//${hostname}${path26}`;
|
|
14968
|
+
} catch {
|
|
14969
|
+
return null;
|
|
14970
|
+
}
|
|
14971
|
+
}
|
|
14972
|
+
var GitHost = class _GitHost {
|
|
14973
|
+
constructor(type2, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
14974
|
+
Object.assign(this, _GitHost.#gitHosts[type2], {
|
|
14975
|
+
type: type2,
|
|
14976
|
+
user,
|
|
14977
|
+
auth,
|
|
14978
|
+
project,
|
|
14979
|
+
committish,
|
|
14980
|
+
default: defaultRepresentation,
|
|
14981
|
+
opts
|
|
14982
|
+
});
|
|
14983
|
+
}
|
|
14984
|
+
static #gitHosts = { byShortcut: {}, byDomain: {} };
|
|
14985
|
+
static #protocols = {
|
|
14986
|
+
"git+ssh:": { name: "sshurl" },
|
|
14987
|
+
"ssh:": { name: "sshurl" },
|
|
14988
|
+
"git+https:": { name: "https", auth: true },
|
|
14989
|
+
"git:": { auth: true },
|
|
14990
|
+
"http:": { auth: true },
|
|
14991
|
+
"https:": { auth: true },
|
|
14992
|
+
"git+http:": { auth: true }
|
|
14993
|
+
};
|
|
14994
|
+
static addHost(name, host) {
|
|
14995
|
+
_GitHost.#gitHosts[name] = host;
|
|
14996
|
+
_GitHost.#gitHosts.byDomain[host.domain] = name;
|
|
14997
|
+
_GitHost.#gitHosts.byShortcut[`${name}:`] = name;
|
|
14998
|
+
_GitHost.#protocols[`${name}:`] = { name };
|
|
14999
|
+
}
|
|
15000
|
+
static fromUrl(giturl, opts) {
|
|
15001
|
+
if (typeof giturl !== "string") {
|
|
15002
|
+
return;
|
|
15003
|
+
}
|
|
15004
|
+
const key = giturl + JSON.stringify(opts || {});
|
|
15005
|
+
if (!cache2.has(key)) {
|
|
15006
|
+
const hostArgs = fromUrl(giturl, opts, {
|
|
15007
|
+
gitHosts: _GitHost.#gitHosts,
|
|
15008
|
+
protocols: _GitHost.#protocols
|
|
15009
|
+
});
|
|
15010
|
+
cache2.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0);
|
|
13863
15011
|
}
|
|
15012
|
+
return cache2.get(key);
|
|
13864
15013
|
}
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
if (
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
if (checked !== null) {
|
|
13878
|
-
return checked;
|
|
13879
|
-
}
|
|
15014
|
+
static fromManifest(manifest, opts = {}) {
|
|
15015
|
+
if (!manifest || typeof manifest !== "object") {
|
|
15016
|
+
return;
|
|
15017
|
+
}
|
|
15018
|
+
const r = manifest.repository;
|
|
15019
|
+
const rurl = r && (typeof r === "string" ? r : typeof r === "object" && typeof r.url === "string" ? r.url : null);
|
|
15020
|
+
if (!rurl) {
|
|
15021
|
+
throw new Error("no repository");
|
|
15022
|
+
}
|
|
15023
|
+
const info = rurl && _GitHost.fromUrl(rurl.replace(/^git\+/, ""), opts) || null;
|
|
15024
|
+
if (info) {
|
|
15025
|
+
return info;
|
|
13880
15026
|
}
|
|
15027
|
+
const unk = unknownHostedUrl(rurl);
|
|
15028
|
+
return _GitHost.fromUrl(unk, opts) || unk;
|
|
13881
15029
|
}
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
module.exports = function(identifier, options) {
|
|
13885
|
-
options = options || {};
|
|
13886
|
-
var upgrade = options.upgrade === void 0 ? true : !!options.upgrade;
|
|
13887
|
-
function postprocess(value) {
|
|
13888
|
-
return upgrade ? upgradeGPLs(value) : value;
|
|
15030
|
+
static parseUrl(url) {
|
|
15031
|
+
return parseUrl(url);
|
|
13889
15032
|
}
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
|
|
15033
|
+
#fill(template, opts) {
|
|
15034
|
+
if (typeof template !== "function") {
|
|
15035
|
+
return null;
|
|
15036
|
+
}
|
|
15037
|
+
const options = { ...this, ...this.opts, ...opts };
|
|
15038
|
+
if (!options.path) {
|
|
15039
|
+
options.path = "";
|
|
15040
|
+
}
|
|
15041
|
+
if (options.path.startsWith("/")) {
|
|
15042
|
+
options.path = options.path.slice(1);
|
|
15043
|
+
}
|
|
15044
|
+
if (options.noCommittish) {
|
|
15045
|
+
options.committish = null;
|
|
15046
|
+
}
|
|
15047
|
+
const result = template(options);
|
|
15048
|
+
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
13893
15049
|
}
|
|
13894
|
-
|
|
13895
|
-
|
|
13896
|
-
return postprocess(identifier);
|
|
15050
|
+
hash() {
|
|
15051
|
+
return this.committish ? `#${this.committish}` : "";
|
|
13897
15052
|
}
|
|
13898
|
-
|
|
13899
|
-
|
|
13900
|
-
return postprocess(noPlus);
|
|
15053
|
+
ssh(opts) {
|
|
15054
|
+
return this.#fill(this.sshtemplate, opts);
|
|
13901
15055
|
}
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
return postprocess(transformed);
|
|
15056
|
+
sshurl(opts) {
|
|
15057
|
+
return this.#fill(this.sshurltemplate, opts);
|
|
13905
15058
|
}
|
|
13906
|
-
|
|
13907
|
-
if (
|
|
13908
|
-
return
|
|
15059
|
+
browse(path26, ...args) {
|
|
15060
|
+
if (typeof path26 !== "string") {
|
|
15061
|
+
return this.#fill(this.browsetemplate, path26);
|
|
13909
15062
|
}
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
return
|
|
15063
|
+
if (typeof args[0] !== "string") {
|
|
15064
|
+
return this.#fill(this.browsetreetemplate, { ...args[0], path: path26 });
|
|
15065
|
+
}
|
|
15066
|
+
return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
13914
15067
|
}
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
15068
|
+
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
15069
|
+
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
15070
|
+
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
15071
|
+
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
15072
|
+
// does not redirect to a different commit.
|
|
15073
|
+
browseFile(path26, ...args) {
|
|
15074
|
+
if (typeof args[0] !== "string") {
|
|
15075
|
+
return this.#fill(this.browseblobtemplate, { ...args[0], path: path26 });
|
|
15076
|
+
}
|
|
15077
|
+
return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
13918
15078
|
}
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
return postprocess(transformed);
|
|
15079
|
+
docs(opts) {
|
|
15080
|
+
return this.#fill(this.docstemplate, opts);
|
|
13922
15081
|
}
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
function upgradeGPLs(value) {
|
|
13926
|
-
if ([
|
|
13927
|
-
"GPL-1.0",
|
|
13928
|
-
"LGPL-1.0",
|
|
13929
|
-
"AGPL-1.0",
|
|
13930
|
-
"GPL-2.0",
|
|
13931
|
-
"LGPL-2.0",
|
|
13932
|
-
"AGPL-2.0",
|
|
13933
|
-
"LGPL-2.1"
|
|
13934
|
-
].indexOf(value) !== -1) {
|
|
13935
|
-
return value + "-only";
|
|
13936
|
-
} else if ([
|
|
13937
|
-
"GPL-1.0+",
|
|
13938
|
-
"GPL-2.0+",
|
|
13939
|
-
"GPL-3.0+",
|
|
13940
|
-
"LGPL-2.0+",
|
|
13941
|
-
"LGPL-2.1+",
|
|
13942
|
-
"LGPL-3.0+",
|
|
13943
|
-
"AGPL-1.0+",
|
|
13944
|
-
"AGPL-3.0+"
|
|
13945
|
-
].indexOf(value) !== -1) {
|
|
13946
|
-
return value.replace(/\+$/, "-or-later");
|
|
13947
|
-
} else if (["GPL-3.0", "LGPL-3.0", "AGPL-3.0"].indexOf(value) !== -1) {
|
|
13948
|
-
return value + "-or-later";
|
|
13949
|
-
} else {
|
|
13950
|
-
return value;
|
|
15082
|
+
bugs(opts) {
|
|
15083
|
+
return this.#fill(this.bugstemplate, opts);
|
|
13951
15084
|
}
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
});
|
|
13955
|
-
|
|
13956
|
-
// node_modules/validate-npm-package-license/index.js
|
|
13957
|
-
var require_validate_npm_package_license = __commonJS({
|
|
13958
|
-
"node_modules/validate-npm-package-license/index.js"(exports, module) {
|
|
13959
|
-
var parse2 = require_spdx_expression_parse();
|
|
13960
|
-
var correct = require_spdx_correct();
|
|
13961
|
-
var genericWarning = 'license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"';
|
|
13962
|
-
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
13963
|
-
function startsWith(prefix, string) {
|
|
13964
|
-
return string.slice(0, prefix.length) === prefix;
|
|
13965
|
-
}
|
|
13966
|
-
function usesLicenseRef(ast) {
|
|
13967
|
-
if (ast.hasOwnProperty("license")) {
|
|
13968
|
-
var license = ast.license;
|
|
13969
|
-
return startsWith("LicenseRef", license) || startsWith("DocumentRef", license);
|
|
13970
|
-
} else {
|
|
13971
|
-
return usesLicenseRef(ast.left) || usesLicenseRef(ast.right);
|
|
15085
|
+
https(opts) {
|
|
15086
|
+
return this.#fill(this.httpstemplate, opts);
|
|
13972
15087
|
}
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
var ast;
|
|
13976
|
-
try {
|
|
13977
|
-
ast = parse2(argument);
|
|
13978
|
-
} catch (e) {
|
|
13979
|
-
var match2;
|
|
13980
|
-
if (argument === "UNLICENSED" || argument === "UNLICENCED") {
|
|
13981
|
-
return {
|
|
13982
|
-
validForOldPackages: true,
|
|
13983
|
-
validForNewPackages: true,
|
|
13984
|
-
unlicensed: true
|
|
13985
|
-
};
|
|
13986
|
-
} else if (match2 = fileReferenceRE.exec(argument)) {
|
|
13987
|
-
return {
|
|
13988
|
-
validForOldPackages: true,
|
|
13989
|
-
validForNewPackages: true,
|
|
13990
|
-
inFile: match2[1]
|
|
13991
|
-
};
|
|
13992
|
-
} else {
|
|
13993
|
-
var result = {
|
|
13994
|
-
validForOldPackages: false,
|
|
13995
|
-
validForNewPackages: false,
|
|
13996
|
-
warnings: [genericWarning]
|
|
13997
|
-
};
|
|
13998
|
-
if (argument.trim().length !== 0) {
|
|
13999
|
-
var corrected = correct(argument);
|
|
14000
|
-
if (corrected) {
|
|
14001
|
-
result.warnings.push(
|
|
14002
|
-
'license is similar to the valid expression "' + corrected + '"'
|
|
14003
|
-
);
|
|
14004
|
-
}
|
|
14005
|
-
}
|
|
14006
|
-
return result;
|
|
14007
|
-
}
|
|
15088
|
+
git(opts) {
|
|
15089
|
+
return this.#fill(this.gittemplate, opts);
|
|
14008
15090
|
}
|
|
14009
|
-
|
|
14010
|
-
return
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
15091
|
+
shortcut(opts) {
|
|
15092
|
+
return this.#fill(this.shortcuttemplate, opts);
|
|
15093
|
+
}
|
|
15094
|
+
path(opts) {
|
|
15095
|
+
return this.#fill(this.pathtemplate, opts);
|
|
15096
|
+
}
|
|
15097
|
+
tarball(opts) {
|
|
15098
|
+
return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false });
|
|
15099
|
+
}
|
|
15100
|
+
file(path26, opts) {
|
|
15101
|
+
return this.#fill(this.filetemplate, { ...opts, path: path26 });
|
|
15102
|
+
}
|
|
15103
|
+
edit(path26, opts) {
|
|
15104
|
+
return this.#fill(this.edittemplate, { ...opts, path: path26 });
|
|
15105
|
+
}
|
|
15106
|
+
getDefaultRepresentation() {
|
|
15107
|
+
return this.default;
|
|
15108
|
+
}
|
|
15109
|
+
toString(opts) {
|
|
15110
|
+
if (this.default && typeof this[this.default] === "function") {
|
|
15111
|
+
return this[this.default](opts);
|
|
15112
|
+
}
|
|
15113
|
+
return this.sshurl(opts);
|
|
14022
15114
|
}
|
|
14023
15115
|
};
|
|
15116
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
15117
|
+
GitHost.addHost(name, host);
|
|
15118
|
+
}
|
|
15119
|
+
module.exports = GitHost;
|
|
14024
15120
|
}
|
|
14025
15121
|
});
|
|
14026
15122
|
|
|
@@ -14088,7 +15184,7 @@ var require_fixer = __commonJS({
|
|
|
14088
15184
|
var isValidSemver = require_valid();
|
|
14089
15185
|
var cleanSemver = require_clean();
|
|
14090
15186
|
var validateLicense = require_validate_npm_package_license();
|
|
14091
|
-
var hostedGitInfo =
|
|
15187
|
+
var hostedGitInfo = require_lib6();
|
|
14092
15188
|
var { isBuiltin } = __require("node:module");
|
|
14093
15189
|
var depTypes = ["dependencies", "devDependencies", "optionalDependencies"];
|
|
14094
15190
|
var extractDescription = require_extract_description();
|
|
@@ -28401,6 +29497,9 @@ var getCustomProtocol = (urlString) => {
|
|
|
28401
29497
|
try {
|
|
28402
29498
|
const { protocol } = new URL(urlString);
|
|
28403
29499
|
const hasAuthority = urlString.slice(0, protocol.length + 2).toLowerCase() === `${protocol}//`;
|
|
29500
|
+
if (protocol === "localhost:" && !hasAuthority && /^\d{1,5}([/?#]|$)/.test(urlString.slice(protocol.length))) {
|
|
29501
|
+
return void 0;
|
|
29502
|
+
}
|
|
28404
29503
|
if (protocol.endsWith(":") && (!protocol.includes(".") || hasAuthority) && !supportedProtocols.has(protocol)) {
|
|
28405
29504
|
return protocol;
|
|
28406
29505
|
}
|