@vltpkg/cli-js 1.0.0-rc.32 → 1.0.0-rc.33
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/{access-SQZRJLJA.js → access-VP3KSJ2M.js} +23 -12
- package/{bugs-BMZ5UERM.js → bugs-4ZQXJA4F.js} +19 -17
- package/{build-LGQI6OGM.js → build-P74RVUUP.js} +13 -9
- package/{cache-JWHNATAX.js → cache-J4J3ZWXP.js} +19 -14
- package/cache-unzip-src-unzip.js +434 -428
- package/{chunk-6YXVQ5HC.js → chunk-2PLIV3N3.js} +1 -27
- package/{chunk-ZUP6UTME.js → chunk-4RZDJQ5U.js} +42 -61
- package/{chunk-LEX7YPHR.js → chunk-4SSFBFB5.js} +123 -92
- package/{chunk-SDBTQF2Y.js → chunk-5COWONUB.js} +5 -5
- package/{chunk-5UXEBLLT.js → chunk-7KI6XHXZ.js} +68 -7
- package/{chunk-R44FR7BY.js → chunk-7NHXV6AH.js} +439 -433
- package/{chunk-FBTBHRPG.js → chunk-7TNSW6W3.js} +1 -1
- package/{chunk-DI2CYYXF.js → chunk-BAUMCTQK.js} +694 -440
- package/{chunk-FXDRM4ZO.js → chunk-CLVRCGOZ.js} +247 -235
- package/{chunk-YCQTLBWF.js → chunk-CNSTFT7U.js} +1 -1
- package/{chunk-SIXXDCBI.js → chunk-DJYKQWV2.js} +7 -7
- package/chunk-E74WGW5C.js +49 -0
- package/chunk-EAWRHC27.js +75 -0
- package/{chunk-DFNHGGGV.js → chunk-EFWPI6IY.js} +1 -1
- package/{chunk-JBVLIV37.js → chunk-EQ633HIM.js} +14 -13
- package/{chunk-DM3WGEVB.js → chunk-F2FKLPZD.js} +7 -7
- package/chunk-FAG776ZD.js +137 -0
- package/{chunk-HQ4US6G3.js → chunk-FWKQ7YDF.js} +1049 -980
- package/{chunk-G6PG3AGN.js → chunk-GTICKXWZ.js} +11 -8
- package/{chunk-KRGA5VLT.js → chunk-ICJRCXSG.js} +31 -27
- package/{chunk-3TVABXAG.js → chunk-JEE4B4FL.js} +3 -3
- package/{chunk-7XE7OES7.js → chunk-JLGPPV6Z.js} +3 -3
- package/{chunk-M2WD7IBO.js → chunk-JZQAUAHT.js} +1 -1
- package/{chunk-IAKUGHGT.js → chunk-MT76WHSM.js} +1 -1
- package/{chunk-DIKKTUBV.js → chunk-OTNMX4EK.js} +3 -3
- package/{chunk-2V4AQPBR.js → chunk-PMCAQG5J.js} +85 -46
- package/{chunk-JKAZKVQU.js → chunk-PW6S6AIO.js} +15 -11
- package/{chunk-NLFBANVO.js → chunk-SSN4CYZF.js} +18 -2
- package/chunk-UBLFPJHV.js +40 -0
- package/{chunk-YQXDHMHG.js → chunk-VGWEB64T.js} +2932 -2786
- package/{chunk-LRPTCGTW.js → chunk-XA47WS4N.js} +11 -15
- package/{chunk-XFQ2EH5D.js → chunk-XIJFEV6U.js} +3 -3
- package/{ci-FQJANSQW.js → ci-GIDCFAZF.js} +14 -10
- package/cli-package.json +6 -2
- package/{config-4KQTTXJH.js → config-LIQMIMTF.js} +15 -13
- package/{config-LRL3N7TN.js → config-NBO3COMM.js} +13 -11
- package/{create-KN6AXEA6.js → create-K2S3J62I.js} +24 -19
- package/{deprecate-P26WHVFB.js → deprecate-4PJKNFXN.js} +22 -14
- package/{devtools-6NFQDW4L.js → devtools-HGLF4KAO.js} +82 -28
- package/{dist-tag-FA2BT7SA.js → dist-tag-TA6LWT2V.js} +16 -9
- package/{docs-OAPIY4SC.js → docs-ZCMIKQAN.js} +19 -17
- package/{exec-CVZGHJZS.js → exec-XVF4KCRJ.js} +24 -19
- package/{exec-cache-3AHODVRN.js → exec-cache-2IWJNBFB.js} +22 -17
- package/{exec-local-I4OJX76E.js → exec-local-FNFTQYFP.js} +17 -14
- package/{help-QFIQSPNS.js → help-ZDRILKVQ.js} +5 -4
- package/{init-QLADIAP5.js → init-VMYJE5Q3.js} +12 -10
- package/{install-B7CU2BLC.js → install-ZHMWN27D.js} +27 -12
- package/{list-OTFV3LOM.js → list-BPFKWXCR.js} +20 -15
- package/{login-LG2ZOIDQ.js → login-DQL5A4NT.js} +23 -9
- package/{logout-KUI773AM.js → logout-Q74VRDSN.js} +19 -8
- package/{pack-C55TTBIQ.js → pack-GLURO5KY.js} +17 -13
- package/package.json +8 -1
- package/{ping-VNUOC26G.js → ping-PPEYPKZD.js} +17 -10
- package/{pkg-H4RJEBK5.js → pkg-UTEKJ5CB.js} +13 -11
- package/{profile-DIJ5JUSE.js → profile-5QFRWC2L.js} +16 -8
- package/{publish-XF2TRBPH.js → publish-5VDI3JXX.js} +23 -16
- package/{query-BGP5JMJ7.js → query-I6DZ7TF2.js} +20 -15
- package/registry-ZVO3VAHY.js +117 -0
- package/registry-client-package.json +6 -2
- package/registry-client-src-revalidate.js +1233 -975
- package/{repo-NCEHK7KB.js → repo-SB3C7MZZ.js} +19 -17
- package/{reporter-OB6SNHOZ.js → reporter-2XBYWAVU.js} +3 -2
- package/{run-ZNJJYEJF.js → run-U6CW5Q56.js} +17 -14
- package/{run-exec-F5OV7MVN.js → run-exec-RFB572AL.js} +19 -14
- package/security-archive-src-update-expired.js +16 -11
- package/setup-BFKUYGJB.js +181 -0
- package/{src-M3WI7TSB.js → src-ZWBXAZOV.js} +25 -17
- package/{token-KXCVRJGF.js → token-M5HPJJJQ.js} +20 -9
- package/{uninstall-33SUWR6K.js → uninstall-UUBTM4ZQ.js} +15 -11
- package/{unpublish-7AZPBZF2.js → unpublish-WDSRB6DV.js} +17 -9
- package/{update-2EQF6IKZ.js → update-J4BEFJRC.js} +14 -10
- package/{version-HFYI3SEX.js → version-ZVG66SKC.js} +12 -10
- package/{view-C5OT36OB.js → view-WFK75G74.js} +19 -15
- package/vlr.js +1 -1
- package/vlrx.js +1 -1
- package/vlt.js +1 -1
- package/vlx.js +1 -1
- package/vlxl.js +1 -1
- package/{whoami-KKFV3XR6.js → whoami-TCSDOBU2.js} +19 -8
- package/chunk-FXIBCUIM.js +0 -73
|
@@ -14,50 +14,56 @@ import {
|
|
|
14
14
|
__require
|
|
15
15
|
} from "./chunk-PZLD7RTK.js";
|
|
16
16
|
|
|
17
|
-
// ../../node_modules/.vlt/~npm~lru-cache@11.
|
|
17
|
+
// ../../node_modules/.vlt/~npm~lru-cache@11.5.2/node_modules/lru-cache/dist/commonjs/node/index.min.js
|
|
18
18
|
var require_index_min = __commonJS({
|
|
19
|
-
"../../node_modules/.vlt/~npm~lru-cache@11.
|
|
19
|
+
"../../node_modules/.vlt/~npm~lru-cache@11.5.2/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
|
|
20
20
|
"use strict";
|
|
21
|
-
var
|
|
22
|
-
var
|
|
21
|
+
var j = (u, t) => () => (t || u((t = { exports: {} }).exports, t), t.exports);
|
|
22
|
+
var I = j((O) => {
|
|
23
23
|
"use strict";
|
|
24
24
|
Object.defineProperty(O, "__esModule", { value: true });
|
|
25
25
|
O.tracing = O.metrics = void 0;
|
|
26
|
-
var
|
|
27
|
-
O.metrics = (0,
|
|
28
|
-
O.tracing = (0,
|
|
26
|
+
var U = __require("node:diagnostics_channel");
|
|
27
|
+
O.metrics = (0, U.channel)("lru-cache:metrics");
|
|
28
|
+
O.tracing = (0, U.tracingChannel)("lru-cache");
|
|
29
|
+
});
|
|
30
|
+
var P = j((R) => {
|
|
31
|
+
"use strict";
|
|
32
|
+
Object.defineProperty(R, "__esModule", { value: true });
|
|
33
|
+
R.defaultPerf = void 0;
|
|
34
|
+
R.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
29
35
|
});
|
|
30
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
37
|
exports.LRUCache = void 0;
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
typeof
|
|
38
|
+
var g = I();
|
|
39
|
+
var N = P();
|
|
40
|
+
var C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers;
|
|
41
|
+
var k = /* @__PURE__ */ new Set();
|
|
42
|
+
var G = typeof process == "object" && process ? process : {};
|
|
43
|
+
var V = (u, t, e, i) => {
|
|
44
|
+
typeof G.emitWarning == "function" ? G.emitWarning(u, t, e, i) : console.error(`[${e}] ${t}: ${u}`);
|
|
39
45
|
};
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
46
|
+
var q = (u) => !k.has(u);
|
|
47
|
+
var T = (u) => !!u && u === Math.floor(u) && u > 0 && isFinite(u);
|
|
48
|
+
var H = (u) => T(u) ? u <= Math.pow(2, 8) ? Uint8Array : u <= Math.pow(2, 16) ? Uint16Array : u <= Math.pow(2, 32) ? Uint32Array : u <= Number.MAX_SAFE_INTEGER ? W : null : null;
|
|
43
49
|
var W = class extends Array {
|
|
44
50
|
constructor(t) {
|
|
45
51
|
super(t), this.fill(0);
|
|
46
52
|
}
|
|
47
53
|
};
|
|
48
|
-
var
|
|
54
|
+
var L = class u {
|
|
49
55
|
heap;
|
|
50
56
|
length;
|
|
51
57
|
static #o = false;
|
|
52
58
|
static create(t) {
|
|
53
|
-
let e =
|
|
59
|
+
let e = H(t);
|
|
54
60
|
if (!e) return [];
|
|
55
|
-
|
|
56
|
-
let i = new
|
|
57
|
-
return
|
|
61
|
+
u.#o = true;
|
|
62
|
+
let i = new u(t, e);
|
|
63
|
+
return u.#o = false, i;
|
|
58
64
|
}
|
|
59
65
|
constructor(t, e) {
|
|
60
|
-
if (!
|
|
66
|
+
if (!u.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
61
67
|
this.heap = new e(t), this.length = 0;
|
|
62
68
|
}
|
|
63
69
|
push(t) {
|
|
@@ -67,17 +73,17 @@ var require_index_min = __commonJS({
|
|
|
67
73
|
return this.heap[--this.length];
|
|
68
74
|
}
|
|
69
75
|
};
|
|
70
|
-
var
|
|
76
|
+
var M = class u {
|
|
71
77
|
#o;
|
|
72
78
|
#c;
|
|
73
79
|
#m;
|
|
74
|
-
#
|
|
75
|
-
#w;
|
|
76
|
-
#M;
|
|
77
|
-
#j;
|
|
80
|
+
#W;
|
|
78
81
|
#S;
|
|
82
|
+
#x;
|
|
83
|
+
#j;
|
|
84
|
+
#w;
|
|
79
85
|
get perf() {
|
|
80
|
-
return this.#
|
|
86
|
+
return this.#w;
|
|
81
87
|
}
|
|
82
88
|
ttl;
|
|
83
89
|
ttlResolution;
|
|
@@ -94,6 +100,7 @@ var require_index_min = __commonJS({
|
|
|
94
100
|
allowStaleOnFetchAbort;
|
|
95
101
|
allowStaleOnFetchRejection;
|
|
96
102
|
ignoreFetchAbort;
|
|
103
|
+
backgroundFetchSize;
|
|
97
104
|
#n;
|
|
98
105
|
#b;
|
|
99
106
|
#s;
|
|
@@ -103,22 +110,22 @@ var require_index_min = __commonJS({
|
|
|
103
110
|
#u;
|
|
104
111
|
#a;
|
|
105
112
|
#h;
|
|
106
|
-
#y;
|
|
107
|
-
#r;
|
|
108
113
|
#_;
|
|
114
|
+
#r;
|
|
115
|
+
#y;
|
|
109
116
|
#F;
|
|
110
117
|
#d;
|
|
111
118
|
#g;
|
|
112
119
|
#T;
|
|
113
|
-
#O;
|
|
114
|
-
#f;
|
|
115
120
|
#U;
|
|
121
|
+
#f;
|
|
122
|
+
#R;
|
|
116
123
|
static unsafeExposeInternals(t) {
|
|
117
|
-
return { starts: t.#F, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#
|
|
124
|
+
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() {
|
|
118
125
|
return t.#a;
|
|
119
126
|
}, get tail() {
|
|
120
127
|
return t.#h;
|
|
121
|
-
}, free: t.#
|
|
128
|
+
}, free: t.#_, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i, s, n) => t.#G(e, i, s, n), moveToTail: (e) => t.#M(e), indexes: (e) => t.#A(e), rindexes: (e) => t.#z(e), isStale: (e) => t.#p(e) };
|
|
122
129
|
}
|
|
123
130
|
get max() {
|
|
124
131
|
return this.#o;
|
|
@@ -133,7 +140,7 @@ var require_index_min = __commonJS({
|
|
|
133
140
|
return this.#n;
|
|
134
141
|
}
|
|
135
142
|
get fetchMethod() {
|
|
136
|
-
return this.#
|
|
143
|
+
return this.#x;
|
|
137
144
|
}
|
|
138
145
|
get memoMethod() {
|
|
139
146
|
return this.#j;
|
|
@@ -142,111 +149,116 @@ var require_index_min = __commonJS({
|
|
|
142
149
|
return this.#m;
|
|
143
150
|
}
|
|
144
151
|
get onInsert() {
|
|
145
|
-
return this.#
|
|
152
|
+
return this.#W;
|
|
146
153
|
}
|
|
147
154
|
get disposeAfter() {
|
|
148
|
-
return this.#
|
|
155
|
+
return this.#S;
|
|
149
156
|
}
|
|
150
157
|
constructor(t) {
|
|
151
|
-
let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas:
|
|
152
|
-
if (
|
|
153
|
-
if (this.#
|
|
154
|
-
let
|
|
155
|
-
if (!
|
|
156
|
-
if (this.#o = e, this.#c =
|
|
158
|
+
let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: l, allowStale: h, dispose: r, onInsert: c, disposeAfter: w, noDisposeOnSet: y, noUpdateTTL: d, maxSize: p = 0, maxEntrySize: f = 0, sizeCalculation: _, fetchMethod: a, memoMethod: S, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: m, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: x = 1, perf: v } = t;
|
|
159
|
+
if (this.backgroundFetchSize = x, v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
160
|
+
if (this.#w = v ?? N.defaultPerf, e !== 0 && !T(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
161
|
+
let E = e ? H(e) : Array;
|
|
162
|
+
if (!E) throw new Error("invalid max value: " + e);
|
|
163
|
+
if (this.#o = e, this.#c = p, this.maxEntrySize = f || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
|
|
157
164
|
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
158
165
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
159
166
|
}
|
|
160
167
|
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
161
|
-
if (this.#j = S,
|
|
162
|
-
if (this.#
|
|
163
|
-
if (this.#c !== 0 && !
|
|
164
|
-
if (!
|
|
168
|
+
if (this.#j = S, a !== void 0 && typeof a != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
169
|
+
if (this.#x = a, this.#U = !!a, 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.#_ = L.create(e), this.#n = 0, this.#b = 0, typeof r == "function" && (this.#m = r), typeof c == "function" && (this.#W = c), typeof w == "function" ? (this.#S = w, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#m, this.#R = !!this.#W, this.#f = !!this.#S, this.noDisposeOnSet = !!y, this.noUpdateTTL = !!d, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!m, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
170
|
+
if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
171
|
+
if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
165
172
|
this.#X();
|
|
166
173
|
}
|
|
167
|
-
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!
|
|
168
|
-
if (!
|
|
169
|
-
this.#
|
|
174
|
+
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!l, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
|
|
175
|
+
if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
176
|
+
this.#k();
|
|
170
177
|
}
|
|
171
178
|
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
172
179
|
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
173
|
-
let
|
|
174
|
-
|
|
180
|
+
let D = "LRU_CACHE_UNBOUNDED";
|
|
181
|
+
q(D) && (k.add(D), V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", D, u));
|
|
175
182
|
}
|
|
176
183
|
}
|
|
177
184
|
getRemainingTTL(t) {
|
|
178
185
|
return this.#s.has(t) ? 1 / 0 : 0;
|
|
179
186
|
}
|
|
180
|
-
#
|
|
187
|
+
#k() {
|
|
181
188
|
let t = new W(this.#o), e = new W(this.#o);
|
|
182
189
|
this.#d = t, this.#F = e;
|
|
183
190
|
let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
184
|
-
this.#g = i, this.#
|
|
185
|
-
e[
|
|
186
|
-
}, this.#
|
|
187
|
-
e[
|
|
191
|
+
this.#g = i, this.#H = (h, r, c = this.#w.now()) => {
|
|
192
|
+
e[h] = r !== 0 ? c : 0, t[h] = r, s(h, r);
|
|
193
|
+
}, this.#D = (h) => {
|
|
194
|
+
e[h] = t[h] !== 0 ? this.#w.now() : 0, s(h, t[h]);
|
|
188
195
|
};
|
|
189
|
-
let s = this.ttlAutopurge ? (
|
|
190
|
-
if (i?.[
|
|
191
|
-
let
|
|
192
|
-
this.#p(
|
|
193
|
-
},
|
|
194
|
-
|
|
196
|
+
let s = this.ttlAutopurge ? (h, r) => {
|
|
197
|
+
if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
|
|
198
|
+
let c = setTimeout(() => {
|
|
199
|
+
this.#p(h) ? (this.#v(this.#i[h], "expire"), i[h] = void 0) : s(h, l(h));
|
|
200
|
+
}, r + 1);
|
|
201
|
+
c.unref && c.unref(), i[h] = c;
|
|
195
202
|
}
|
|
196
203
|
} : () => {
|
|
197
204
|
};
|
|
198
|
-
this.#E = (
|
|
199
|
-
if (t[
|
|
200
|
-
let
|
|
201
|
-
if (!
|
|
202
|
-
|
|
203
|
-
let
|
|
204
|
-
|
|
205
|
+
this.#E = (h, r) => {
|
|
206
|
+
if (t[r]) {
|
|
207
|
+
let c = t[r], w = e[r];
|
|
208
|
+
if (!c || !w) return;
|
|
209
|
+
h.ttl = c, h.start = w, h.now = n || o();
|
|
210
|
+
let y = h.now - w;
|
|
211
|
+
h.remainingTTL = c - y;
|
|
205
212
|
}
|
|
206
213
|
};
|
|
207
214
|
let n = 0, o = () => {
|
|
208
|
-
let
|
|
215
|
+
let h = this.#w.now();
|
|
209
216
|
if (this.ttlResolution > 0) {
|
|
210
|
-
n =
|
|
211
|
-
let
|
|
212
|
-
|
|
217
|
+
n = h;
|
|
218
|
+
let r = setTimeout(() => n = 0, this.ttlResolution);
|
|
219
|
+
r.unref && r.unref();
|
|
213
220
|
}
|
|
214
|
-
return
|
|
221
|
+
return h;
|
|
222
|
+
};
|
|
223
|
+
this.getRemainingTTL = (h) => {
|
|
224
|
+
let r = this.#s.get(h);
|
|
225
|
+
return r === void 0 ? 0 : l(r);
|
|
226
|
+
};
|
|
227
|
+
let l = (h) => {
|
|
228
|
+
let r = t[h], c = e[h];
|
|
229
|
+
if (!r || !c) return 1 / 0;
|
|
230
|
+
let w = (n || o()) - c;
|
|
231
|
+
return r - w;
|
|
215
232
|
};
|
|
216
|
-
this
|
|
217
|
-
let h =
|
|
218
|
-
|
|
219
|
-
let a = t[h], d = e[h];
|
|
220
|
-
if (!a || !d) return 1 / 0;
|
|
221
|
-
let f = (n || o()) - d;
|
|
222
|
-
return a - f;
|
|
223
|
-
}, this.#p = (r) => {
|
|
224
|
-
let h = e[r], a = t[r];
|
|
225
|
-
return !!a && !!h && (n || o()) - h > a;
|
|
233
|
+
this.#p = (h) => {
|
|
234
|
+
let r = e[h], c = t[h];
|
|
235
|
+
return !!c && !!r && (n || o()) - r > c;
|
|
226
236
|
};
|
|
227
237
|
}
|
|
228
|
-
#
|
|
238
|
+
#D = () => {
|
|
229
239
|
};
|
|
230
240
|
#E = () => {
|
|
231
241
|
};
|
|
232
|
-
#
|
|
242
|
+
#H = () => {
|
|
233
243
|
};
|
|
234
244
|
#p = () => false;
|
|
235
245
|
#X() {
|
|
236
246
|
let t = new W(this.#o);
|
|
237
|
-
this.#b = 0, this.#
|
|
247
|
+
this.#b = 0, this.#y = t, this.#C = (e) => {
|
|
238
248
|
this.#b -= t[e], t[e] = 0;
|
|
239
|
-
}, this.#
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
|
|
249
|
+
}, this.#N = (e, i, s, n) => {
|
|
250
|
+
if (!T(s)) {
|
|
251
|
+
if (this.#e(i)) return this.backgroundFetchSize;
|
|
252
|
+
if (n) {
|
|
253
|
+
if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
|
|
254
|
+
if (s = n(i, e), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
255
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
256
|
+
}
|
|
245
257
|
return s;
|
|
246
258
|
}, this.#I = (e, i, s) => {
|
|
247
259
|
if (t[e] = i, this.#c) {
|
|
248
260
|
let n = this.#c - t[e];
|
|
249
|
-
for (; this.#b > n; ) this.#
|
|
261
|
+
for (; this.#b > n; ) this.#P(true);
|
|
250
262
|
}
|
|
251
263
|
this.#b += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
|
|
252
264
|
};
|
|
@@ -255,14 +267,14 @@ var require_index_min = __commonJS({
|
|
|
255
267
|
};
|
|
256
268
|
#I = (t, e, i) => {
|
|
257
269
|
};
|
|
258
|
-
#
|
|
270
|
+
#N = (t, e, i, s) => {
|
|
259
271
|
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
260
272
|
return 0;
|
|
261
273
|
};
|
|
262
274
|
*#A({ allowStale: t = this.allowStale } = {}) {
|
|
263
275
|
if (this.#n) for (let e = this.#h; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a); ) e = this.#u[e];
|
|
264
276
|
}
|
|
265
|
-
*#
|
|
277
|
+
*#z({ allowStale: t = this.allowStale } = {}) {
|
|
266
278
|
if (this.#n) for (let e = this.#a; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h); ) e = this.#l[e];
|
|
267
279
|
}
|
|
268
280
|
#V(t) {
|
|
@@ -272,7 +284,7 @@ var require_index_min = __commonJS({
|
|
|
272
284
|
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]]);
|
|
273
285
|
}
|
|
274
286
|
*rentries() {
|
|
275
|
-
for (let t of this.#
|
|
287
|
+
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]]);
|
|
276
288
|
}
|
|
277
289
|
*keys() {
|
|
278
290
|
for (let t of this.#A()) {
|
|
@@ -281,7 +293,7 @@ var require_index_min = __commonJS({
|
|
|
281
293
|
}
|
|
282
294
|
}
|
|
283
295
|
*rkeys() {
|
|
284
|
-
for (let t of this.#
|
|
296
|
+
for (let t of this.#z()) {
|
|
285
297
|
let e = this.#i[t];
|
|
286
298
|
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
287
299
|
}
|
|
@@ -290,7 +302,7 @@ var require_index_min = __commonJS({
|
|
|
290
302
|
for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
291
303
|
}
|
|
292
304
|
*rvalues() {
|
|
293
|
-
for (let t of this.#
|
|
305
|
+
for (let t of this.#z()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
294
306
|
}
|
|
295
307
|
[Symbol.iterator]() {
|
|
296
308
|
return this.entries();
|
|
@@ -299,7 +311,7 @@ var require_index_min = __commonJS({
|
|
|
299
311
|
find(t, e = {}) {
|
|
300
312
|
for (let i of this.#A()) {
|
|
301
313
|
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
302
|
-
if (n !== void 0 && t(n, this.#i[i], this)) return this.#
|
|
314
|
+
if (n !== void 0 && t(n, this.#i[i], this)) return this.#L(this.#i[i], e);
|
|
303
315
|
}
|
|
304
316
|
}
|
|
305
317
|
forEach(t, e = this) {
|
|
@@ -309,14 +321,14 @@ var require_index_min = __commonJS({
|
|
|
309
321
|
}
|
|
310
322
|
}
|
|
311
323
|
rforEach(t, e = this) {
|
|
312
|
-
for (let i of this.#
|
|
324
|
+
for (let i of this.#z()) {
|
|
313
325
|
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
314
326
|
n !== void 0 && t.call(e, n, this.#i[i], this);
|
|
315
327
|
}
|
|
316
328
|
}
|
|
317
329
|
purgeStale() {
|
|
318
330
|
let t = false;
|
|
319
|
-
for (let e of this.#
|
|
331
|
+
for (let e of this.#z({ allowStale: true })) this.#p(e) && (this.#v(this.#i[e], "expire"), t = true);
|
|
320
332
|
return t;
|
|
321
333
|
}
|
|
322
334
|
info(t) {
|
|
@@ -326,13 +338,13 @@ var require_index_min = __commonJS({
|
|
|
326
338
|
if (s === void 0) return;
|
|
327
339
|
let n = { value: s };
|
|
328
340
|
if (this.#d && this.#F) {
|
|
329
|
-
let o = this.#d[e],
|
|
330
|
-
if (o &&
|
|
331
|
-
let h = o - (this.#
|
|
341
|
+
let o = this.#d[e], l = this.#F[e];
|
|
342
|
+
if (o && l) {
|
|
343
|
+
let h = o - (this.#w.now() - l);
|
|
332
344
|
n.ttl = h, n.start = Date.now();
|
|
333
345
|
}
|
|
334
346
|
}
|
|
335
|
-
return this.#
|
|
347
|
+
return this.#y && (n.size = this.#y[e]), n;
|
|
336
348
|
}
|
|
337
349
|
dump() {
|
|
338
350
|
let t = [];
|
|
@@ -342,10 +354,10 @@ var require_index_min = __commonJS({
|
|
|
342
354
|
let o = { value: n };
|
|
343
355
|
if (this.#d && this.#F) {
|
|
344
356
|
o.ttl = this.#d[e];
|
|
345
|
-
let
|
|
346
|
-
o.start = Math.floor(Date.now() -
|
|
357
|
+
let l = this.#w.now() - this.#F[e];
|
|
358
|
+
o.start = Math.floor(Date.now() - l);
|
|
347
359
|
}
|
|
348
|
-
this.#
|
|
360
|
+
this.#y && (o.size = this.#y[e]), t.unshift([i, o]);
|
|
349
361
|
}
|
|
350
362
|
return t;
|
|
351
363
|
}
|
|
@@ -354,46 +366,44 @@ var require_index_min = __commonJS({
|
|
|
354
366
|
for (let [e, i] of t) {
|
|
355
367
|
if (i.start) {
|
|
356
368
|
let s = Date.now() - i.start;
|
|
357
|
-
i.start = this.#
|
|
369
|
+
i.start = this.#w.now() - s;
|
|
358
370
|
}
|
|
359
|
-
this.#
|
|
371
|
+
this.#O(e, i.value, i);
|
|
360
372
|
}
|
|
361
373
|
}
|
|
362
374
|
set(t, e, i = {}) {
|
|
363
|
-
let { status: s =
|
|
364
|
-
i.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e));
|
|
365
|
-
let n = this.#
|
|
366
|
-
return s &&
|
|
367
|
-
}
|
|
368
|
-
#
|
|
369
|
-
let { ttl:
|
|
370
|
-
if (e === void 0) return
|
|
371
|
-
let { noUpdateTTL:
|
|
372
|
-
|
|
373
|
-
let
|
|
374
|
-
if (this.maxEntrySize &&
|
|
375
|
-
let
|
|
376
|
-
if (
|
|
375
|
+
let { status: s = g.metrics.hasSubscribers ? {} : void 0 } = i;
|
|
376
|
+
i.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e), s.cache = this);
|
|
377
|
+
let n = this.#O(t, e, i);
|
|
378
|
+
return s && g.metrics.hasSubscribers && g.metrics.publish(s), n;
|
|
379
|
+
}
|
|
380
|
+
#O(t, e, i, s) {
|
|
381
|
+
let { ttl: n = this.ttl, start: o, noDisposeOnSet: l = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, c = this.#e(e);
|
|
382
|
+
if (e === void 0) return r && (r.set = "deleted"), this.delete(t), this;
|
|
383
|
+
let { noUpdateTTL: w = this.noUpdateTTL } = i;
|
|
384
|
+
r && !c && (r.value = e);
|
|
385
|
+
let y = this.#N(t, e, i.size || 0, h, r);
|
|
386
|
+
if (this.maxEntrySize && y > this.maxEntrySize) return this.#v(t, "set"), r && (r.set = "miss", r.maxEntrySizeExceeded = true), this;
|
|
387
|
+
let d = this.#n === 0 ? void 0 : this.#s.get(t);
|
|
388
|
+
if (d === void 0) d = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(false) : this.#n, this.#i[d] = t, this.#t[d] = e, this.#s.set(t, d), this.#l[this.#h] = d, this.#u[d] = this.#h, this.#h = d, this.#n++, this.#I(d, y, r), r && (r.set = "add"), w = false, this.#R && !c && this.#W?.(e, t, "add");
|
|
377
389
|
else {
|
|
378
|
-
this.#
|
|
379
|
-
let p = this.#t[
|
|
390
|
+
this.#M(d);
|
|
391
|
+
let p = this.#t[d];
|
|
380
392
|
if (e !== p) {
|
|
381
|
-
if (
|
|
382
|
-
p.__abortController.abort(new Error("replaced"));
|
|
383
|
-
let { __staleWhileFetching:
|
|
384
|
-
|
|
385
|
-
} else
|
|
386
|
-
if (this.#C(
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
m !== void 0 && (h.oldValue = m);
|
|
393
|
+
if (!l) if (this.#e(p)) {
|
|
394
|
+
p !== s && p.__abortController.abort(new Error("replaced"));
|
|
395
|
+
let { __staleWhileFetching: f } = p;
|
|
396
|
+
f !== void 0 && f !== e && (this.#T && this.#m?.(f, t, "set"), this.#f && this.#r?.push([f, t, "set"]));
|
|
397
|
+
} else this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([p, t, "set"]);
|
|
398
|
+
if (this.#C(d), this.#I(d, y, r), this.#t[d] = e, !c) {
|
|
399
|
+
let f = p && this.#e(p) ? p.__staleWhileFetching : p, _ = f === void 0 ? "add" : e !== f ? "replace" : "update";
|
|
400
|
+
r && (r.set = _, f !== void 0 && (r.oldValue = f)), this.#R && this.onInsert?.(e, t, _);
|
|
390
401
|
}
|
|
391
|
-
} else
|
|
392
|
-
this.#U && this.onInsert?.(e, t, e === p ? "update" : "replace");
|
|
402
|
+
} else c || (r && (r.set = "update"), this.#R && this.onInsert?.(e, t, "update"));
|
|
393
403
|
}
|
|
394
|
-
if (
|
|
395
|
-
let p = this.#r,
|
|
396
|
-
for (;
|
|
404
|
+
if (n !== 0 && !this.#d && this.#k(), this.#d && (w || this.#H(d, n, o), r && this.#E(r, d)), !l && this.#f && this.#r) {
|
|
405
|
+
let p = this.#r, f;
|
|
406
|
+
for (; f = p?.shift(); ) this.#S?.(...f);
|
|
397
407
|
}
|
|
398
408
|
return this;
|
|
399
409
|
}
|
|
@@ -401,26 +411,28 @@ var require_index_min = __commonJS({
|
|
|
401
411
|
try {
|
|
402
412
|
for (; this.#n; ) {
|
|
403
413
|
let t = this.#t[this.#a];
|
|
404
|
-
if (this.#
|
|
414
|
+
if (this.#P(true), this.#e(t)) {
|
|
405
415
|
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
406
416
|
} else if (t !== void 0) return t;
|
|
407
417
|
}
|
|
408
418
|
} finally {
|
|
409
419
|
if (this.#f && this.#r) {
|
|
410
420
|
let t = this.#r, e;
|
|
411
|
-
for (; e = t?.shift(); ) this.#
|
|
421
|
+
for (; e = t?.shift(); ) this.#S?.(...e);
|
|
412
422
|
}
|
|
413
423
|
}
|
|
414
424
|
}
|
|
415
|
-
#
|
|
416
|
-
let e = this.#a, i = this.#i[e], s = this.#t[e];
|
|
417
|
-
|
|
425
|
+
#P(t) {
|
|
426
|
+
let e = this.#a, i = this.#i[e], s = this.#t[e], n = this.#e(s);
|
|
427
|
+
n && s.__abortController.abort(new Error("evicted"));
|
|
428
|
+
let o = n ? s.__staleWhileFetching : s;
|
|
429
|
+
return (this.#T || this.#f) && o !== void 0 && (this.#T && this.#m?.(o, i, "evict"), this.#f && this.#r?.push([o, i, "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(i), this.#n--, e;
|
|
418
430
|
}
|
|
419
431
|
has(t, e = {}) {
|
|
420
|
-
let { status: i =
|
|
421
|
-
e.status = i, i && (i.op = "has", i.key = t);
|
|
432
|
+
let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
433
|
+
e.status = i, i && (i.op = "has", i.key = t, i.cache = this);
|
|
422
434
|
let s = this.#Y(t, e);
|
|
423
|
-
return
|
|
435
|
+
return g.metrics.hasSubscribers && g.metrics.publish(i), s;
|
|
424
436
|
}
|
|
425
437
|
#Y(t, e = {}) {
|
|
426
438
|
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = this.#s.get(t);
|
|
@@ -428,15 +440,15 @@ var require_index_min = __commonJS({
|
|
|
428
440
|
let o = this.#t[n];
|
|
429
441
|
if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
|
|
430
442
|
if (this.#p(n)) s && (s.has = "stale", this.#E(s, n));
|
|
431
|
-
else return i && this.#
|
|
443
|
+
else return i && this.#D(n), s && (s.has = "hit", this.#E(s, n)), true;
|
|
432
444
|
} else s && (s.has = "miss");
|
|
433
445
|
return false;
|
|
434
446
|
}
|
|
435
447
|
peek(t, e = {}) {
|
|
436
|
-
let { status: i =
|
|
437
|
-
i && (i.op = "peek", i.key = t), e.status = i;
|
|
448
|
+
let { status: i = C() ? {} : void 0 } = e;
|
|
449
|
+
i && (i.op = "peek", i.key = t, i.cache = this), e.status = i;
|
|
438
450
|
let s = this.#J(t, e);
|
|
439
|
-
return
|
|
451
|
+
return g.metrics.hasSubscribers && g.metrics.publish(i), s;
|
|
440
452
|
}
|
|
441
453
|
#J(t, e) {
|
|
442
454
|
let { status: i, allowStale: s = this.allowStale } = e, n = this.#s.get(t);
|
|
@@ -444,70 +456,70 @@ var require_index_min = __commonJS({
|
|
|
444
456
|
i && (i.peek = n === void 0 ? "miss" : "stale");
|
|
445
457
|
return;
|
|
446
458
|
}
|
|
447
|
-
let o = this.#t[n],
|
|
448
|
-
return i && (
|
|
459
|
+
let o = this.#t[n], l = this.#e(o) ? o.__staleWhileFetching : o;
|
|
460
|
+
return i && (l !== void 0 ? (i.peek = "hit", i.value = l) : i.peek = "miss"), l;
|
|
449
461
|
}
|
|
450
|
-
#
|
|
462
|
+
#G(t, e, i, s) {
|
|
451
463
|
let n = e === void 0 ? void 0 : this.#t[e];
|
|
452
464
|
if (this.#e(n)) return n;
|
|
453
|
-
let o = new AbortController(), { signal:
|
|
454
|
-
|
|
455
|
-
let h = { signal: o.signal, options: i, context: s },
|
|
456
|
-
let { aborted:
|
|
457
|
-
if (i.status && (
|
|
458
|
-
let b =
|
|
459
|
-
return (
|
|
460
|
-
},
|
|
461
|
-
let { aborted:
|
|
462
|
-
if (this.#t[e] ===
|
|
463
|
-
if (
|
|
464
|
-
},
|
|
465
|
-
let
|
|
466
|
-
|
|
467
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (
|
|
468
|
-
});
|
|
465
|
+
let o = new AbortController(), { signal: l } = i;
|
|
466
|
+
l?.addEventListener("abort", () => o.abort(l.reason), { signal: o.signal });
|
|
467
|
+
let h = { signal: o.signal, options: i, context: s }, r = (f, _ = false) => {
|
|
468
|
+
let { aborted: a } = o.signal, S = i.ignoreFetchAbort && f !== void 0, F = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
|
|
469
|
+
if (i.status && (a && !_ ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), a && !S && !_) return w(o.signal.reason, F);
|
|
470
|
+
let b = d, m = this.#t[e];
|
|
471
|
+
return (m === d || m === void 0 && S && _) && (f === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[e] = b.__staleWhileFetching : this.#v(t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#O(t, f, h.options, b))), f;
|
|
472
|
+
}, c = (f) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = f), w(f, false)), w = (f, _) => {
|
|
473
|
+
let { aborted: a } = o.signal, S = a && i.allowStaleOnFetchAbort, F = S || i.allowStaleOnFetchRejection, b = F || i.noDeleteOnFetchRejection, m = d;
|
|
474
|
+
if (this.#t[e] === d && (!b || !_ && m.__staleWhileFetching === void 0 ? this.#v(t, "fetch") : S || (this.#t[e] = m.__staleWhileFetching)), F) return i.status && m.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), m.__staleWhileFetching;
|
|
475
|
+
if (m.__returned === m) throw f;
|
|
476
|
+
}, y = (f, _) => {
|
|
477
|
+
let a = this.#x?.(t, n, h);
|
|
478
|
+
o.signal.addEventListener("abort", () => {
|
|
479
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (S) => r(S, true)));
|
|
480
|
+
}), a && a instanceof Promise ? a.then((S) => f(S === void 0 ? void 0 : S), _) : a !== void 0 && f(a);
|
|
469
481
|
};
|
|
470
482
|
i.status && (i.status.fetchDispatched = true);
|
|
471
|
-
let
|
|
472
|
-
return e === void 0 ? (this.#
|
|
483
|
+
let d = new Promise(y).then(r, c), p = Object.assign(d, { __abortController: o, __staleWhileFetching: n, __returned: void 0 });
|
|
484
|
+
return e === void 0 ? (this.#O(t, p, { ...h.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = p, p;
|
|
473
485
|
}
|
|
474
486
|
#e(t) {
|
|
475
|
-
if (!this.#
|
|
487
|
+
if (!this.#U) return false;
|
|
476
488
|
let e = t;
|
|
477
489
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
|
|
478
490
|
}
|
|
479
491
|
fetch(t, e = {}) {
|
|
480
|
-
let i =
|
|
492
|
+
let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
481
493
|
e.status = s, s && e.context && (s.context = e.context);
|
|
482
494
|
let n = this.#q(t, e);
|
|
483
|
-
return s &&
|
|
495
|
+
return s && i && (s.trace = true, g.tracing.tracePromise(() => n, s).catch(() => {
|
|
484
496
|
})), n;
|
|
485
497
|
}
|
|
486
498
|
async #q(t, e = {}) {
|
|
487
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet:
|
|
488
|
-
if (
|
|
489
|
-
let
|
|
499
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: l = this.noDisposeOnSet, size: h = 0, sizeCalculation: r = this.sizeCalculation, noUpdateTTL: c = this.noUpdateTTL, noDeleteOnFetchRejection: w = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: y = this.allowStaleOnFetchRejection, ignoreFetchAbort: d = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: f, forceRefresh: _ = false, status: a, signal: S } = e;
|
|
500
|
+
if (a && (a.op = "fetch", a.key = t, _ && (a.forceRefresh = true), a.cache = this), !this.#U) return a && (a.fetch = "get"), this.#L(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: a });
|
|
501
|
+
let F = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: l, size: h, sizeCalculation: r, noUpdateTTL: c, noDeleteOnFetchRejection: w, allowStaleOnFetchRejection: y, allowStaleOnFetchAbort: p, ignoreFetchAbort: d, status: a, signal: S }, b = this.#s.get(t);
|
|
490
502
|
if (b === void 0) {
|
|
491
|
-
|
|
492
|
-
let
|
|
493
|
-
return
|
|
503
|
+
a && (a.fetch = "miss");
|
|
504
|
+
let m = this.#G(t, b, F, f);
|
|
505
|
+
return m.__returned = m;
|
|
494
506
|
} else {
|
|
495
|
-
let
|
|
496
|
-
if (this.#e(
|
|
497
|
-
let E = i &&
|
|
498
|
-
return
|
|
507
|
+
let m = this.#t[b];
|
|
508
|
+
if (this.#e(m)) {
|
|
509
|
+
let E = i && m.__staleWhileFetching !== void 0;
|
|
510
|
+
return a && (a.fetch = "inflight", E && (a.returnedStale = true)), E ? m.__staleWhileFetching : m.__returned = m;
|
|
499
511
|
}
|
|
500
512
|
let A = this.#p(b);
|
|
501
|
-
if (!
|
|
502
|
-
let
|
|
503
|
-
return
|
|
513
|
+
if (!_ && !A) return a && (a.fetch = "hit"), this.#M(b), s && this.#D(b), a && this.#E(a, b), m;
|
|
514
|
+
let z = this.#G(t, b, F, f), v = z.__staleWhileFetching !== void 0 && i;
|
|
515
|
+
return a && (a.fetch = A ? "stale" : "refresh", v && A && (a.returnedStale = true)), v ? z.__staleWhileFetching : z.__returned = z;
|
|
504
516
|
}
|
|
505
517
|
}
|
|
506
518
|
forceFetch(t, e = {}) {
|
|
507
|
-
let i =
|
|
519
|
+
let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
508
520
|
e.status = s, s && e.context && (s.context = e.context);
|
|
509
521
|
let n = this.#K(t, e);
|
|
510
|
-
return s &&
|
|
522
|
+
return s && i && (s.trace = true, g.tracing.tracePromise(() => n, s).catch(() => {
|
|
511
523
|
})), n;
|
|
512
524
|
}
|
|
513
525
|
async #K(t, e = {}) {
|
|
@@ -516,51 +528,51 @@ var require_index_min = __commonJS({
|
|
|
516
528
|
return i;
|
|
517
529
|
}
|
|
518
530
|
memo(t, e = {}) {
|
|
519
|
-
let { status: i =
|
|
520
|
-
e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context));
|
|
531
|
+
let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
532
|
+
e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context), i.cache = this);
|
|
521
533
|
let s = this.#Q(t, e);
|
|
522
|
-
return i && (i.value = s),
|
|
534
|
+
return i && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i), s;
|
|
523
535
|
}
|
|
524
536
|
#Q(t, e = {}) {
|
|
525
537
|
let i = this.#j;
|
|
526
538
|
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
527
|
-
let { context: s, status: n, forceRefresh: o, ...
|
|
539
|
+
let { context: s, status: n, forceRefresh: o, ...l } = e;
|
|
528
540
|
n && o && (n.forceRefresh = true);
|
|
529
|
-
let h = this.#
|
|
530
|
-
if (n && (n.memo =
|
|
531
|
-
let
|
|
532
|
-
return n && (n.value =
|
|
541
|
+
let h = this.#L(t, l), r = o || h === void 0;
|
|
542
|
+
if (n && (n.memo = r ? "miss" : "hit", r || (n.value = h)), !r) return h;
|
|
543
|
+
let c = i(t, h, { options: l, context: s });
|
|
544
|
+
return n && (n.value = c), this.#O(t, c, l), c;
|
|
533
545
|
}
|
|
534
546
|
get(t, e = {}) {
|
|
535
|
-
let { status: i =
|
|
536
|
-
e.status = i, i && (i.op = "get", i.key = t);
|
|
537
|
-
let s = this.#
|
|
538
|
-
return i && (s !== void 0 && (i.value = s),
|
|
539
|
-
}
|
|
540
|
-
#
|
|
541
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e,
|
|
542
|
-
if (
|
|
547
|
+
let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
548
|
+
e.status = i, i && (i.op = "get", i.key = t, i.cache = this);
|
|
549
|
+
let s = this.#L(t, e);
|
|
550
|
+
return i && (s !== void 0 && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i)), s;
|
|
551
|
+
}
|
|
552
|
+
#L(t, e = {}) {
|
|
553
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, l = this.#s.get(t);
|
|
554
|
+
if (l === void 0) {
|
|
543
555
|
o && (o.get = "miss");
|
|
544
556
|
return;
|
|
545
557
|
}
|
|
546
|
-
let h = this.#t[
|
|
547
|
-
return o && this.#E(o,
|
|
558
|
+
let h = this.#t[l], r = this.#e(h);
|
|
559
|
+
return o && this.#E(o, l), this.#p(l) ? r ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = true), h.__staleWhileFetching) : void 0) : (n || this.#v(t, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = true), h) : void 0) : (o && (o.get = r ? "fetching" : "hit"), this.#M(l), s && this.#D(l), r ? h.__staleWhileFetching : h);
|
|
548
560
|
}
|
|
549
561
|
#B(t, e) {
|
|
550
562
|
this.#u[e] = t, this.#l[t] = e;
|
|
551
563
|
}
|
|
552
|
-
#
|
|
564
|
+
#M(t) {
|
|
553
565
|
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);
|
|
554
566
|
}
|
|
555
567
|
delete(t) {
|
|
556
|
-
return this.#
|
|
568
|
+
return this.#v(t, "delete");
|
|
557
569
|
}
|
|
558
|
-
#
|
|
559
|
-
|
|
570
|
+
#v(t, e) {
|
|
571
|
+
g.metrics.hasSubscribers && g.metrics.publish({ op: "delete", delete: e, key: t, cache: this });
|
|
560
572
|
let i = false;
|
|
561
573
|
if (this.#n !== 0) {
|
|
562
574
|
let s = this.#s.get(t);
|
|
563
|
-
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g
|
|
575
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#$(e);
|
|
564
576
|
else {
|
|
565
577
|
this.#C(s);
|
|
566
578
|
let n = this.#t[s];
|
|
@@ -569,15 +581,15 @@ var require_index_min = __commonJS({
|
|
|
569
581
|
else {
|
|
570
582
|
let o = this.#u[s];
|
|
571
583
|
this.#l[o] = this.#l[s];
|
|
572
|
-
let
|
|
573
|
-
this.#u[
|
|
584
|
+
let l = this.#l[s];
|
|
585
|
+
this.#u[l] = this.#u[s];
|
|
574
586
|
}
|
|
575
|
-
this.#n--, this.#
|
|
587
|
+
this.#n--, this.#_.push(s);
|
|
576
588
|
}
|
|
577
589
|
}
|
|
578
590
|
if (this.#f && this.#r?.length) {
|
|
579
591
|
let s = this.#r, n;
|
|
580
|
-
for (; n = s?.shift(); ) this.#
|
|
592
|
+
for (; n = s?.shift(); ) this.#S?.(...n);
|
|
581
593
|
}
|
|
582
594
|
return i;
|
|
583
595
|
}
|
|
@@ -585,7 +597,7 @@ var require_index_min = __commonJS({
|
|
|
585
597
|
return this.#$("delete");
|
|
586
598
|
}
|
|
587
599
|
#$(t) {
|
|
588
|
-
for (let e of this.#
|
|
600
|
+
for (let e of this.#z({ allowStale: true })) {
|
|
589
601
|
let i = this.#t[e];
|
|
590
602
|
if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
|
|
591
603
|
else {
|
|
@@ -598,19 +610,19 @@ var require_index_min = __commonJS({
|
|
|
598
610
|
for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
|
|
599
611
|
this.#g?.fill(void 0);
|
|
600
612
|
}
|
|
601
|
-
if (this.#
|
|
613
|
+
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) {
|
|
602
614
|
let e = this.#r, i;
|
|
603
|
-
for (; i = e?.shift(); ) this.#
|
|
615
|
+
for (; i = e?.shift(); ) this.#S?.(...i);
|
|
604
616
|
}
|
|
605
617
|
}
|
|
606
618
|
};
|
|
607
|
-
exports.LRUCache =
|
|
619
|
+
exports.LRUCache = M;
|
|
608
620
|
}
|
|
609
621
|
});
|
|
610
622
|
|
|
611
|
-
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
623
|
+
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/hosts.js
|
|
612
624
|
var require_hosts = __commonJS({
|
|
613
|
-
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
625
|
+
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
614
626
|
"use strict";
|
|
615
627
|
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
616
628
|
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
@@ -687,7 +699,7 @@ var require_hosts = __commonJS({
|
|
|
687
699
|
treepath: "tree",
|
|
688
700
|
blobpath: "tree",
|
|
689
701
|
editpath: "-/edit",
|
|
690
|
-
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user
|
|
702
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/api/v4/projects/${maybeEncode(user + "/" + project)}/repository/archive.tar.gz?sha=${maybeEncode(committish || "HEAD")}`,
|
|
691
703
|
extract: (url) => {
|
|
692
704
|
const path = url.pathname.slice(1);
|
|
693
705
|
if (path.includes("/-/") || path.includes("/archive.tar.gz")) {
|
|
@@ -750,7 +762,7 @@ var require_hosts = __commonJS({
|
|
|
750
762
|
treepath: "tree",
|
|
751
763
|
blobpath: "tree",
|
|
752
764
|
filetemplate: ({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path}`,
|
|
753
|
-
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}
|
|
765
|
+
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}${maybeJoin("#", committish)}`,
|
|
754
766
|
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
755
767
|
bugstemplate: () => null,
|
|
756
768
|
extract: (url) => {
|
|
@@ -774,9 +786,9 @@ var require_hosts = __commonJS({
|
|
|
774
786
|
}
|
|
775
787
|
});
|
|
776
788
|
|
|
777
|
-
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
789
|
+
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/parse-url.js
|
|
778
790
|
var require_parse_url = __commonJS({
|
|
779
|
-
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
791
|
+
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
780
792
|
var url = __require("node:url");
|
|
781
793
|
var lastIndexOfBefore = (str, char, beforeChar) => {
|
|
782
794
|
const startPosition = str.indexOf(beforeChar);
|
|
@@ -825,9 +837,9 @@ var require_parse_url = __commonJS({
|
|
|
825
837
|
}
|
|
826
838
|
});
|
|
827
839
|
|
|
828
|
-
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
840
|
+
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/from-url.js
|
|
829
841
|
var require_from_url = __commonJS({
|
|
830
|
-
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
842
|
+
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
831
843
|
"use strict";
|
|
832
844
|
var parseUrl = require_parse_url();
|
|
833
845
|
var isGitHubShorthand = (arg) => {
|
|
@@ -919,9 +931,9 @@ var require_from_url = __commonJS({
|
|
|
919
931
|
}
|
|
920
932
|
});
|
|
921
933
|
|
|
922
|
-
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
934
|
+
// ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/index.js
|
|
923
935
|
var require_lib = __commonJS({
|
|
924
|
-
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.
|
|
936
|
+
"../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
925
937
|
"use strict";
|
|
926
938
|
var { LRUCache } = require_index_min();
|
|
927
939
|
var hosts = require_hosts();
|