@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
package/cache-unzip-src-unzip.js
CHANGED
|
@@ -34,38 +34,38 @@ import {
|
|
|
34
34
|
writeFile
|
|
35
35
|
} from "node:fs/promises";
|
|
36
36
|
|
|
37
|
-
// ../../node_modules/.vlt/~npm~lru-cache@11.
|
|
38
|
-
import { tracingChannel as
|
|
39
|
-
var S =
|
|
40
|
-
var W =
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
typeof
|
|
37
|
+
// ../../node_modules/.vlt/~npm~lru-cache@11.5.2/node_modules/lru-cache/dist/esm/node/index.min.js
|
|
38
|
+
import { tracingChannel as G, channel as P } from "node:diagnostics_channel";
|
|
39
|
+
var S = P("lru-cache:metrics");
|
|
40
|
+
var W = G("lru-cache");
|
|
41
|
+
var L = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
42
|
+
var R = () => S.hasSubscribers || W.hasSubscribers;
|
|
43
|
+
var U = /* @__PURE__ */ new Set();
|
|
44
|
+
var M = typeof process == "object" && process ? process : {};
|
|
45
|
+
var k = (d3, e, t, i) => {
|
|
46
|
+
typeof M.emitWarning == "function" ? M.emitWarning(d3, e, t, i) : console.error(`[${t}] ${e}: ${d3}`);
|
|
47
47
|
};
|
|
48
|
-
var H = (
|
|
49
|
-
var
|
|
50
|
-
var
|
|
48
|
+
var H = (d3) => !U.has(d3);
|
|
49
|
+
var T = (d3) => !!d3 && d3 === Math.floor(d3) && d3 > 0 && isFinite(d3);
|
|
50
|
+
var j = (d3) => T(d3) ? d3 <= Math.pow(2, 8) ? Uint8Array : d3 <= Math.pow(2, 16) ? Uint16Array : d3 <= Math.pow(2, 32) ? Uint32Array : d3 <= Number.MAX_SAFE_INTEGER ? O : null : null;
|
|
51
51
|
var O = class extends Array {
|
|
52
52
|
constructor(e) {
|
|
53
53
|
super(e), this.fill(0);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
var
|
|
56
|
+
var x = class d {
|
|
57
57
|
heap;
|
|
58
58
|
length;
|
|
59
59
|
static #o = false;
|
|
60
60
|
static create(e) {
|
|
61
|
-
let t =
|
|
61
|
+
let t = j(e);
|
|
62
62
|
if (!t) return [];
|
|
63
|
-
|
|
64
|
-
let i = new
|
|
65
|
-
return
|
|
63
|
+
d.#o = true;
|
|
64
|
+
let i = new d(e, t);
|
|
65
|
+
return d.#o = false, i;
|
|
66
66
|
}
|
|
67
67
|
constructor(e, t) {
|
|
68
|
-
if (!
|
|
68
|
+
if (!d.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
69
69
|
this.heap = new t(e), this.length = 0;
|
|
70
70
|
}
|
|
71
71
|
push(e) {
|
|
@@ -75,14 +75,14 @@ var R = class u {
|
|
|
75
75
|
return this.heap[--this.length];
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
var
|
|
78
|
+
var I = class d2 {
|
|
79
79
|
#o;
|
|
80
|
-
#
|
|
81
|
-
#w;
|
|
82
|
-
#D;
|
|
80
|
+
#c;
|
|
83
81
|
#S;
|
|
82
|
+
#O;
|
|
83
|
+
#w;
|
|
84
84
|
#M;
|
|
85
|
-
#
|
|
85
|
+
#I;
|
|
86
86
|
#m;
|
|
87
87
|
get perf() {
|
|
88
88
|
return this.#m;
|
|
@@ -102,14 +102,15 @@ var L = class u2 {
|
|
|
102
102
|
allowStaleOnFetchAbort;
|
|
103
103
|
allowStaleOnFetchRejection;
|
|
104
104
|
ignoreFetchAbort;
|
|
105
|
+
backgroundFetchSize;
|
|
105
106
|
#n;
|
|
106
107
|
#b;
|
|
107
108
|
#s;
|
|
108
109
|
#i;
|
|
109
110
|
#t;
|
|
110
|
-
#a;
|
|
111
|
-
#c;
|
|
112
111
|
#l;
|
|
112
|
+
#u;
|
|
113
|
+
#a;
|
|
113
114
|
#h;
|
|
114
115
|
#y;
|
|
115
116
|
#r;
|
|
@@ -118,12 +119,12 @@ var L = class u2 {
|
|
|
118
119
|
#d;
|
|
119
120
|
#g;
|
|
120
121
|
#T;
|
|
121
|
-
#
|
|
122
|
+
#U;
|
|
122
123
|
#f;
|
|
123
|
-
#
|
|
124
|
+
#D;
|
|
124
125
|
static unsafeExposeInternals(e) {
|
|
125
|
-
return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#
|
|
126
|
-
return e.#
|
|
126
|
+
return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#l, prev: e.#u, get head() {
|
|
127
|
+
return e.#a;
|
|
127
128
|
}, get tail() {
|
|
128
129
|
return e.#h;
|
|
129
130
|
}, free: e.#y, isBackgroundFetch: (t) => e.#e(t), backgroundFetch: (t, i, s, n7) => e.#P(t, i, s, n7), moveToTail: (t) => e.#L(t), indexes: (t) => e.#A(t), rindexes: (t) => e.#z(t), isStale: (t) => e.#p(t) };
|
|
@@ -132,7 +133,7 @@ var L = class u2 {
|
|
|
132
133
|
return this.#o;
|
|
133
134
|
}
|
|
134
135
|
get maxSize() {
|
|
135
|
-
return this.#
|
|
136
|
+
return this.#c;
|
|
136
137
|
}
|
|
137
138
|
get calculatedSize() {
|
|
138
139
|
return this.#b;
|
|
@@ -144,134 +145,139 @@ var L = class u2 {
|
|
|
144
145
|
return this.#M;
|
|
145
146
|
}
|
|
146
147
|
get memoMethod() {
|
|
147
|
-
return this.#
|
|
148
|
+
return this.#I;
|
|
148
149
|
}
|
|
149
150
|
get dispose() {
|
|
150
|
-
return this.#
|
|
151
|
+
return this.#S;
|
|
151
152
|
}
|
|
152
153
|
get onInsert() {
|
|
153
|
-
return this.#
|
|
154
|
+
return this.#O;
|
|
154
155
|
}
|
|
155
156
|
get disposeAfter() {
|
|
156
|
-
return this.#
|
|
157
|
+
return this.#w;
|
|
157
158
|
}
|
|
158
159
|
constructor(e) {
|
|
159
|
-
let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n7, updateAgeOnGet: o, updateAgeOnHas:
|
|
160
|
-
if (
|
|
161
|
-
if (this.#m =
|
|
162
|
-
let v2 = t ?
|
|
160
|
+
let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n7, updateAgeOnGet: o, updateAgeOnHas: l, allowStale: h, dispose: r, onInsert: c, disposeAfter: m, noDisposeOnSet: _2, noUpdateTTL: u, maxSize: g = 0, maxEntrySize: f = 0, sizeCalculation: y, fetchMethod: a, memoMethod: w, noDeleteOnFetchRejection: F2, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: A2, ignoreFetchAbort: z, backgroundFetchSize: C2 = 1, perf: E } = e;
|
|
161
|
+
if (this.backgroundFetchSize = C2, E !== void 0 && typeof E?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
162
|
+
if (this.#m = E ?? L, t !== 0 && !T(t)) throw new TypeError("max option must be a nonnegative integer");
|
|
163
|
+
let v2 = t ? j(t) : Array;
|
|
163
164
|
if (!v2) throw new Error("invalid max value: " + t);
|
|
164
|
-
if (this.#o = t, this.#
|
|
165
|
-
if (!this.#
|
|
165
|
+
if (this.#o = t, this.#c = g, this.maxEntrySize = f || this.#c, this.sizeCalculation = y, this.sizeCalculation) {
|
|
166
|
+
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
166
167
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
167
168
|
}
|
|
168
|
-
if (
|
|
169
|
-
if (this.#
|
|
170
|
-
if (this.#M = a, this.#
|
|
171
|
-
if (this.#
|
|
172
|
-
if (!
|
|
169
|
+
if (w !== void 0 && typeof w != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
170
|
+
if (this.#I = w, a !== void 0 && typeof a != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
171
|
+
if (this.#M = a, this.#U = !!a, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: t }).fill(void 0), this.#t = Array.from({ length: t }).fill(void 0), this.#l = new v2(t), this.#u = new v2(t), this.#a = 0, this.#h = 0, this.#y = x.create(t), this.#n = 0, this.#b = 0, typeof r == "function" && (this.#S = r), typeof c == "function" && (this.#O = c), typeof m == "function" ? (this.#w = m, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#S, this.#D = !!this.#O, this.#f = !!this.#w, this.noDisposeOnSet = !!_2, this.noUpdateTTL = !!u, this.noDeleteOnFetchRejection = !!F2, this.allowStaleOnFetchRejection = !!p, this.allowStaleOnFetchAbort = !!A2, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
172
|
+
if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
173
|
+
if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
173
174
|
this.#X();
|
|
174
175
|
}
|
|
175
|
-
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!
|
|
176
|
-
if (!
|
|
177
|
-
this.#
|
|
176
|
+
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!l, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n7, this.ttl = i || 0, this.ttl) {
|
|
177
|
+
if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
178
|
+
this.#k();
|
|
178
179
|
}
|
|
179
|
-
if (this.#o === 0 && this.ttl === 0 && this.#
|
|
180
|
-
if (!this.ttlAutopurge && !this.#o && !this.#
|
|
181
|
-
let
|
|
182
|
-
H(
|
|
180
|
+
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
181
|
+
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
182
|
+
let D2 = "LRU_CACHE_UNBOUNDED";
|
|
183
|
+
H(D2) && (U.add(D2), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", D2, d2));
|
|
183
184
|
}
|
|
184
185
|
}
|
|
185
186
|
getRemainingTTL(e) {
|
|
186
187
|
return this.#s.has(e) ? 1 / 0 : 0;
|
|
187
188
|
}
|
|
188
|
-
#
|
|
189
|
+
#k() {
|
|
189
190
|
let e = new O(this.#o), t = new O(this.#o);
|
|
190
191
|
this.#d = e, this.#F = t;
|
|
191
192
|
let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
192
|
-
this.#g = i, this.#
|
|
193
|
-
t[
|
|
194
|
-
}, this.#
|
|
195
|
-
t[
|
|
193
|
+
this.#g = i, this.#H = (h, r, c = this.#m.now()) => {
|
|
194
|
+
t[h] = r !== 0 ? c : 0, e[h] = r, s(h, r);
|
|
195
|
+
}, this.#R = (h) => {
|
|
196
|
+
t[h] = e[h] !== 0 ? this.#m.now() : 0, s(h, e[h]);
|
|
196
197
|
};
|
|
197
|
-
let s = this.ttlAutopurge ? (
|
|
198
|
-
if (i?.[
|
|
199
|
-
let
|
|
200
|
-
this.#p(
|
|
201
|
-
},
|
|
202
|
-
|
|
198
|
+
let s = this.ttlAutopurge ? (h, r) => {
|
|
199
|
+
if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
|
|
200
|
+
let c = setTimeout(() => {
|
|
201
|
+
this.#p(h) ? (this.#E(this.#i[h], "expire"), i[h] = void 0) : s(h, l(h));
|
|
202
|
+
}, r + 1);
|
|
203
|
+
c.unref && c.unref(), i[h] = c;
|
|
203
204
|
}
|
|
204
205
|
} : () => {
|
|
205
206
|
};
|
|
206
|
-
this.#
|
|
207
|
-
if (e[
|
|
208
|
-
let
|
|
209
|
-
if (!
|
|
210
|
-
|
|
211
|
-
let
|
|
212
|
-
|
|
207
|
+
this.#v = (h, r) => {
|
|
208
|
+
if (e[r]) {
|
|
209
|
+
let c = e[r], m = t[r];
|
|
210
|
+
if (!c || !m) return;
|
|
211
|
+
h.ttl = c, h.start = m, h.now = n7 || o();
|
|
212
|
+
let _2 = h.now - m;
|
|
213
|
+
h.remainingTTL = c - _2;
|
|
213
214
|
}
|
|
214
215
|
};
|
|
215
216
|
let n7 = 0, o = () => {
|
|
216
|
-
let
|
|
217
|
+
let h = this.#m.now();
|
|
217
218
|
if (this.ttlResolution > 0) {
|
|
218
|
-
n7 =
|
|
219
|
-
let
|
|
220
|
-
|
|
219
|
+
n7 = h;
|
|
220
|
+
let r = setTimeout(() => n7 = 0, this.ttlResolution);
|
|
221
|
+
r.unref && r.unref();
|
|
221
222
|
}
|
|
222
|
-
return
|
|
223
|
+
return h;
|
|
223
224
|
};
|
|
224
|
-
this.getRemainingTTL = (
|
|
225
|
-
let
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
let
|
|
230
|
-
return
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
this.getRemainingTTL = (h) => {
|
|
226
|
+
let r = this.#s.get(h);
|
|
227
|
+
return r === void 0 ? 0 : l(r);
|
|
228
|
+
};
|
|
229
|
+
let l = (h) => {
|
|
230
|
+
let r = e[h], c = t[h];
|
|
231
|
+
if (!r || !c) return 1 / 0;
|
|
232
|
+
let m = (n7 || o()) - c;
|
|
233
|
+
return r - m;
|
|
234
|
+
};
|
|
235
|
+
this.#p = (h) => {
|
|
236
|
+
let r = t[h], c = e[h];
|
|
237
|
+
return !!c && !!r && (n7 || o()) - r > c;
|
|
234
238
|
};
|
|
235
239
|
}
|
|
236
|
-
#
|
|
240
|
+
#R = () => {
|
|
237
241
|
};
|
|
238
|
-
#
|
|
242
|
+
#v = () => {
|
|
239
243
|
};
|
|
240
|
-
#
|
|
244
|
+
#H = () => {
|
|
241
245
|
};
|
|
242
246
|
#p = () => false;
|
|
243
247
|
#X() {
|
|
244
248
|
let e = new O(this.#o);
|
|
245
|
-
this.#b = 0, this.#_ = e, this.#
|
|
249
|
+
this.#b = 0, this.#_ = e, this.#x = (t) => {
|
|
246
250
|
this.#b -= e[t], e[t] = 0;
|
|
247
|
-
}, this.#
|
|
248
|
-
if (
|
|
249
|
-
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
}, this.#N = (t, i, s, n7) => {
|
|
252
|
+
if (!T(s)) {
|
|
253
|
+
if (this.#e(i)) return this.backgroundFetchSize;
|
|
254
|
+
if (n7) {
|
|
255
|
+
if (typeof n7 != "function") throw new TypeError("sizeCalculation must be a function");
|
|
256
|
+
if (s = n7(i, t), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
257
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
258
|
+
}
|
|
253
259
|
return s;
|
|
254
|
-
}, this.#
|
|
255
|
-
if (e[t] = i, this.#
|
|
256
|
-
let n7 = this.#
|
|
260
|
+
}, this.#j = (t, i, s) => {
|
|
261
|
+
if (e[t] = i, this.#c) {
|
|
262
|
+
let n7 = this.#c - e[t];
|
|
257
263
|
for (; this.#b > n7; ) this.#G(true);
|
|
258
264
|
}
|
|
259
265
|
this.#b += e[t], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
|
|
260
266
|
};
|
|
261
267
|
}
|
|
262
|
-
#
|
|
268
|
+
#x = (e) => {
|
|
263
269
|
};
|
|
264
|
-
#
|
|
270
|
+
#j = (e, t, i) => {
|
|
265
271
|
};
|
|
266
|
-
#
|
|
272
|
+
#N = (e, t, i, s) => {
|
|
267
273
|
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
268
274
|
return 0;
|
|
269
275
|
};
|
|
270
276
|
*#A({ allowStale: e = this.allowStale } = {}) {
|
|
271
|
-
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#
|
|
277
|
+
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#a); ) t = this.#u[t];
|
|
272
278
|
}
|
|
273
279
|
*#z({ allowStale: e = this.allowStale } = {}) {
|
|
274
|
-
if (this.#n) for (let t = this.#
|
|
280
|
+
if (this.#n) for (let t = this.#a; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#h); ) t = this.#l[t];
|
|
275
281
|
}
|
|
276
282
|
#V(e) {
|
|
277
283
|
return e !== void 0 && this.#s.get(this.#i[e]) === e;
|
|
@@ -324,7 +330,7 @@ var L = class u2 {
|
|
|
324
330
|
}
|
|
325
331
|
purgeStale() {
|
|
326
332
|
let e = false;
|
|
327
|
-
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#
|
|
333
|
+
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#E(this.#i[t], "expire"), e = true);
|
|
328
334
|
return e;
|
|
329
335
|
}
|
|
330
336
|
info(e) {
|
|
@@ -334,9 +340,9 @@ var L = class u2 {
|
|
|
334
340
|
if (s === void 0) return;
|
|
335
341
|
let n7 = { value: s };
|
|
336
342
|
if (this.#d && this.#F) {
|
|
337
|
-
let o = this.#d[t],
|
|
338
|
-
if (o &&
|
|
339
|
-
let h = o - (this.#m.now() -
|
|
343
|
+
let o = this.#d[t], l = this.#F[t];
|
|
344
|
+
if (o && l) {
|
|
345
|
+
let h = o - (this.#m.now() - l);
|
|
340
346
|
n7.ttl = h, n7.start = Date.now();
|
|
341
347
|
}
|
|
342
348
|
}
|
|
@@ -350,8 +356,8 @@ var L = class u2 {
|
|
|
350
356
|
let o = { value: n7 };
|
|
351
357
|
if (this.#d && this.#F) {
|
|
352
358
|
o.ttl = this.#d[t];
|
|
353
|
-
let
|
|
354
|
-
o.start = Math.floor(Date.now() -
|
|
359
|
+
let l = this.#m.now() - this.#F[t];
|
|
360
|
+
o.start = Math.floor(Date.now() - l);
|
|
355
361
|
}
|
|
356
362
|
this.#_ && (o.size = this.#_[t]), e.unshift([i, o]);
|
|
357
363
|
}
|
|
@@ -364,51 +370,49 @@ var L = class u2 {
|
|
|
364
370
|
let s = Date.now() - i.start;
|
|
365
371
|
i.start = this.#m.now() - s;
|
|
366
372
|
}
|
|
367
|
-
this.#
|
|
373
|
+
this.#W(t, i.value, i);
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
376
|
set(e, t, i = {}) {
|
|
371
377
|
let { status: s = S.hasSubscribers ? {} : void 0 } = i;
|
|
372
|
-
i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t));
|
|
373
|
-
let n7 = this.#
|
|
378
|
+
i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t), s.cache = this);
|
|
379
|
+
let n7 = this.#W(e, t, i);
|
|
374
380
|
return s && S.hasSubscribers && S.publish(s), n7;
|
|
375
381
|
}
|
|
376
|
-
#
|
|
377
|
-
let { ttl:
|
|
378
|
-
if (t === void 0) return
|
|
379
|
-
let { noUpdateTTL:
|
|
380
|
-
|
|
381
|
-
let
|
|
382
|
-
if (this.maxEntrySize &&
|
|
383
|
-
let
|
|
384
|
-
if (
|
|
382
|
+
#W(e, t, i, s) {
|
|
383
|
+
let { ttl: n7 = this.ttl, start: o, noDisposeOnSet: l = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, c = this.#e(t);
|
|
384
|
+
if (t === void 0) return r && (r.set = "deleted"), this.delete(e), this;
|
|
385
|
+
let { noUpdateTTL: m = this.noUpdateTTL } = i;
|
|
386
|
+
r && !c && (r.value = t);
|
|
387
|
+
let _2 = this.#N(e, t, i.size || 0, h, r);
|
|
388
|
+
if (this.maxEntrySize && _2 > this.maxEntrySize) return this.#E(e, "set"), r && (r.set = "miss", r.maxEntrySizeExceeded = true), this;
|
|
389
|
+
let u = this.#n === 0 ? void 0 : this.#s.get(e);
|
|
390
|
+
if (u === void 0) u = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(false) : this.#n, this.#i[u] = e, this.#t[u] = t, this.#s.set(e, u), this.#l[this.#h] = u, this.#u[u] = this.#h, this.#h = u, this.#n++, this.#j(u, _2, r), r && (r.set = "add"), m = false, this.#D && !c && this.#O?.(t, e, "add");
|
|
385
391
|
else {
|
|
386
|
-
this.#L(
|
|
387
|
-
let g = this.#t[
|
|
392
|
+
this.#L(u);
|
|
393
|
+
let g = this.#t[u];
|
|
388
394
|
if (t !== g) {
|
|
389
|
-
if (
|
|
390
|
-
g.__abortController.abort(new Error("replaced"));
|
|
391
|
-
let { __staleWhileFetching:
|
|
392
|
-
|
|
393
|
-
} else
|
|
394
|
-
if (this.#
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
p !== void 0 && (h.oldValue = p);
|
|
395
|
+
if (!l) if (this.#e(g)) {
|
|
396
|
+
g !== s && g.__abortController.abort(new Error("replaced"));
|
|
397
|
+
let { __staleWhileFetching: f } = g;
|
|
398
|
+
f !== void 0 && f !== t && (this.#T && this.#S?.(f, e, "set"), this.#f && this.#r?.push([f, e, "set"]));
|
|
399
|
+
} else this.#T && this.#S?.(g, e, "set"), this.#f && this.#r?.push([g, e, "set"]);
|
|
400
|
+
if (this.#x(u), this.#j(u, _2, r), this.#t[u] = t, !c) {
|
|
401
|
+
let f = g && this.#e(g) ? g.__staleWhileFetching : g, y = f === void 0 ? "add" : t !== f ? "replace" : "update";
|
|
402
|
+
r && (r.set = y, f !== void 0 && (r.oldValue = f)), this.#D && this.onInsert?.(t, e, y);
|
|
398
403
|
}
|
|
399
|
-
} else
|
|
400
|
-
this.#j && this.onInsert?.(t, e, t === g ? "update" : "replace");
|
|
404
|
+
} else c || (r && (r.set = "update"), this.#D && this.onInsert?.(t, e, "update"));
|
|
401
405
|
}
|
|
402
|
-
if (
|
|
403
|
-
let g = this.#r,
|
|
404
|
-
for (;
|
|
406
|
+
if (n7 !== 0 && !this.#d && this.#k(), this.#d && (m || this.#H(u, n7, o), r && this.#v(r, u)), !l && this.#f && this.#r) {
|
|
407
|
+
let g = this.#r, f;
|
|
408
|
+
for (; f = g?.shift(); ) this.#w?.(...f);
|
|
405
409
|
}
|
|
406
410
|
return this;
|
|
407
411
|
}
|
|
408
412
|
pop() {
|
|
409
413
|
try {
|
|
410
414
|
for (; this.#n; ) {
|
|
411
|
-
let e = this.#t[this.#
|
|
415
|
+
let e = this.#t[this.#a];
|
|
412
416
|
if (this.#G(true), this.#e(e)) {
|
|
413
417
|
if (e.__staleWhileFetching) return e.__staleWhileFetching;
|
|
414
418
|
} else if (e !== void 0) return e;
|
|
@@ -416,17 +420,19 @@ var L = class u2 {
|
|
|
416
420
|
} finally {
|
|
417
421
|
if (this.#f && this.#r) {
|
|
418
422
|
let e = this.#r, t;
|
|
419
|
-
for (; t = e?.shift(); ) this.#
|
|
423
|
+
for (; t = e?.shift(); ) this.#w?.(...t);
|
|
420
424
|
}
|
|
421
425
|
}
|
|
422
426
|
}
|
|
423
427
|
#G(e) {
|
|
424
|
-
let t = this.#
|
|
425
|
-
|
|
428
|
+
let t = this.#a, i = this.#i[t], s = this.#t[t], n7 = this.#e(s);
|
|
429
|
+
n7 && s.__abortController.abort(new Error("evicted"));
|
|
430
|
+
let o = n7 ? s.__staleWhileFetching : s;
|
|
431
|
+
return (this.#T || this.#f) && o !== void 0 && (this.#T && this.#S?.(o, i, "evict"), this.#f && this.#r?.push([o, i, "evict"])), this.#x(t), this.#g?.[t] && (clearTimeout(this.#g[t]), this.#g[t] = void 0), e && (this.#i[t] = void 0, this.#t[t] = void 0, this.#y.push(t)), this.#n === 1 ? (this.#a = this.#h = 0, this.#y.length = 0) : this.#a = this.#l[t], this.#s.delete(i), this.#n--, t;
|
|
426
432
|
}
|
|
427
433
|
has(e, t = {}) {
|
|
428
434
|
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
429
|
-
t.status = i, i && (i.op = "has", i.key = e);
|
|
435
|
+
t.status = i, i && (i.op = "has", i.key = e, i.cache = this);
|
|
430
436
|
let s = this.#Y(e, t);
|
|
431
437
|
return S.hasSubscribers && S.publish(i), s;
|
|
432
438
|
}
|
|
@@ -435,14 +441,14 @@ var L = class u2 {
|
|
|
435
441
|
if (n7 !== void 0) {
|
|
436
442
|
let o = this.#t[n7];
|
|
437
443
|
if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
|
|
438
|
-
if (this.#p(n7)) s && (s.has = "stale", this.#
|
|
439
|
-
else return i && this.#
|
|
444
|
+
if (this.#p(n7)) s && (s.has = "stale", this.#v(s, n7));
|
|
445
|
+
else return i && this.#R(n7), s && (s.has = "hit", this.#v(s, n7)), true;
|
|
440
446
|
} else s && (s.has = "miss");
|
|
441
447
|
return false;
|
|
442
448
|
}
|
|
443
449
|
peek(e, t = {}) {
|
|
444
|
-
let { status: i =
|
|
445
|
-
i && (i.op = "peek", i.key = e), t.status = i;
|
|
450
|
+
let { status: i = R() ? {} : void 0 } = t;
|
|
451
|
+
i && (i.op = "peek", i.key = e, i.cache = this), t.status = i;
|
|
446
452
|
let s = this.#J(e, t);
|
|
447
453
|
return S.hasSubscribers && S.publish(i), s;
|
|
448
454
|
}
|
|
@@ -452,70 +458,70 @@ var L = class u2 {
|
|
|
452
458
|
i && (i.peek = n7 === void 0 ? "miss" : "stale");
|
|
453
459
|
return;
|
|
454
460
|
}
|
|
455
|
-
let o = this.#t[n7],
|
|
456
|
-
return i && (
|
|
461
|
+
let o = this.#t[n7], l = this.#e(o) ? o.__staleWhileFetching : o;
|
|
462
|
+
return i && (l !== void 0 ? (i.peek = "hit", i.value = l) : i.peek = "miss"), l;
|
|
457
463
|
}
|
|
458
464
|
#P(e, t, i, s) {
|
|
459
465
|
let n7 = t === void 0 ? void 0 : this.#t[t];
|
|
460
466
|
if (this.#e(n7)) return n7;
|
|
461
|
-
let o = new AbortController(), { signal:
|
|
462
|
-
|
|
463
|
-
let h = { signal: o.signal, options: i, context: s },
|
|
464
|
-
let { aborted: a } = o.signal,
|
|
465
|
-
if (i.status && (a && !y ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason,
|
|
466
|
-
let b =
|
|
467
|
-
return (
|
|
468
|
-
}, c = (
|
|
469
|
-
let { aborted: a } = o.signal,
|
|
470
|
-
if (this.#t[t] ===
|
|
471
|
-
if (
|
|
472
|
-
},
|
|
467
|
+
let o = new AbortController(), { signal: l } = i;
|
|
468
|
+
l?.addEventListener("abort", () => o.abort(l.reason), { signal: o.signal });
|
|
469
|
+
let h = { signal: o.signal, options: i, context: s }, r = (f, y = false) => {
|
|
470
|
+
let { aborted: a } = o.signal, w = i.ignoreFetchAbort && f !== void 0, F2 = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
|
|
471
|
+
if (i.status && (a && !y ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, w && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), a && !w && !y) return m(o.signal.reason, F2);
|
|
472
|
+
let b = u, p = this.#t[t];
|
|
473
|
+
return (p === u || p === void 0 && w && y) && (f === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[t] = b.__staleWhileFetching : this.#E(e, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#W(e, f, h.options, b))), f;
|
|
474
|
+
}, c = (f) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = f), m(f, false)), m = (f, y) => {
|
|
475
|
+
let { aborted: a } = o.signal, w = a && i.allowStaleOnFetchAbort, F2 = w || i.allowStaleOnFetchRejection, b = F2 || i.noDeleteOnFetchRejection, p = u;
|
|
476
|
+
if (this.#t[t] === u && (!b || !y && p.__staleWhileFetching === void 0 ? this.#E(e, "fetch") : w || (this.#t[t] = p.__staleWhileFetching)), F2) return i.status && p.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), p.__staleWhileFetching;
|
|
477
|
+
if (p.__returned === p) throw f;
|
|
478
|
+
}, _2 = (f, y) => {
|
|
473
479
|
let a = this.#M?.(e, n7, h);
|
|
474
|
-
|
|
475
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (
|
|
476
|
-
});
|
|
480
|
+
o.signal.addEventListener("abort", () => {
|
|
481
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (w) => r(w, true)));
|
|
482
|
+
}), a && a instanceof Promise ? a.then((w) => f(w === void 0 ? void 0 : w), y) : a !== void 0 && f(a);
|
|
477
483
|
};
|
|
478
484
|
i.status && (i.status.fetchDispatched = true);
|
|
479
|
-
let
|
|
480
|
-
return t === void 0 ? (this.#
|
|
485
|
+
let u = new Promise(_2).then(r, c), g = Object.assign(u, { __abortController: o, __staleWhileFetching: n7, __returned: void 0 });
|
|
486
|
+
return t === void 0 ? (this.#W(e, g, { ...h.options, status: void 0 }), t = this.#s.get(e)) : this.#t[t] = g, g;
|
|
481
487
|
}
|
|
482
488
|
#e(e) {
|
|
483
|
-
if (!this.#
|
|
489
|
+
if (!this.#U) return false;
|
|
484
490
|
let t = e;
|
|
485
491
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
486
492
|
}
|
|
487
493
|
fetch(e, t = {}) {
|
|
488
|
-
let i = W.hasSubscribers, { status: s =
|
|
494
|
+
let i = W.hasSubscribers, { status: s = R() ? {} : void 0 } = t;
|
|
489
495
|
t.status = s, s && t.context && (s.context = t.context);
|
|
490
496
|
let n7 = this.#B(e, t);
|
|
491
|
-
return s &&
|
|
497
|
+
return s && i && (s.trace = true, W.tracePromise(() => n7, s).catch(() => {
|
|
492
498
|
})), n7;
|
|
493
499
|
}
|
|
494
500
|
async #B(e, t = {}) {
|
|
495
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet:
|
|
496
|
-
if (a && (a.op = "fetch", a.key = e, y && (a.forceRefresh = true)), !this.#
|
|
497
|
-
let
|
|
501
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: l = this.noDisposeOnSet, size: h = 0, sizeCalculation: r = this.sizeCalculation, noUpdateTTL: c = this.noUpdateTTL, noDeleteOnFetchRejection: m = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: _2 = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: g = this.allowStaleOnFetchAbort, context: f, forceRefresh: y = false, status: a, signal: w } = t;
|
|
502
|
+
if (a && (a.op = "fetch", a.key = e, y && (a.forceRefresh = true), a.cache = this), !this.#U) return a && (a.fetch = "get"), this.#C(e, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n7, status: a });
|
|
503
|
+
let F2 = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n7, ttl: o, noDisposeOnSet: l, size: h, sizeCalculation: r, noUpdateTTL: c, noDeleteOnFetchRejection: m, allowStaleOnFetchRejection: _2, allowStaleOnFetchAbort: g, ignoreFetchAbort: u, status: a, signal: w }, b = this.#s.get(e);
|
|
498
504
|
if (b === void 0) {
|
|
499
505
|
a && (a.fetch = "miss");
|
|
500
|
-
let
|
|
501
|
-
return
|
|
506
|
+
let p = this.#P(e, b, F2, f);
|
|
507
|
+
return p.__returned = p;
|
|
502
508
|
} else {
|
|
503
|
-
let
|
|
504
|
-
if (this.#e(
|
|
505
|
-
let
|
|
506
|
-
return a && (a.fetch = "inflight",
|
|
509
|
+
let p = this.#t[b];
|
|
510
|
+
if (this.#e(p)) {
|
|
511
|
+
let v2 = i && p.__staleWhileFetching !== void 0;
|
|
512
|
+
return a && (a.fetch = "inflight", v2 && (a.returnedStale = true)), v2 ? p.__staleWhileFetching : p.__returned = p;
|
|
507
513
|
}
|
|
508
514
|
let A2 = this.#p(b);
|
|
509
|
-
if (!y && !A2) return a && (a.fetch = "hit"), this.#L(b), s && this.#
|
|
510
|
-
let z = this.#P(e, b,
|
|
511
|
-
return a && (a.fetch = A2 ? "stale" : "refresh",
|
|
515
|
+
if (!y && !A2) return a && (a.fetch = "hit"), this.#L(b), s && this.#R(b), a && this.#v(a, b), p;
|
|
516
|
+
let z = this.#P(e, b, F2, f), E = z.__staleWhileFetching !== void 0 && i;
|
|
517
|
+
return a && (a.fetch = A2 ? "stale" : "refresh", E && A2 && (a.returnedStale = true)), E ? z.__staleWhileFetching : z.__returned = z;
|
|
512
518
|
}
|
|
513
519
|
}
|
|
514
520
|
forceFetch(e, t = {}) {
|
|
515
|
-
let i = W.hasSubscribers, { status: s =
|
|
521
|
+
let i = W.hasSubscribers, { status: s = R() ? {} : void 0 } = t;
|
|
516
522
|
t.status = s, s && t.context && (s.context = t.context);
|
|
517
523
|
let n7 = this.#K(e, t);
|
|
518
|
-
return s &&
|
|
524
|
+
return s && i && (s.trace = true, W.tracePromise(() => n7, s).catch(() => {
|
|
519
525
|
})), n7;
|
|
520
526
|
}
|
|
521
527
|
async #K(e, t = {}) {
|
|
@@ -525,67 +531,67 @@ var L = class u2 {
|
|
|
525
531
|
}
|
|
526
532
|
memo(e, t = {}) {
|
|
527
533
|
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
528
|
-
t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context));
|
|
534
|
+
t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context), i.cache = this);
|
|
529
535
|
let s = this.#Q(e, t);
|
|
530
536
|
return i && (i.value = s), S.hasSubscribers && S.publish(i), s;
|
|
531
537
|
}
|
|
532
538
|
#Q(e, t = {}) {
|
|
533
|
-
let i = this.#
|
|
539
|
+
let i = this.#I;
|
|
534
540
|
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
535
|
-
let { context: s, status: n7, forceRefresh: o, ...
|
|
541
|
+
let { context: s, status: n7, forceRefresh: o, ...l } = t;
|
|
536
542
|
n7 && o && (n7.forceRefresh = true);
|
|
537
|
-
let h = this.#C(e,
|
|
538
|
-
if (n7 && (n7.memo =
|
|
539
|
-
let c = i(e, h, { options:
|
|
540
|
-
return n7 && (n7.value = c), this.#
|
|
543
|
+
let h = this.#C(e, l), r = o || h === void 0;
|
|
544
|
+
if (n7 && (n7.memo = r ? "miss" : "hit", r || (n7.value = h)), !r) return h;
|
|
545
|
+
let c = i(e, h, { options: l, context: s });
|
|
546
|
+
return n7 && (n7.value = c), this.#W(e, c, l), c;
|
|
541
547
|
}
|
|
542
548
|
get(e, t = {}) {
|
|
543
549
|
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
544
|
-
t.status = i, i && (i.op = "get", i.key = e);
|
|
550
|
+
t.status = i, i && (i.op = "get", i.key = e, i.cache = this);
|
|
545
551
|
let s = this.#C(e, t);
|
|
546
552
|
return i && (s !== void 0 && (i.value = s), S.hasSubscribers && S.publish(i)), s;
|
|
547
553
|
}
|
|
548
554
|
#C(e, t = {}) {
|
|
549
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, status: o } = t,
|
|
550
|
-
if (
|
|
555
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, status: o } = t, l = this.#s.get(e);
|
|
556
|
+
if (l === void 0) {
|
|
551
557
|
o && (o.get = "miss");
|
|
552
558
|
return;
|
|
553
559
|
}
|
|
554
|
-
let h = this.#t[
|
|
555
|
-
return o && this.#
|
|
560
|
+
let h = this.#t[l], r = this.#e(h);
|
|
561
|
+
return o && this.#v(o, l), this.#p(l) ? r ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = true), h.__staleWhileFetching) : void 0) : (n7 || this.#E(e, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = true), h) : void 0) : (o && (o.get = r ? "fetching" : "hit"), this.#L(l), s && this.#R(l), r ? h.__staleWhileFetching : h);
|
|
556
562
|
}
|
|
557
563
|
#$(e, t) {
|
|
558
|
-
this.#
|
|
564
|
+
this.#u[t] = e, this.#l[e] = t;
|
|
559
565
|
}
|
|
560
566
|
#L(e) {
|
|
561
|
-
e !== this.#h && (e === this.#
|
|
567
|
+
e !== this.#h && (e === this.#a ? this.#a = this.#l[e] : this.#$(this.#u[e], this.#l[e]), this.#$(this.#h, e), this.#h = e);
|
|
562
568
|
}
|
|
563
569
|
delete(e) {
|
|
564
|
-
return this.#
|
|
570
|
+
return this.#E(e, "delete");
|
|
565
571
|
}
|
|
566
|
-
#
|
|
567
|
-
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e });
|
|
572
|
+
#E(e, t) {
|
|
573
|
+
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e, cache: this });
|
|
568
574
|
let i = false;
|
|
569
575
|
if (this.#n !== 0) {
|
|
570
576
|
let s = this.#s.get(e);
|
|
571
|
-
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g
|
|
577
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#q(t);
|
|
572
578
|
else {
|
|
573
|
-
this.#
|
|
579
|
+
this.#x(s);
|
|
574
580
|
let n7 = this.#t[s];
|
|
575
|
-
if (this.#e(n7) ? n7.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#
|
|
576
|
-
else if (s === this.#
|
|
581
|
+
if (this.#e(n7) ? n7.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#S?.(n7, e, t), this.#f && this.#r?.push([n7, e, t])), this.#s.delete(e), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
|
|
582
|
+
else if (s === this.#a) this.#a = this.#l[s];
|
|
577
583
|
else {
|
|
578
|
-
let o = this.#
|
|
579
|
-
this.#
|
|
580
|
-
let
|
|
581
|
-
this.#
|
|
584
|
+
let o = this.#u[s];
|
|
585
|
+
this.#l[o] = this.#l[s];
|
|
586
|
+
let l = this.#l[s];
|
|
587
|
+
this.#u[l] = this.#u[s];
|
|
582
588
|
}
|
|
583
589
|
this.#n--, this.#y.push(s);
|
|
584
590
|
}
|
|
585
591
|
}
|
|
586
592
|
if (this.#f && this.#r?.length) {
|
|
587
593
|
let s = this.#r, n7;
|
|
588
|
-
for (; n7 = s?.shift(); ) this.#
|
|
594
|
+
for (; n7 = s?.shift(); ) this.#w?.(...n7);
|
|
589
595
|
}
|
|
590
596
|
return i;
|
|
591
597
|
}
|
|
@@ -598,7 +604,7 @@ var L = class u2 {
|
|
|
598
604
|
if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
|
|
599
605
|
else {
|
|
600
606
|
let s = this.#i[t];
|
|
601
|
-
this.#T && this.#
|
|
607
|
+
this.#T && this.#S?.(i, s, e), this.#f && this.#r?.push([i, s, e]);
|
|
602
608
|
}
|
|
603
609
|
}
|
|
604
610
|
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
@@ -606,9 +612,9 @@ var L = class u2 {
|
|
|
606
612
|
for (let t of this.#g ?? []) t !== void 0 && clearTimeout(t);
|
|
607
613
|
this.#g?.fill(void 0);
|
|
608
614
|
}
|
|
609
|
-
if (this.#_ && this.#_.fill(0), this.#
|
|
615
|
+
if (this.#_ && this.#_.fill(0), this.#a = 0, this.#h = 0, this.#y.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
610
616
|
let t = this.#r, i;
|
|
611
|
-
for (; i = t?.shift(); ) this.#
|
|
617
|
+
for (; i = t?.shift(); ) this.#w?.(...i);
|
|
612
618
|
}
|
|
613
619
|
}
|
|
614
620
|
};
|
|
@@ -635,16 +641,16 @@ var ce = (n7, t) => {
|
|
|
635
641
|
return e ? e[0] : null;
|
|
636
642
|
};
|
|
637
643
|
var ss = (n7, t, e) => {
|
|
638
|
-
let s, i, r, o, h, a = e.indexOf(n7), l = e.indexOf(t, a + 1),
|
|
644
|
+
let s, i, r, o, h, a = e.indexOf(n7), l = e.indexOf(t, a + 1), u = a;
|
|
639
645
|
if (a >= 0 && l > 0) {
|
|
640
646
|
if (n7 === t) return [a, l];
|
|
641
|
-
for (s = [], r = e.length;
|
|
642
|
-
if (
|
|
647
|
+
for (s = [], r = e.length; u >= 0 && !h; ) {
|
|
648
|
+
if (u === a) s.push(u), a = e.indexOf(n7, u + 1);
|
|
643
649
|
else if (s.length === 1) {
|
|
644
650
|
let c = s.pop();
|
|
645
651
|
c !== void 0 && (h = [c, l]);
|
|
646
|
-
} else i = s.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t,
|
|
647
|
-
|
|
652
|
+
} else i = s.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t, u + 1);
|
|
653
|
+
u = a < l && a >= 0 ? a : l;
|
|
648
654
|
}
|
|
649
655
|
s.length && o !== void 0 && (h = [r, o]);
|
|
650
656
|
}
|
|
@@ -710,17 +716,17 @@ function ht(n7, t, e) {
|
|
|
710
716
|
s.push(a);
|
|
711
717
|
}
|
|
712
718
|
else {
|
|
713
|
-
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = h || a,
|
|
714
|
-
if (!l && !
|
|
719
|
+
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = h || a, u = i.body.indexOf(",") >= 0;
|
|
720
|
+
if (!l && !u) return i.post.match(/,(?!,).*\}/) ? (n7 = i.pre + "{" + i.body + qt + i.post, ht(n7, t, true)) : [n7];
|
|
715
721
|
let c;
|
|
716
722
|
if (l) c = i.body.split(/\.\./);
|
|
717
723
|
else if (c = me(i.body), c.length === 1 && c[0] !== void 0 && (c = ht(c[0], t, false).map(gs), c.length === 1)) return o.map((f) => i.pre + c[0] + f);
|
|
718
|
-
let
|
|
724
|
+
let d3;
|
|
719
725
|
if (l && c[0] !== void 0 && c[1] !== void 0) {
|
|
720
726
|
let f = Ht(c[0]), m = Ht(c[1]), p = Math.max(c[0].length, c[1].length), w = c.length === 3 && c[2] !== void 0 ? Math.abs(Ht(c[2])) : 1, g = ys;
|
|
721
727
|
m < f && (w *= -1, g = bs);
|
|
722
728
|
let E = c.some(ws);
|
|
723
|
-
|
|
729
|
+
d3 = [];
|
|
724
730
|
for (let y = f; g(y, m); y += w) {
|
|
725
731
|
let b;
|
|
726
732
|
if (a) b = String.fromCharCode(y), b === "\\" && (b = "");
|
|
@@ -731,14 +737,14 @@ function ht(n7, t, e) {
|
|
|
731
737
|
y < 0 ? b = "-" + $ + b.slice(1) : b = $ + b;
|
|
732
738
|
}
|
|
733
739
|
}
|
|
734
|
-
|
|
740
|
+
d3.push(b);
|
|
735
741
|
}
|
|
736
742
|
} else {
|
|
737
|
-
|
|
738
|
-
for (let f = 0; f < c.length; f++)
|
|
743
|
+
d3 = [];
|
|
744
|
+
for (let f = 0; f < c.length; f++) d3.push.apply(d3, ht(c[f], t, false));
|
|
739
745
|
}
|
|
740
|
-
for (let f = 0; f <
|
|
741
|
-
let p = r +
|
|
746
|
+
for (let f = 0; f < d3.length; f++) for (let m = 0; m < o.length && s.length < t; m++) {
|
|
747
|
+
let p = r + d3[f] + o[m];
|
|
742
748
|
(!e || l || p) && s.push(p);
|
|
743
749
|
}
|
|
744
750
|
}
|
|
@@ -755,7 +761,7 @@ var we = (n7) => n7.join("");
|
|
|
755
761
|
var ye = (n7, t) => {
|
|
756
762
|
let e = t;
|
|
757
763
|
if (n7.charAt(e) !== "[") throw new Error("not in a brace expression");
|
|
758
|
-
let s = [], i = [], r = e + 1, o = false, h = false, a = false, l = false,
|
|
764
|
+
let s = [], i = [], r = e + 1, o = false, h = false, a = false, l = false, u = e, c = "";
|
|
759
765
|
t: for (; r < n7.length; ) {
|
|
760
766
|
let p = n7.charAt(r);
|
|
761
767
|
if ((p === "!" || p === "^") && r === e + 1) {
|
|
@@ -763,7 +769,7 @@ var ye = (n7, t) => {
|
|
|
763
769
|
continue;
|
|
764
770
|
}
|
|
765
771
|
if (p === "]" && o && !a) {
|
|
766
|
-
|
|
772
|
+
u = r + 1;
|
|
767
773
|
break;
|
|
768
774
|
}
|
|
769
775
|
if (o = true, p === "\\" && !a) {
|
|
@@ -791,14 +797,14 @@ var ye = (n7, t) => {
|
|
|
791
797
|
}
|
|
792
798
|
s.push(lt(p)), r++;
|
|
793
799
|
}
|
|
794
|
-
if (
|
|
800
|
+
if (u < r) return ["", false, 0, false];
|
|
795
801
|
if (!s.length && !i.length) return ["$.", false, n7.length - e, true];
|
|
796
802
|
if (i.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l) {
|
|
797
803
|
let p = s[0].length === 2 ? s[0].slice(-1) : s[0];
|
|
798
|
-
return [Es(p), false,
|
|
804
|
+
return [Es(p), false, u - e, false];
|
|
799
805
|
}
|
|
800
|
-
let
|
|
801
|
-
return [s.length && i.length ? "(" +
|
|
806
|
+
let d3 = "[" + (l ? "^" : "") + we(s) + "]", f = "[" + (l ? "" : "^") + we(i) + "]";
|
|
807
|
+
return [s.length && i.length ? "(" + d3 + "|" + f + ")" : s.length ? d3 : f, h, u - e, true];
|
|
802
808
|
};
|
|
803
809
|
var W2 = (n7, { windowsPathsNoEscape: t = false, magicalBraces: e = true } = {}) => e ? t ? n7.replace(/\[([^\/\\])\]/g, "$1") : n7.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t ? n7.replace(/\[([^\/\\{}])\]/g, "$1") : n7.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
804
810
|
var xs = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
@@ -917,32 +923,32 @@ var Q = class n {
|
|
|
917
923
|
}
|
|
918
924
|
return e.push(m), f;
|
|
919
925
|
}
|
|
920
|
-
let l = s + 1,
|
|
926
|
+
let l = s + 1, u = new n(null, e), c = [], d3 = "";
|
|
921
927
|
for (; l < t.length; ) {
|
|
922
928
|
let f = t.charAt(l++);
|
|
923
929
|
if (r || f === "\\") {
|
|
924
|
-
r = !r,
|
|
930
|
+
r = !r, d3 += f;
|
|
925
931
|
continue;
|
|
926
932
|
}
|
|
927
933
|
if (o) {
|
|
928
|
-
l === h + 1 ? (f === "^" || f === "!") && (a = true) : f === "]" && !(l === h + 2 && a) && (o = false),
|
|
934
|
+
l === h + 1 ? (f === "^" || f === "!") && (a = true) : f === "]" && !(l === h + 2 && a) && (o = false), d3 += f;
|
|
929
935
|
continue;
|
|
930
936
|
} else if (f === "[") {
|
|
931
|
-
o = true, h = l, a = false,
|
|
937
|
+
o = true, h = l, a = false, d3 += f;
|
|
932
938
|
continue;
|
|
933
939
|
}
|
|
934
940
|
if (be(f) && t.charAt(l) === "(") {
|
|
935
|
-
|
|
936
|
-
let m = new n(f,
|
|
937
|
-
|
|
941
|
+
u.push(d3), d3 = "";
|
|
942
|
+
let m = new n(f, u);
|
|
943
|
+
u.push(m), l = n.#i(t, m, l, i);
|
|
938
944
|
continue;
|
|
939
945
|
}
|
|
940
946
|
if (f === "|") {
|
|
941
|
-
|
|
947
|
+
u.push(d3), d3 = "", c.push(u), u = new n(null, e);
|
|
942
948
|
continue;
|
|
943
949
|
}
|
|
944
|
-
if (f === ")") return
|
|
945
|
-
|
|
950
|
+
if (f === ")") return d3 === "" && e.#r.length === 0 && (e.#f = true), u.push(d3), d3 = "", e.push(...c, u), l;
|
|
951
|
+
d3 += f;
|
|
946
952
|
}
|
|
947
953
|
return e.type = null, e.#s = void 0, e.#r = [t.substring(s - 1)], l;
|
|
948
954
|
}
|
|
@@ -966,13 +972,13 @@ var Q = class n {
|
|
|
966
972
|
let a = this.isStart() && this.isEnd() && !this.#r.some((f) => typeof f != "string"), l = this.#r.map((f) => {
|
|
967
973
|
let [m, p, w, g] = typeof f == "string" ? n.#E(f, this.#s, a) : f.toRegExpSource(t);
|
|
968
974
|
return this.#s = this.#s || w, this.#n = this.#n || g, m;
|
|
969
|
-
}).join(""),
|
|
975
|
+
}).join(""), u = "";
|
|
970
976
|
if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && Ts.has(this.#r[0]))) {
|
|
971
977
|
let m = Cs, p = e && m.has(l.charAt(0)) || l.startsWith("\\.") && m.has(l.charAt(2)) || l.startsWith("\\.\\.") && m.has(l.charAt(4)), w = !e && !t && m.has(l.charAt(0));
|
|
972
|
-
|
|
978
|
+
u = p ? vs : w ? Ct : "";
|
|
973
979
|
}
|
|
974
980
|
let c = "";
|
|
975
|
-
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c = "(?:$|\\/)"), [
|
|
981
|
+
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c = "(?:$|\\/)"), [u + l + c, W2(l), this.#s = !!this.#s, this.#n];
|
|
976
982
|
}
|
|
977
983
|
let s = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:", r = this.#d(e);
|
|
978
984
|
if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
|
|
@@ -1014,9 +1020,9 @@ var Q = class n {
|
|
|
1014
1020
|
continue;
|
|
1015
1021
|
}
|
|
1016
1022
|
if (l === "[") {
|
|
1017
|
-
let [
|
|
1018
|
-
if (
|
|
1019
|
-
r +=
|
|
1023
|
+
let [u, c, d3, f] = ye(t, a);
|
|
1024
|
+
if (d3) {
|
|
1025
|
+
r += u, o = o || c, a += d3 - 1, e = e || f;
|
|
1020
1026
|
continue;
|
|
1021
1027
|
}
|
|
1022
1028
|
}
|
|
@@ -1030,7 +1036,7 @@ var Q = class n {
|
|
|
1030
1036
|
}
|
|
1031
1037
|
};
|
|
1032
1038
|
var tt = (n7, { windowsPathsNoEscape: t = false, magicalBraces: e = false } = {}) => e ? t ? n7.replace(/[?*()[\]{}]/g, "[$&]") : n7.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n7.replace(/[?*()[\]]/g, "[$&]") : n7.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1033
|
-
var O2 = (n7, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? false : new
|
|
1039
|
+
var O2 = (n7, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? false : new D(t, e).match(n7));
|
|
1034
1040
|
var Rs = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1035
1041
|
var Os = (n7) => (t) => !t.startsWith(".") && t.endsWith(n7);
|
|
1036
1042
|
var Fs = (n7) => (t) => t.endsWith(n7);
|
|
@@ -1104,16 +1110,16 @@ var Zs = (n7) => {
|
|
|
1104
1110
|
O2.defaults = Zs;
|
|
1105
1111
|
var ke = (n7, t = {}) => (at(n7), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n7) ? [n7] : ge(n7, { max: t.braceExpandMax }));
|
|
1106
1112
|
O2.braceExpand = ke;
|
|
1107
|
-
var Qs = (n7, t = {}) => new
|
|
1113
|
+
var Qs = (n7, t = {}) => new D(n7, t).makeRe();
|
|
1108
1114
|
O2.makeRe = Qs;
|
|
1109
1115
|
var ti = (n7, t, e = {}) => {
|
|
1110
|
-
let s = new
|
|
1116
|
+
let s = new D(t, e);
|
|
1111
1117
|
return n7 = n7.filter((i) => s.match(i)), s.options.nonull && !n7.length && n7.push(t), n7;
|
|
1112
1118
|
};
|
|
1113
1119
|
O2.match = ti;
|
|
1114
1120
|
var ve = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1115
1121
|
var ei = (n7) => n7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1116
|
-
var
|
|
1122
|
+
var D = class {
|
|
1117
1123
|
options;
|
|
1118
1124
|
set;
|
|
1119
1125
|
pattern;
|
|
@@ -1159,8 +1165,8 @@ var D2 = class {
|
|
|
1159
1165
|
let i = this.globParts.map((r, o, h) => {
|
|
1160
1166
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1161
1167
|
let a = r[0] === "" && r[1] === "" && (r[2] === "?" || !ve.test(r[2])) && !ve.test(r[3]), l = /^[a-z]:/i.test(r[0]);
|
|
1162
|
-
if (a) return [...r.slice(0, 4), ...r.slice(4).map((
|
|
1163
|
-
if (l) return [r[0], ...r.slice(1).map((
|
|
1168
|
+
if (a) return [...r.slice(0, 4), ...r.slice(4).map((u) => this.parse(u))];
|
|
1169
|
+
if (l) return [r[0], ...r.slice(1).map((u) => this.parse(u))];
|
|
1164
1170
|
}
|
|
1165
1171
|
return r.map((a) => this.parse(a));
|
|
1166
1172
|
});
|
|
@@ -1224,8 +1230,8 @@ var D2 = class {
|
|
|
1224
1230
|
let h = s[i + 1], a = s[i + 2], l = s[i + 3];
|
|
1225
1231
|
if (h !== ".." || !a || a === "." || a === ".." || !l || l === "." || l === "..") continue;
|
|
1226
1232
|
e = true, s.splice(i, 1);
|
|
1227
|
-
let
|
|
1228
|
-
|
|
1233
|
+
let u = s.slice(0);
|
|
1234
|
+
u[i] = "**", t.push(u), i--;
|
|
1229
1235
|
}
|
|
1230
1236
|
if (!this.preserveMultipleSlashes) {
|
|
1231
1237
|
for (let o = 1; o < s.length - 1; o++) {
|
|
@@ -1290,30 +1296,30 @@ var D2 = class {
|
|
|
1290
1296
|
r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
|
|
1291
1297
|
for (var o = 0, h = 0, a = t.length, l = e.length; o < a && h < l; o++, h++) {
|
|
1292
1298
|
this.debug("matchOne loop");
|
|
1293
|
-
var
|
|
1294
|
-
if (this.debug(e,
|
|
1295
|
-
if (
|
|
1296
|
-
this.debug("GLOBSTAR", [e,
|
|
1297
|
-
var
|
|
1299
|
+
var u = e[h], c = t[o];
|
|
1300
|
+
if (this.debug(e, u, c), u === false) return false;
|
|
1301
|
+
if (u === A) {
|
|
1302
|
+
this.debug("GLOBSTAR", [e, u, c]);
|
|
1303
|
+
var d3 = o, f = h + 1;
|
|
1298
1304
|
if (f === l) {
|
|
1299
1305
|
for (this.debug("** at the end"); o < a; o++) if (t[o] === "." || t[o] === ".." || !i.dot && t[o].charAt(0) === ".") return false;
|
|
1300
1306
|
return true;
|
|
1301
1307
|
}
|
|
1302
|
-
for (;
|
|
1303
|
-
var m = t[
|
|
1308
|
+
for (; d3 < a; ) {
|
|
1309
|
+
var m = t[d3];
|
|
1304
1310
|
if (this.debug(`
|
|
1305
|
-
globstar while`, t,
|
|
1311
|
+
globstar while`, t, d3, e, f, m), this.matchOne(t.slice(d3), e.slice(f), s)) return this.debug("globstar found match!", d3, a, m), true;
|
|
1306
1312
|
if (m === "." || m === ".." || !i.dot && m.charAt(0) === ".") {
|
|
1307
|
-
this.debug("dot detected!", t,
|
|
1313
|
+
this.debug("dot detected!", t, d3, e, f);
|
|
1308
1314
|
break;
|
|
1309
1315
|
}
|
|
1310
|
-
this.debug("globstar swallow a segment, and continue"),
|
|
1316
|
+
this.debug("globstar swallow a segment, and continue"), d3++;
|
|
1311
1317
|
}
|
|
1312
1318
|
return !!(s && (this.debug(`
|
|
1313
|
-
>>> no match, partial?`, t,
|
|
1319
|
+
>>> no match, partial?`, t, d3, e, f), d3 === a));
|
|
1314
1320
|
}
|
|
1315
1321
|
let p;
|
|
1316
|
-
if (typeof
|
|
1322
|
+
if (typeof u == "string" ? (p = c === u, this.debug("string match", u, c, p)) : (p = u.test(c), this.debug("pattern match", u, c, p)), !p) return false;
|
|
1317
1323
|
}
|
|
1318
1324
|
if (o === a && h === l) return true;
|
|
1319
1325
|
if (o === a) return s;
|
|
@@ -1339,20 +1345,20 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
|
|
|
1339
1345
|
if (!t.length) return this.regexp = false, this.regexp;
|
|
1340
1346
|
let e = this.options, s = e.noglobstar ? Vs : e.dot ? Ys : Xs, i = new Set(e.nocase ? ["i"] : []), r = t.map((a) => {
|
|
1341
1347
|
let l = a.map((c) => {
|
|
1342
|
-
if (c instanceof RegExp) for (let
|
|
1348
|
+
if (c instanceof RegExp) for (let d3 of c.flags.split("")) i.add(d3);
|
|
1343
1349
|
return typeof c == "string" ? ei(c) : c === A ? A : c._src;
|
|
1344
1350
|
});
|
|
1345
|
-
l.forEach((c,
|
|
1346
|
-
let f = l[
|
|
1347
|
-
c !== A || m === A || (m === void 0 ? f !== void 0 && f !== A ? l[
|
|
1351
|
+
l.forEach((c, d3) => {
|
|
1352
|
+
let f = l[d3 + 1], m = l[d3 - 1];
|
|
1353
|
+
c !== A || m === A || (m === void 0 ? f !== void 0 && f !== A ? l[d3 + 1] = "(?:\\/|" + s + "\\/)?" + f : l[d3] = s : f === void 0 ? l[d3 - 1] = m + "(?:\\/|\\/" + s + ")?" : f !== A && (l[d3 - 1] = m + "(?:\\/|\\/" + s + "\\/)" + f, l[d3 + 1] = A));
|
|
1348
1354
|
});
|
|
1349
|
-
let
|
|
1350
|
-
if (this.partial &&
|
|
1355
|
+
let u = l.filter((c) => c !== A);
|
|
1356
|
+
if (this.partial && u.length >= 1) {
|
|
1351
1357
|
let c = [];
|
|
1352
|
-
for (let
|
|
1358
|
+
for (let d3 = 1; d3 <= u.length; d3++) c.push(u.slice(0, d3).join("/"));
|
|
1353
1359
|
return "(?:" + c.join("|") + ")";
|
|
1354
1360
|
}
|
|
1355
|
-
return
|
|
1361
|
+
return u.join("/");
|
|
1356
1362
|
}).join("|"), [o, h] = t.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1357
1363
|
r = "^" + o + r + h + "$", this.partial && (r = "^(?:\\/|" + o + r.slice(1, -1) + h + ")$"), this.negate && (r = "^(?!" + r + ").+$");
|
|
1358
1364
|
try {
|
|
@@ -1388,7 +1394,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
|
|
|
1388
1394
|
}
|
|
1389
1395
|
};
|
|
1390
1396
|
O2.AST = Q;
|
|
1391
|
-
O2.Minimatch =
|
|
1397
|
+
O2.Minimatch = D;
|
|
1392
1398
|
O2.escape = tt;
|
|
1393
1399
|
O2.unescape = W2;
|
|
1394
1400
|
var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
@@ -1536,7 +1542,7 @@ var ft = class Me {
|
|
|
1536
1542
|
return this.#o;
|
|
1537
1543
|
}
|
|
1538
1544
|
constructor(t) {
|
|
1539
|
-
let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a, dispose: l, onInsert:
|
|
1545
|
+
let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a, dispose: l, onInsert: u, disposeAfter: c, noDisposeOnSet: d3, noUpdateTTL: f, maxSize: m = 0, maxEntrySize: p = 0, sizeCalculation: w, fetchMethod: g, memoMethod: S2, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y, allowStaleOnFetchRejection: b, allowStaleOnFetchAbort: z, ignoreFetchAbort: $, perf: J } = t;
|
|
1540
1546
|
if (J !== void 0 && typeof J?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
1541
1547
|
if (this.#c = J ?? si, e !== 0 && !q(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
1542
1548
|
let Z = e ? De(e) : Array;
|
|
@@ -1547,7 +1553,7 @@ var ft = class Me {
|
|
|
1547
1553
|
}
|
|
1548
1554
|
if (S2 !== void 0 && typeof S2 != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
1549
1555
|
if (this.#w = S2, g !== void 0 && typeof g != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
1550
|
-
if (this.#S = g, this.#A = !!g, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new Z(e), this.#E = new Z(e), this.#b = 0, this.#p = 0, this.#R = ri.create(e), this.#h = 0, this.#u = 0, typeof l == "function" && (this.#n = l), typeof
|
|
1556
|
+
if (this.#S = g, this.#A = !!g, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new Z(e), this.#E = new Z(e), this.#b = 0, this.#p = 0, this.#R = ri.create(e), this.#h = 0, this.#u = 0, typeof l == "function" && (this.#n = l), typeof u == "function" && (this.#r = u), typeof c == "function" ? (this.#o = c, this.#m = []) : (this.#o = void 0, this.#m = void 0), this.#x = !!this.#n, this.#_ = !!this.#r, this.#e = !!this.#o, this.noDisposeOnSet = !!d3, this.noUpdateTTL = !!f, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!b, this.allowStaleOnFetchAbort = !!z, this.ignoreFetchAbort = !!$, this.maxEntrySize !== 0) {
|
|
1551
1557
|
if (this.#s !== 0 && !q(this.#s)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
1552
1558
|
if (!q(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1553
1559
|
this.#G();
|
|
@@ -1583,8 +1589,8 @@ var ft = class Me {
|
|
|
1583
1589
|
let a = t[h], l = e[h];
|
|
1584
1590
|
if (!a || !l) return;
|
|
1585
1591
|
o.ttl = a, o.start = l, o.now = i || r();
|
|
1586
|
-
let
|
|
1587
|
-
o.remainingTTL = a -
|
|
1592
|
+
let u = o.now - l;
|
|
1593
|
+
o.remainingTTL = a - u;
|
|
1588
1594
|
}
|
|
1589
1595
|
};
|
|
1590
1596
|
let i = 0, r = () => {
|
|
@@ -1601,8 +1607,8 @@ var ft = class Me {
|
|
|
1601
1607
|
if (h === void 0) return 0;
|
|
1602
1608
|
let a = t[h], l = e[h];
|
|
1603
1609
|
if (!a || !l) return 1 / 0;
|
|
1604
|
-
let
|
|
1605
|
-
return a -
|
|
1610
|
+
let u = (i || r()) - l;
|
|
1611
|
+
return a - u;
|
|
1606
1612
|
}, this.#v = (o) => {
|
|
1607
1613
|
let h = e[o], a = t[o];
|
|
1608
1614
|
return !!a && !!h && (i || r()) - h > a;
|
|
@@ -1744,30 +1750,30 @@ var ft = class Me {
|
|
|
1744
1750
|
}
|
|
1745
1751
|
set(t, e, s = {}) {
|
|
1746
1752
|
if (e === void 0) return this.delete(t), this;
|
|
1747
|
-
let { ttl: i = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s,
|
|
1748
|
-
if (this.maxEntrySize &&
|
|
1753
|
+
let { ttl: i = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s, u = this.#I(t, e, s.size || 0, h);
|
|
1754
|
+
if (this.maxEntrySize && u > this.maxEntrySize) return a && (a.set = "miss", a.maxEntrySizeExceeded = true), this.#O(t, "set"), this;
|
|
1749
1755
|
let c = this.#h === 0 ? void 0 : this.#f.get(t);
|
|
1750
|
-
if (c === void 0) c = this.#h === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#h === this.#t ? this.#B(false) : this.#h, this.#a[c] = t, this.#i[c] = e, this.#f.set(t, c), this.#d[this.#p] = c, this.#E[c] = this.#p, this.#p = c, this.#h++, this.#L(c,
|
|
1756
|
+
if (c === void 0) c = this.#h === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#h === this.#t ? this.#B(false) : this.#h, this.#a[c] = t, this.#i[c] = e, this.#f.set(t, c), this.#d[this.#p] = c, this.#E[c] = this.#p, this.#p = c, this.#h++, this.#L(c, u, a), a && (a.set = "add"), l = false, this.#_ && this.#r?.(e, t, "add");
|
|
1751
1757
|
else {
|
|
1752
1758
|
this.#W(c);
|
|
1753
|
-
let
|
|
1754
|
-
if (e !==
|
|
1755
|
-
if (this.#A && this.#l(
|
|
1756
|
-
|
|
1757
|
-
let { __staleWhileFetching: f } =
|
|
1759
|
+
let d3 = this.#i[c];
|
|
1760
|
+
if (e !== d3) {
|
|
1761
|
+
if (this.#A && this.#l(d3)) {
|
|
1762
|
+
d3.__abortController.abort(new Error("replaced"));
|
|
1763
|
+
let { __staleWhileFetching: f } = d3;
|
|
1758
1764
|
f !== void 0 && !o && (this.#x && this.#n?.(f, t, "set"), this.#e && this.#m?.push([f, t, "set"]));
|
|
1759
|
-
} else o || (this.#x && this.#n?.(
|
|
1760
|
-
if (this.#P(c), this.#L(c,
|
|
1765
|
+
} else o || (this.#x && this.#n?.(d3, t, "set"), this.#e && this.#m?.push([d3, t, "set"]));
|
|
1766
|
+
if (this.#P(c), this.#L(c, u, a), this.#i[c] = e, a) {
|
|
1761
1767
|
a.set = "replace";
|
|
1762
|
-
let f =
|
|
1768
|
+
let f = d3 && this.#l(d3) ? d3.__staleWhileFetching : d3;
|
|
1763
1769
|
f !== void 0 && (a.oldValue = f);
|
|
1764
1770
|
}
|
|
1765
1771
|
} else a && (a.set = "update");
|
|
1766
|
-
this.#_ && this.onInsert?.(e, t, e ===
|
|
1772
|
+
this.#_ && this.onInsert?.(e, t, e === d3 ? "update" : "replace");
|
|
1767
1773
|
}
|
|
1768
1774
|
if (i !== 0 && !this.#g && this.#M(), this.#g && (l || this.#j(c, i, r), a && this.#N(a, c)), !o && this.#e && this.#m) {
|
|
1769
|
-
let
|
|
1770
|
-
for (; f =
|
|
1775
|
+
let d3 = this.#m, f;
|
|
1776
|
+
for (; f = d3?.shift(); ) this.#o?.(...f);
|
|
1771
1777
|
}
|
|
1772
1778
|
return this;
|
|
1773
1779
|
}
|
|
@@ -1816,18 +1822,18 @@ var ft = class Me {
|
|
|
1816
1822
|
if (s.status && (g && !w ? (s.status.fetchAborted = true, s.status.fetchError = o.signal.reason, S2 && (s.status.fetchAbortIgnored = true)) : s.status.fetchResolved = true), g && !S2 && !w) return c(o.signal.reason, E);
|
|
1817
1823
|
let y = f, b = this.#i[e];
|
|
1818
1824
|
return (b === f || S2 && w && b === void 0) && (p === void 0 ? y.__staleWhileFetching !== void 0 ? this.#i[e] = y.__staleWhileFetching : this.#O(t, "fetch") : (s.status && (s.status.fetchUpdated = true), this.set(t, p, a.options))), p;
|
|
1819
|
-
},
|
|
1825
|
+
}, u = (p) => (s.status && (s.status.fetchRejected = true, s.status.fetchError = p), c(p, false)), c = (p, w) => {
|
|
1820
1826
|
let { aborted: g } = o.signal, S2 = g && s.allowStaleOnFetchAbort, E = S2 || s.allowStaleOnFetchRejection, y = E || s.noDeleteOnFetchRejection, b = f;
|
|
1821
1827
|
if (this.#i[e] === f && (!y || !w && b.__staleWhileFetching === void 0 ? this.#O(t, "fetch") : S2 || (this.#i[e] = b.__staleWhileFetching)), E) return s.status && b.__staleWhileFetching !== void 0 && (s.status.returnedStale = true), b.__staleWhileFetching;
|
|
1822
1828
|
if (b.__returned === b) throw p;
|
|
1823
|
-
},
|
|
1829
|
+
}, d3 = (p, w) => {
|
|
1824
1830
|
let g = this.#S?.(t, r, a);
|
|
1825
1831
|
g && g instanceof Promise && g.then((S2) => p(S2 === void 0 ? void 0 : S2), w), o.signal.addEventListener("abort", () => {
|
|
1826
1832
|
(!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (S2) => l(S2, true)));
|
|
1827
1833
|
});
|
|
1828
1834
|
};
|
|
1829
1835
|
s.status && (s.status.fetchDispatched = true);
|
|
1830
|
-
let f = new Promise(
|
|
1836
|
+
let f = new Promise(d3).then(l, u), m = Object.assign(f, { __abortController: o, __staleWhileFetching: r, __returned: void 0 });
|
|
1831
1837
|
return e === void 0 ? (this.set(t, m, { ...a.options, status: void 0 }), e = this.#f.get(t)) : this.#i[e] = m, m;
|
|
1832
1838
|
}
|
|
1833
1839
|
#l(t) {
|
|
@@ -1836,9 +1842,9 @@ var ft = class Me {
|
|
|
1836
1842
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof At;
|
|
1837
1843
|
}
|
|
1838
1844
|
async fetch(t, e = {}) {
|
|
1839
|
-
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL:
|
|
1845
|
+
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: u = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d3 = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: m = this.allowStaleOnFetchAbort, context: p, forceRefresh: w = false, status: g, signal: S2 } = e;
|
|
1840
1846
|
if (!this.#A) return g && (g.fetch = "get"), this.get(t, { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, status: g });
|
|
1841
|
-
let E = { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, ttl: o, noDisposeOnSet: h, size: a, sizeCalculation: l, noUpdateTTL:
|
|
1847
|
+
let E = { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, ttl: o, noDisposeOnSet: h, size: a, sizeCalculation: l, noUpdateTTL: u, noDeleteOnFetchRejection: c, allowStaleOnFetchRejection: d3, allowStaleOnFetchAbort: m, ignoreFetchAbort: f, status: g, signal: S2 }, y = this.#f.get(t);
|
|
1842
1848
|
if (y === void 0) {
|
|
1843
1849
|
g && (g.fetch = "miss");
|
|
1844
1850
|
let b = this.#U(t, y, E, p);
|
|
@@ -1950,13 +1956,13 @@ var et = /* @__PURE__ */ Symbol("decoder");
|
|
|
1950
1956
|
var v = /* @__PURE__ */ Symbol("flowing");
|
|
1951
1957
|
var dt = /* @__PURE__ */ Symbol("paused");
|
|
1952
1958
|
var st = /* @__PURE__ */ Symbol("resume");
|
|
1953
|
-
var
|
|
1954
|
-
var
|
|
1955
|
-
var
|
|
1959
|
+
var C = /* @__PURE__ */ Symbol("buffer");
|
|
1960
|
+
var F = /* @__PURE__ */ Symbol("pipes");
|
|
1961
|
+
var T2 = /* @__PURE__ */ Symbol("bufferLength");
|
|
1956
1962
|
var Yt = /* @__PURE__ */ Symbol("bufferPush");
|
|
1957
1963
|
var Ft = /* @__PURE__ */ Symbol("bufferShift");
|
|
1958
|
-
var
|
|
1959
|
-
var
|
|
1964
|
+
var k2 = /* @__PURE__ */ Symbol("objectMode");
|
|
1965
|
+
var x2 = /* @__PURE__ */ Symbol("destroyed");
|
|
1960
1966
|
var Xt = /* @__PURE__ */ Symbol("error");
|
|
1961
1967
|
var Jt = /* @__PURE__ */ Symbol("emitData");
|
|
1962
1968
|
var We = /* @__PURE__ */ Symbol("emitEnd");
|
|
@@ -2002,9 +2008,9 @@ var pi = (n7) => !n7.objectMode && !!n7.encoding && n7.encoding !== "buffer";
|
|
|
2002
2008
|
var V = class extends ee {
|
|
2003
2009
|
[v] = false;
|
|
2004
2010
|
[dt] = false;
|
|
2005
|
-
[
|
|
2006
|
-
[
|
|
2007
|
-
[
|
|
2011
|
+
[F] = [];
|
|
2012
|
+
[C] = [];
|
|
2013
|
+
[k2];
|
|
2008
2014
|
[P2];
|
|
2009
2015
|
[B];
|
|
2010
2016
|
[et];
|
|
@@ -2013,8 +2019,8 @@ var V = class extends ee {
|
|
|
2013
2019
|
[kt] = false;
|
|
2014
2020
|
[Rt] = false;
|
|
2015
2021
|
[ut] = null;
|
|
2016
|
-
[
|
|
2017
|
-
[
|
|
2022
|
+
[T2] = 0;
|
|
2023
|
+
[x2] = false;
|
|
2018
2024
|
[pt];
|
|
2019
2025
|
[Dt] = false;
|
|
2020
2026
|
[Y] = 0;
|
|
@@ -2024,12 +2030,12 @@ var V = class extends ee {
|
|
|
2024
2030
|
constructor(...t) {
|
|
2025
2031
|
let e = t[0] || {};
|
|
2026
2032
|
if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
|
|
2027
|
-
di(e) ? (this[
|
|
2033
|
+
di(e) ? (this[k2] = true, this[P2] = null) : pi(e) ? (this[P2] = e.encoding, this[k2] = false) : (this[k2] = false, this[P2] = null), this[B] = !!e.async, this[et] = this[P2] ? new ni(this[P2]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[C] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[F] });
|
|
2028
2034
|
let { signal: s } = e;
|
|
2029
2035
|
s && (this[pt] = s, s.aborted ? this[Qt]() : s.addEventListener("abort", () => this[Qt]()));
|
|
2030
2036
|
}
|
|
2031
2037
|
get bufferLength() {
|
|
2032
|
-
return this[
|
|
2038
|
+
return this[T2];
|
|
2033
2039
|
}
|
|
2034
2040
|
get encoding() {
|
|
2035
2041
|
return this[P2];
|
|
@@ -2041,7 +2047,7 @@ var V = class extends ee {
|
|
|
2041
2047
|
throw new Error("Encoding must be set at instantiation time");
|
|
2042
2048
|
}
|
|
2043
2049
|
get objectMode() {
|
|
2044
|
-
return this[
|
|
2050
|
+
return this[k2];
|
|
2045
2051
|
}
|
|
2046
2052
|
set objectMode(t) {
|
|
2047
2053
|
throw new Error("objectMode must be set at instantiation time");
|
|
@@ -2063,36 +2069,36 @@ var V = class extends ee {
|
|
|
2063
2069
|
write(t, e, s) {
|
|
2064
2070
|
if (this[Dt]) return false;
|
|
2065
2071
|
if (this[G2]) throw new Error("write after end");
|
|
2066
|
-
if (this[
|
|
2072
|
+
if (this[x2]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
2067
2073
|
typeof e == "function" && (s = e, e = "utf8"), e || (e = "utf8");
|
|
2068
2074
|
let i = this[B] ? mt : li;
|
|
2069
|
-
if (!this[
|
|
2075
|
+
if (!this[k2] && !Buffer.isBuffer(t)) {
|
|
2070
2076
|
if (ui(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
2071
2077
|
else if (fi(t)) t = Buffer.from(t);
|
|
2072
2078
|
else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
2073
2079
|
}
|
|
2074
|
-
return this[
|
|
2080
|
+
return this[k2] ? (this[v] && this[T2] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T2] !== 0 && this.emit("readable"), s && i(s), this[v]) : t.length ? (typeof t == "string" && !(e === this[P2] && !this[et]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[P2] && (t = this[et].write(t)), this[v] && this[T2] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T2] !== 0 && this.emit("readable"), s && i(s), this[v]) : (this[T2] !== 0 && this.emit("readable"), s && i(s), this[v]);
|
|
2075
2081
|
}
|
|
2076
2082
|
read(t) {
|
|
2077
|
-
if (this[
|
|
2078
|
-
if (this[M2] = false, this[
|
|
2079
|
-
this[
|
|
2080
|
-
let e = this[_e](t || null, this[
|
|
2083
|
+
if (this[x2]) return null;
|
|
2084
|
+
if (this[M2] = false, this[T2] === 0 || t === 0 || t && t > this[T2]) return this[H2](), null;
|
|
2085
|
+
this[k2] && (t = null), this[C].length > 1 && !this[k2] && (this[C] = [this[P2] ? this[C].join("") : Buffer.concat(this[C], this[T2])]);
|
|
2086
|
+
let e = this[_e](t || null, this[C][0]);
|
|
2081
2087
|
return this[H2](), e;
|
|
2082
2088
|
}
|
|
2083
2089
|
[_e](t, e) {
|
|
2084
|
-
if (this[
|
|
2090
|
+
if (this[k2]) this[Ft]();
|
|
2085
2091
|
else {
|
|
2086
2092
|
let s = e;
|
|
2087
|
-
t === s.length || t === null ? this[Ft]() : typeof s == "string" ? (this[
|
|
2093
|
+
t === s.length || t === null ? this[Ft]() : typeof s == "string" ? (this[C][0] = s.slice(t), e = s.slice(0, t), this[T2] -= t) : (this[C][0] = s.subarray(t), e = s.subarray(0, t), this[T2] -= t);
|
|
2088
2094
|
}
|
|
2089
|
-
return this.emit("data", e), !this[
|
|
2095
|
+
return this.emit("data", e), !this[C].length && !this[G2] && this.emit("drain"), e;
|
|
2090
2096
|
}
|
|
2091
2097
|
end(t, e, s) {
|
|
2092
2098
|
return typeof t == "function" && (s = t, t = void 0), typeof e == "function" && (s = e, e = "utf8"), t !== void 0 && this.write(t, e), s && this.once("end", s), this[G2] = true, this.writable = false, (this[v] || !this[dt]) && this[H2](), this;
|
|
2093
2099
|
}
|
|
2094
2100
|
[st]() {
|
|
2095
|
-
this[
|
|
2101
|
+
this[x2] || (!this[Y] && !this[F].length && (this[M2] = true), this[dt] = false, this[v] = true, this.emit("resume"), this[C].length ? this[Ot]() : this[G2] ? this[H2]() : this.emit("drain"));
|
|
2096
2102
|
}
|
|
2097
2103
|
resume() {
|
|
2098
2104
|
return this[st]();
|
|
@@ -2101,7 +2107,7 @@ var V = class extends ee {
|
|
|
2101
2107
|
this[v] = false, this[dt] = true, this[M2] = false;
|
|
2102
2108
|
}
|
|
2103
2109
|
get destroyed() {
|
|
2104
|
-
return this[
|
|
2110
|
+
return this[x2];
|
|
2105
2111
|
}
|
|
2106
2112
|
get flowing() {
|
|
2107
2113
|
return this[v];
|
|
@@ -2110,37 +2116,37 @@ var V = class extends ee {
|
|
|
2110
2116
|
return this[dt];
|
|
2111
2117
|
}
|
|
2112
2118
|
[Yt](t) {
|
|
2113
|
-
this[
|
|
2119
|
+
this[k2] ? this[T2] += 1 : this[T2] += t.length, this[C].push(t);
|
|
2114
2120
|
}
|
|
2115
2121
|
[Ft]() {
|
|
2116
|
-
return this[
|
|
2122
|
+
return this[k2] ? this[T2] -= 1 : this[T2] -= this[C][0].length, this[C].shift();
|
|
2117
2123
|
}
|
|
2118
2124
|
[Ot](t = false) {
|
|
2119
2125
|
do
|
|
2120
2126
|
;
|
|
2121
|
-
while (this[Le](this[Ft]()) && this[
|
|
2122
|
-
!t && !this[
|
|
2127
|
+
while (this[Le](this[Ft]()) && this[C].length);
|
|
2128
|
+
!t && !this[C].length && !this[G2] && this.emit("drain");
|
|
2123
2129
|
}
|
|
2124
2130
|
[Le](t) {
|
|
2125
2131
|
return this.emit("data", t), this[v];
|
|
2126
2132
|
}
|
|
2127
2133
|
pipe(t, e) {
|
|
2128
|
-
if (this[
|
|
2134
|
+
if (this[x2]) return t;
|
|
2129
2135
|
this[M2] = false;
|
|
2130
2136
|
let s = this[K];
|
|
2131
|
-
return e = e || {}, t === Ne.stdout || t === Ne.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, s ? e.end && t.end() : (this[
|
|
2137
|
+
return e = e || {}, t === Ne.stdout || t === Ne.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, s ? e.end && t.end() : (this[F].push(e.proxyErrors ? new te(this, t, e) : new Mt(this, t, e)), this[B] ? mt(() => this[st]()) : this[st]()), t;
|
|
2132
2138
|
}
|
|
2133
2139
|
unpipe(t) {
|
|
2134
|
-
let e = this[
|
|
2135
|
-
e && (this[
|
|
2140
|
+
let e = this[F].find((s) => s.dest === t);
|
|
2141
|
+
e && (this[F].length === 1 ? (this[v] && this[Y] === 0 && (this[v] = false), this[F] = []) : this[F].splice(this[F].indexOf(e), 1), e.unpipe());
|
|
2136
2142
|
}
|
|
2137
2143
|
addListener(t, e) {
|
|
2138
2144
|
return this.on(t, e);
|
|
2139
2145
|
}
|
|
2140
2146
|
on(t, e) {
|
|
2141
2147
|
let s = super.on(t, e);
|
|
2142
|
-
if (t === "data") this[M2] = false, this[Y]++, !this[
|
|
2143
|
-
else if (t === "readable" && this[
|
|
2148
|
+
if (t === "data") this[M2] = false, this[Y]++, !this[F].length && !this[v] && this[st]();
|
|
2149
|
+
else if (t === "readable" && this[T2] !== 0) super.emit("readable");
|
|
2144
2150
|
else if (ci(t) && this[K]) super.emit(t), this.removeAllListeners(t);
|
|
2145
2151
|
else if (t === "error" && this[ut]) {
|
|
2146
2152
|
let i = e;
|
|
@@ -2153,25 +2159,25 @@ var V = class extends ee {
|
|
|
2153
2159
|
}
|
|
2154
2160
|
off(t, e) {
|
|
2155
2161
|
let s = super.off(t, e);
|
|
2156
|
-
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M2] && !this[
|
|
2162
|
+
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M2] && !this[F].length && (this[v] = false)), s;
|
|
2157
2163
|
}
|
|
2158
2164
|
removeAllListeners(t) {
|
|
2159
2165
|
let e = super.removeAllListeners(t);
|
|
2160
|
-
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M2] && !this[
|
|
2166
|
+
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M2] && !this[F].length && (this[v] = false)), e;
|
|
2161
2167
|
}
|
|
2162
2168
|
get emittedEnd() {
|
|
2163
2169
|
return this[K];
|
|
2164
2170
|
}
|
|
2165
2171
|
[H2]() {
|
|
2166
|
-
!this[kt] && !this[K] && !this[
|
|
2172
|
+
!this[kt] && !this[K] && !this[x2] && this[C].length === 0 && this[G2] && (this[kt] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Rt] && this.emit("close"), this[kt] = false);
|
|
2167
2173
|
}
|
|
2168
2174
|
emit(t, ...e) {
|
|
2169
2175
|
let s = e[0];
|
|
2170
|
-
if (t !== "error" && t !== "close" && t !==
|
|
2171
|
-
if (t === "data") return !this[
|
|
2176
|
+
if (t !== "error" && t !== "close" && t !== x2 && this[x2]) return false;
|
|
2177
|
+
if (t === "data") return !this[k2] && !s ? false : this[B] ? (mt(() => this[Jt](s)), true) : this[Jt](s);
|
|
2172
2178
|
if (t === "end") return this[We]();
|
|
2173
2179
|
if (t === "close") {
|
|
2174
|
-
if (this[Rt] = true, !this[K] && !this[
|
|
2180
|
+
if (this[Rt] = true, !this[K] && !this[x2]) return false;
|
|
2175
2181
|
let r = super.emit("close");
|
|
2176
2182
|
return this.removeAllListeners("close"), r;
|
|
2177
2183
|
} else if (t === "error") {
|
|
@@ -2189,7 +2195,7 @@ var V = class extends ee {
|
|
|
2189
2195
|
return this[H2](), i;
|
|
2190
2196
|
}
|
|
2191
2197
|
[Jt](t) {
|
|
2192
|
-
for (let s of this[
|
|
2198
|
+
for (let s of this[F]) s.dest.write(t) === false && this.pause();
|
|
2193
2199
|
let e = this[M2] ? false : super.emit("data", t);
|
|
2194
2200
|
return this[H2](), e;
|
|
2195
2201
|
}
|
|
@@ -2200,30 +2206,30 @@ var V = class extends ee {
|
|
|
2200
2206
|
if (this[et]) {
|
|
2201
2207
|
let e = this[et].end();
|
|
2202
2208
|
if (e) {
|
|
2203
|
-
for (let s of this[
|
|
2209
|
+
for (let s of this[F]) s.dest.write(e);
|
|
2204
2210
|
this[M2] || super.emit("data", e);
|
|
2205
2211
|
}
|
|
2206
2212
|
}
|
|
2207
|
-
for (let e of this[
|
|
2213
|
+
for (let e of this[F]) e.end();
|
|
2208
2214
|
let t = super.emit("end");
|
|
2209
2215
|
return this.removeAllListeners("end"), t;
|
|
2210
2216
|
}
|
|
2211
2217
|
async collect() {
|
|
2212
2218
|
let t = Object.assign([], { dataLength: 0 });
|
|
2213
|
-
this[
|
|
2219
|
+
this[k2] || (t.dataLength = 0);
|
|
2214
2220
|
let e = this.promise();
|
|
2215
2221
|
return this.on("data", (s) => {
|
|
2216
|
-
t.push(s), this[
|
|
2222
|
+
t.push(s), this[k2] || (t.dataLength += s.length);
|
|
2217
2223
|
}), await e, t;
|
|
2218
2224
|
}
|
|
2219
2225
|
async concat() {
|
|
2220
|
-
if (this[
|
|
2226
|
+
if (this[k2]) throw new Error("cannot concat in objectMode");
|
|
2221
2227
|
let t = await this.collect();
|
|
2222
2228
|
return this[P2] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
2223
2229
|
}
|
|
2224
2230
|
async promise() {
|
|
2225
2231
|
return new Promise((t, e) => {
|
|
2226
|
-
this.on(
|
|
2232
|
+
this.on(x2, () => e(new Error("stream destroyed"))), this.on("error", (s) => e(s)), this.on("end", () => t());
|
|
2227
2233
|
});
|
|
2228
2234
|
}
|
|
2229
2235
|
[Symbol.asyncIterator]() {
|
|
@@ -2235,14 +2241,14 @@ var V = class extends ee {
|
|
|
2235
2241
|
if (i !== null) return Promise.resolve({ done: false, value: i });
|
|
2236
2242
|
if (this[G2]) return e();
|
|
2237
2243
|
let r, o, h = (c) => {
|
|
2238
|
-
this.off("data", a), this.off("end", l), this.off(
|
|
2244
|
+
this.off("data", a), this.off("end", l), this.off(x2, u), e(), o(c);
|
|
2239
2245
|
}, a = (c) => {
|
|
2240
|
-
this.off("error", h), this.off("end", l), this.off(
|
|
2246
|
+
this.off("error", h), this.off("end", l), this.off(x2, u), this.pause(), r({ value: c, done: !!this[G2] });
|
|
2241
2247
|
}, l = () => {
|
|
2242
|
-
this.off("error", h), this.off("data", a), this.off(
|
|
2243
|
-
},
|
|
2244
|
-
return new Promise((c,
|
|
2245
|
-
o =
|
|
2248
|
+
this.off("error", h), this.off("data", a), this.off(x2, u), e(), r({ done: true, value: void 0 });
|
|
2249
|
+
}, u = () => h(new Error("stream destroyed"));
|
|
2250
|
+
return new Promise((c, d3) => {
|
|
2251
|
+
o = d3, r = c, this.once(x2, u), this.once("error", h), this.once("end", l), this.once("data", a);
|
|
2246
2252
|
});
|
|
2247
2253
|
}, throw: e, return: e, [Symbol.asyncIterator]() {
|
|
2248
2254
|
return this;
|
|
@@ -2251,21 +2257,21 @@ var V = class extends ee {
|
|
|
2251
2257
|
}
|
|
2252
2258
|
[Symbol.iterator]() {
|
|
2253
2259
|
this[M2] = false;
|
|
2254
|
-
let t = false, e = () => (this.pause(), this.off(Xt, e), this.off(
|
|
2260
|
+
let t = false, e = () => (this.pause(), this.off(Xt, e), this.off(x2, e), this.off("end", e), t = true, { done: true, value: void 0 }), s = () => {
|
|
2255
2261
|
if (t) return e();
|
|
2256
2262
|
let i = this.read();
|
|
2257
2263
|
return i === null ? e() : { done: false, value: i };
|
|
2258
2264
|
};
|
|
2259
|
-
return this.once("end", e), this.once(Xt, e), this.once(
|
|
2265
|
+
return this.once("end", e), this.once(Xt, e), this.once(x2, e), { next: s, throw: e, return: e, [Symbol.iterator]() {
|
|
2260
2266
|
return this;
|
|
2261
2267
|
}, [Symbol.dispose]: () => {
|
|
2262
2268
|
} };
|
|
2263
2269
|
}
|
|
2264
2270
|
destroy(t) {
|
|
2265
|
-
if (this[
|
|
2266
|
-
this[
|
|
2271
|
+
if (this[x2]) return t ? this.emit("error", t) : this.emit(x2), this;
|
|
2272
|
+
this[x2] = true, this[M2] = true, this[C].length = 0, this[T2] = 0;
|
|
2267
2273
|
let e = this;
|
|
2268
|
-
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(
|
|
2274
|
+
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(x2), this;
|
|
2269
2275
|
}
|
|
2270
2276
|
static get isStream() {
|
|
2271
2277
|
return oi;
|
|
@@ -2629,8 +2635,8 @@ var R2 = class {
|
|
|
2629
2635
|
}
|
|
2630
2636
|
}
|
|
2631
2637
|
#$(t) {
|
|
2632
|
-
let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: o, blocks: h, ctime: a, ctimeMs: l, dev:
|
|
2633
|
-
this.#b = e, this.#a = s, this.#m = i, this.#E = r, this.#c = o, this.#f = h, this.#R = a, this.#d = l, this.#s =
|
|
2638
|
+
let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: o, blocks: h, ctime: a, ctimeMs: l, dev: u, gid: c, ino: d3, mode: f, mtime: m, mtimeMs: p, nlink: w, rdev: g, size: S2, uid: E } = t;
|
|
2639
|
+
this.#b = e, this.#a = s, this.#m = i, this.#E = r, this.#c = o, this.#f = h, this.#R = a, this.#d = l, this.#s = u, this.#S = c, this.#h = d3, this.#n = f, this.#p = m, this.#i = p, this.#r = w, this.#w = g, this.#u = S2, this.#o = E;
|
|
2634
2640
|
let y = ie(t);
|
|
2635
2641
|
this.#e = this.#e & gt | y | je, y !== L2 && y !== U2 && y !== X && (this.#e |= yt);
|
|
2636
2642
|
}
|
|
@@ -2786,10 +2792,10 @@ var It = class {
|
|
|
2786
2792
|
let a = h.substring(this.rootPath.length).split(s);
|
|
2787
2793
|
if (a.length === 1 && !a[0] && a.pop(), i === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor");
|
|
2788
2794
|
this.nocase = i, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root;
|
|
2789
|
-
let l = this.root,
|
|
2795
|
+
let l = this.root, u = a.length - 1, c = e.sep, d3 = this.rootPath, f = false;
|
|
2790
2796
|
for (let m of a) {
|
|
2791
|
-
let p =
|
|
2792
|
-
l = l.child(m, { relative: new Array(p).fill("..").join(c), relativePosix: new Array(p).fill("..").join("/"), fullpath:
|
|
2797
|
+
let p = u--;
|
|
2798
|
+
l = l.child(m, { relative: new Array(p).fill("..").join(c), relativePosix: new Array(p).fill("..").join("/"), fullpath: d3 += (f ? "" : c) + m }), f = true;
|
|
2793
2799
|
}
|
|
2794
2800
|
this.cwd = l;
|
|
2795
2801
|
}
|
|
@@ -2876,20 +2882,20 @@ var It = class {
|
|
|
2876
2882
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R2 || (e = t, t = this.cwd);
|
|
2877
2883
|
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = [];
|
|
2878
2884
|
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
2879
|
-
let a = /* @__PURE__ */ new Set(), l = (c,
|
|
2885
|
+
let a = /* @__PURE__ */ new Set(), l = (c, d3) => {
|
|
2880
2886
|
a.add(c), c.readdirCB((f, m) => {
|
|
2881
|
-
if (f) return
|
|
2887
|
+
if (f) return d3(f);
|
|
2882
2888
|
let p = m.length;
|
|
2883
|
-
if (!p) return
|
|
2889
|
+
if (!p) return d3();
|
|
2884
2890
|
let w = () => {
|
|
2885
|
-
--p === 0 &&
|
|
2891
|
+
--p === 0 && d3();
|
|
2886
2892
|
};
|
|
2887
2893
|
for (let g of m) (!r || r(g)) && h.push(s ? g : g.fullpath()), i && g.isSymbolicLink() ? g.realpath().then((S2) => S2?.isUnknown() ? S2.lstat() : S2).then((S2) => S2?.shouldWalk(a, o) ? l(S2, w) : w()) : g.shouldWalk(a, o) ? l(g, w) : w();
|
|
2888
2894
|
}, true);
|
|
2889
|
-
},
|
|
2890
|
-
return new Promise((c,
|
|
2891
|
-
l(
|
|
2892
|
-
if (f) return
|
|
2895
|
+
}, u = t;
|
|
2896
|
+
return new Promise((c, d3) => {
|
|
2897
|
+
l(u, (f) => {
|
|
2898
|
+
if (f) return d3(f);
|
|
2893
2899
|
c(h);
|
|
2894
2900
|
});
|
|
2895
2901
|
});
|
|
@@ -2900,15 +2906,15 @@ var It = class {
|
|
|
2900
2906
|
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
2901
2907
|
let a = /* @__PURE__ */ new Set([t]);
|
|
2902
2908
|
for (let l of a) {
|
|
2903
|
-
let
|
|
2904
|
-
for (let c of
|
|
2909
|
+
let u = l.readdirSync();
|
|
2910
|
+
for (let c of u) {
|
|
2905
2911
|
(!r || r(c)) && h.push(s ? c : c.fullpath());
|
|
2906
|
-
let
|
|
2912
|
+
let d3 = c;
|
|
2907
2913
|
if (c.isSymbolicLink()) {
|
|
2908
|
-
if (!(i && (
|
|
2909
|
-
|
|
2914
|
+
if (!(i && (d3 = c.realpathSync()))) continue;
|
|
2915
|
+
d3.isUnknown() && d3.lstatSync();
|
|
2910
2916
|
}
|
|
2911
|
-
|
|
2917
|
+
d3.shouldWalk(a, o) && a.add(d3);
|
|
2912
2918
|
}
|
|
2913
2919
|
}
|
|
2914
2920
|
return h;
|
|
@@ -2929,11 +2935,11 @@ var It = class {
|
|
|
2929
2935
|
let h = /* @__PURE__ */ new Set([t]);
|
|
2930
2936
|
for (let a of h) {
|
|
2931
2937
|
let l = a.readdirSync();
|
|
2932
|
-
for (let
|
|
2933
|
-
(!r || r(
|
|
2934
|
-
let c =
|
|
2935
|
-
if (
|
|
2936
|
-
if (!(i && (c =
|
|
2938
|
+
for (let u of l) {
|
|
2939
|
+
(!r || r(u)) && (yield s ? u : u.fullpath());
|
|
2940
|
+
let c = u;
|
|
2941
|
+
if (u.isSymbolicLink()) {
|
|
2942
|
+
if (!(i && (c = u.realpathSync()))) continue;
|
|
2937
2943
|
c.isUnknown() && c.lstatSync();
|
|
2938
2944
|
}
|
|
2939
2945
|
c.shouldWalk(h, o) && h.add(c);
|
|
@@ -2944,15 +2950,15 @@ var It = class {
|
|
|
2944
2950
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R2 || (e = t, t = this.cwd);
|
|
2945
2951
|
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true });
|
|
2946
2952
|
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
2947
|
-
let a = /* @__PURE__ */ new Set(), l = [t],
|
|
2948
|
-
let
|
|
2949
|
-
for (; !
|
|
2953
|
+
let a = /* @__PURE__ */ new Set(), l = [t], u = 0, c = () => {
|
|
2954
|
+
let d3 = false;
|
|
2955
|
+
for (; !d3; ) {
|
|
2950
2956
|
let f = l.shift();
|
|
2951
2957
|
if (!f) {
|
|
2952
|
-
|
|
2958
|
+
u === 0 && h.end();
|
|
2953
2959
|
return;
|
|
2954
2960
|
}
|
|
2955
|
-
|
|
2961
|
+
u++, a.add(f);
|
|
2956
2962
|
let m = (w, g, S2 = false) => {
|
|
2957
2963
|
if (w) return h.emit("error", w);
|
|
2958
2964
|
if (i && !S2) {
|
|
@@ -2963,13 +2969,13 @@ var It = class {
|
|
|
2963
2969
|
return;
|
|
2964
2970
|
}
|
|
2965
2971
|
}
|
|
2966
|
-
for (let E of g) E && (!r || r(E)) && (h.write(s ? E : E.fullpath()) || (
|
|
2967
|
-
|
|
2972
|
+
for (let E of g) E && (!r || r(E)) && (h.write(s ? E : E.fullpath()) || (d3 = true));
|
|
2973
|
+
u--;
|
|
2968
2974
|
for (let E of g) {
|
|
2969
2975
|
let y = E.realpathCached() || E;
|
|
2970
2976
|
y.shouldWalk(a, o) && l.push(y);
|
|
2971
2977
|
}
|
|
2972
|
-
|
|
2978
|
+
d3 && !h.flowing ? h.once("drain", c) : p || c();
|
|
2973
2979
|
}, p = true;
|
|
2974
2980
|
f.readdirCB(m, true), p = false;
|
|
2975
2981
|
}
|
|
@@ -2980,18 +2986,18 @@ var It = class {
|
|
|
2980
2986
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R2 || (e = t, t = this.cwd);
|
|
2981
2987
|
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true }), a = /* @__PURE__ */ new Set();
|
|
2982
2988
|
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
2983
|
-
let l = [t],
|
|
2984
|
-
let
|
|
2985
|
-
for (; !
|
|
2989
|
+
let l = [t], u = 0, c = () => {
|
|
2990
|
+
let d3 = false;
|
|
2991
|
+
for (; !d3; ) {
|
|
2986
2992
|
let f = l.shift();
|
|
2987
2993
|
if (!f) {
|
|
2988
|
-
|
|
2994
|
+
u === 0 && h.end();
|
|
2989
2995
|
return;
|
|
2990
2996
|
}
|
|
2991
|
-
|
|
2997
|
+
u++, a.add(f);
|
|
2992
2998
|
let m = f.readdirSync();
|
|
2993
|
-
for (let p of m) (!r || r(p)) && (h.write(s ? p : p.fullpath()) || (
|
|
2994
|
-
|
|
2999
|
+
for (let p of m) (!r || r(p)) && (h.write(s ? p : p.fullpath()) || (d3 = true));
|
|
3000
|
+
u--;
|
|
2995
3001
|
for (let p of m) {
|
|
2996
3002
|
let w = p;
|
|
2997
3003
|
if (p.isSymbolicLink()) {
|
|
@@ -3001,7 +3007,7 @@ var It = class {
|
|
|
3001
3007
|
w.shouldWalk(a, o) && l.push(w);
|
|
3002
3008
|
}
|
|
3003
3009
|
}
|
|
3004
|
-
|
|
3010
|
+
d3 && !h.flowing && h.once("drain", c);
|
|
3005
3011
|
};
|
|
3006
3012
|
return c(), h;
|
|
3007
3013
|
}
|
|
@@ -3073,15 +3079,15 @@ var nt = class n4 {
|
|
|
3073
3079
|
if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range");
|
|
3074
3080
|
if (this.#t = t, this.#s = e, this.#n = s, this.#r = i, this.#n === 0) {
|
|
3075
3081
|
if (this.isUNC()) {
|
|
3076
|
-
let [r, o, h, a, ...l] = this.#t, [
|
|
3082
|
+
let [r, o, h, a, ...l] = this.#t, [u, c, d3, f, ...m] = this.#s;
|
|
3077
3083
|
l[0] === "" && (l.shift(), m.shift());
|
|
3078
|
-
let p = [r, o, h, a, ""].join("/"), w = [
|
|
3084
|
+
let p = [r, o, h, a, ""].join("/"), w = [u, c, d3, f, ""].join("/");
|
|
3079
3085
|
this.#t = [p, ...l], this.#s = [w, ...m], this.length = this.#t.length;
|
|
3080
3086
|
} else if (this.isDrive() || this.isAbsolute()) {
|
|
3081
3087
|
let [r, ...o] = this.#t, [h, ...a] = this.#s;
|
|
3082
3088
|
o[0] === "" && (o.shift(), a.shift());
|
|
3083
|
-
let l = r + "/",
|
|
3084
|
-
this.#t = [l, ...o], this.#s = [
|
|
3089
|
+
let l = r + "/", u = h + "/";
|
|
3090
|
+
this.#t = [l, ...o], this.#s = [u, ...a], this.length = this.#t.length;
|
|
3085
3091
|
}
|
|
3086
3092
|
}
|
|
3087
3093
|
}
|
|
@@ -3145,12 +3151,12 @@ var ot = class {
|
|
|
3145
3151
|
for (let h of t) this.add(h);
|
|
3146
3152
|
}
|
|
3147
3153
|
add(t) {
|
|
3148
|
-
let e = new
|
|
3154
|
+
let e = new D(t, this.mmopts);
|
|
3149
3155
|
for (let s = 0; s < e.set.length; s++) {
|
|
3150
3156
|
let i = e.set[s], r = e.globParts[s];
|
|
3151
3157
|
if (!i || !r) throw new Error("invalid pattern object");
|
|
3152
3158
|
for (; i[0] === "." && r[0] === "."; ) i.shift(), r.shift();
|
|
3153
|
-
let o = new nt(i, r, 0, this.platform), h = new
|
|
3159
|
+
let o = new nt(i, r, 0, this.platform), h = new D(o.globString(), this.mmopts), a = r[r.length - 1] === "**", l = o.isAbsolute();
|
|
3154
3160
|
l ? this.absolute.push(h) : this.relative.push(h), a && (l ? this.absoluteChildren.push(h) : this.relativeChildren.push(h));
|
|
3155
3161
|
}
|
|
3156
3162
|
}
|
|
@@ -3239,9 +3245,9 @@ var Et = class n6 {
|
|
|
3239
3245
|
}
|
|
3240
3246
|
}
|
|
3241
3247
|
if (i.isENOENT()) continue;
|
|
3242
|
-
let a, l,
|
|
3243
|
-
for (; typeof (a = r.pattern()) == "string" && (l = r.rest()); ) i = i.resolve(a), r = l,
|
|
3244
|
-
if (a = r.pattern(), l = r.rest(),
|
|
3248
|
+
let a, l, u = false;
|
|
3249
|
+
for (; typeof (a = r.pattern()) == "string" && (l = r.rest()); ) i = i.resolve(a), r = l, u = true;
|
|
3250
|
+
if (a = r.pattern(), l = r.rest(), u) {
|
|
3245
3251
|
if (this.hasWalkedCache.hasWalked(i, r)) continue;
|
|
3246
3252
|
this.hasWalkedCache.storeWalked(i, r);
|
|
3247
3253
|
}
|
|
@@ -3251,11 +3257,11 @@ var Et = class n6 {
|
|
|
3251
3257
|
continue;
|
|
3252
3258
|
} else if (a === A) {
|
|
3253
3259
|
(!i.isSymbolicLink() || this.follow || r.checkFollowGlobstar()) && this.subwalks.add(i, r);
|
|
3254
|
-
let c = l?.pattern(),
|
|
3255
|
-
if (!l || (c === "" || c === ".") && !
|
|
3260
|
+
let c = l?.pattern(), d3 = l?.rest();
|
|
3261
|
+
if (!l || (c === "" || c === ".") && !d3) this.matches.add(i, h, c === "" || c === ".");
|
|
3256
3262
|
else if (c === "..") {
|
|
3257
3263
|
let f = i.parent || i;
|
|
3258
|
-
|
|
3264
|
+
d3 ? this.hasWalkedCache.hasWalked(f, d3) || this.subwalks.add(f, d3) : this.matches.add(f, h, true);
|
|
3259
3265
|
}
|
|
3260
3266
|
} else a instanceof RegExp && this.subwalks.add(i, r);
|
|
3261
3267
|
}
|
|
@@ -3408,7 +3414,7 @@ var zt = class {
|
|
|
3408
3414
|
if (this.maxDepth !== 1 / 0 && h.depth() >= this.maxDepth) continue;
|
|
3409
3415
|
r++;
|
|
3410
3416
|
let a = h.readdirCached();
|
|
3411
|
-
h.calledReaddir() ? this.walkCB3(h, a, s, o) : h.readdirCB((l,
|
|
3417
|
+
h.calledReaddir() ? this.walkCB3(h, a, s, o) : h.readdirCB((l, u) => this.walkCB3(h, u, s, o), true);
|
|
3412
3418
|
}
|
|
3413
3419
|
o();
|
|
3414
3420
|
}
|
|
@@ -3537,11 +3543,11 @@ var I2 = class {
|
|
|
3537
3543
|
this.scurry = new a(this.cwd, { nocase: e.nocase, fs: e.fs });
|
|
3538
3544
|
}
|
|
3539
3545
|
this.nocase = this.scurry.nocase;
|
|
3540
|
-
let s = this.platform === "darwin" || this.platform === "win32", i = { braceExpandMax: 1e4, ...e, dot: this.dot, matchBase: this.matchBase, nobrace: this.nobrace, nocase: this.nocase, nocaseMagicOnly: s, nocomment: true, noext: this.noext, nonegate: true, optimizationLevel: 2, platform: this.platform, windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }, r = this.pattern.map((a) => new
|
|
3546
|
+
let s = this.platform === "darwin" || this.platform === "win32", i = { braceExpandMax: 1e4, ...e, dot: this.dot, matchBase: this.matchBase, nobrace: this.nobrace, nocase: this.nocase, nocaseMagicOnly: s, nocomment: true, noext: this.noext, nonegate: true, optimizationLevel: 2, platform: this.platform, windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }, r = this.pattern.map((a) => new D(a, i)), [o, h] = r.reduce((a, l) => (a[0].push(...l.set), a[1].push(...l.globParts), a), [[], []]);
|
|
3541
3547
|
this.patterns = o.map((a, l) => {
|
|
3542
|
-
let
|
|
3543
|
-
if (!
|
|
3544
|
-
return new nt(a,
|
|
3548
|
+
let u = h[l];
|
|
3549
|
+
if (!u) throw new Error("invalid pattern object");
|
|
3550
|
+
return new nt(a, u, 0, this.platform);
|
|
3545
3551
|
});
|
|
3546
3552
|
}
|
|
3547
3553
|
async walk() {
|
|
@@ -3571,7 +3577,7 @@ var I2 = class {
|
|
|
3571
3577
|
};
|
|
3572
3578
|
var le = (n7, t = {}) => {
|
|
3573
3579
|
Array.isArray(n7) || (n7 = [n7]);
|
|
3574
|
-
for (let e of n7) if (new
|
|
3580
|
+
for (let e of n7) if (new D(e, t).hasMagic()) return true;
|
|
3575
3581
|
return false;
|
|
3576
3582
|
};
|
|
3577
3583
|
function Bt(n7, t = {}) {
|
|
@@ -4255,7 +4261,7 @@ var success = (p) => p.then(
|
|
|
4255
4261
|
(result) => result,
|
|
4256
4262
|
() => FAILURE
|
|
4257
4263
|
);
|
|
4258
|
-
var Cache = class _Cache extends
|
|
4264
|
+
var Cache = class _Cache extends I {
|
|
4259
4265
|
#path;
|
|
4260
4266
|
[Symbol.toStringTag] = "@vltpkg/cache.Cache";
|
|
4261
4267
|
#random = randomBytes(6).toString("hex");
|
|
@@ -4282,18 +4288,18 @@ var Cache = class _Cache extends L {
|
|
|
4282
4288
|
onDiskDelete,
|
|
4283
4289
|
path,
|
|
4284
4290
|
fetchMethod: _2,
|
|
4285
|
-
sizeCalculation = options.maxSize || options.maxEntrySize ? (v2,
|
|
4291
|
+
sizeCalculation = options.maxSize || options.maxEntrySize ? (v2, k3) => v2.length + k3.length : void 0,
|
|
4286
4292
|
...lruOpts
|
|
4287
4293
|
} = options;
|
|
4288
4294
|
super({
|
|
4289
4295
|
max: _Cache.defaultMax,
|
|
4290
4296
|
...lruOpts,
|
|
4291
4297
|
sizeCalculation,
|
|
4292
|
-
fetchMethod: async (
|
|
4298
|
+
fetchMethod: async (k3, v2, opts) => {
|
|
4293
4299
|
Object.assign(opts.options, {
|
|
4294
4300
|
noDiskWrite: true
|
|
4295
4301
|
});
|
|
4296
|
-
return this.#diskRead(
|
|
4302
|
+
return this.#diskRead(k3, v2, opts.context?.integrity);
|
|
4297
4303
|
},
|
|
4298
4304
|
allowStaleOnFetchRejection: true,
|
|
4299
4305
|
allowStaleOnFetchAbort: true,
|
|
@@ -4522,9 +4528,9 @@ var Cache = class _Cache extends L {
|
|
|
4522
4528
|
}
|
|
4523
4529
|
return finish([this.#linkAtomic(intFile, valFile)]);
|
|
4524
4530
|
}
|
|
4525
|
-
async #diskRead(
|
|
4531
|
+
async #diskRead(k3, v2, integrity) {
|
|
4526
4532
|
const intFile = this.#maybeIntegrityPath(integrity);
|
|
4527
|
-
const file = this.path(
|
|
4533
|
+
const file = this.path(k3);
|
|
4528
4534
|
const p = intFile ? readFile(intFile).catch(async () => {
|
|
4529
4535
|
const value = await readFile(file);
|
|
4530
4536
|
await link(file, intFile);
|
|
@@ -4564,14 +4570,14 @@ var main = async (path, input = process.stdin) => {
|
|
|
4564
4570
|
const a = buf[offset];
|
|
4565
4571
|
const b = buf[offset + 1];
|
|
4566
4572
|
const c = buf[offset + 2];
|
|
4567
|
-
const
|
|
4568
|
-
if (a === void 0 || b === void 0 || c === void 0 ||
|
|
4573
|
+
const d3 = buf[offset + 3];
|
|
4574
|
+
if (a === void 0 || b === void 0 || c === void 0 || d3 === void 0) {
|
|
4569
4575
|
throw error("Invalid buffer, not long enough to readSize", {
|
|
4570
4576
|
found: buf,
|
|
4571
4577
|
offset
|
|
4572
4578
|
});
|
|
4573
4579
|
}
|
|
4574
|
-
return a << 24 | b << 16 | c << 8 |
|
|
4580
|
+
return a << 24 | b << 16 | c << 8 | d3;
|
|
4575
4581
|
};
|
|
4576
4582
|
const results = await Promise.all(
|
|
4577
4583
|
keys.map(async (key) => {
|