@vltpkg/cli-js 1.0.0-rc.32 → 1.0.0-rc.34
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-SXQICNAN.js} +23 -12
- package/{bugs-BMZ5UERM.js → bugs-OOPMFRCI.js} +19 -17
- package/{build-LGQI6OGM.js → build-HDXI5OA7.js} +13 -9
- package/{cache-JWHNATAX.js → cache-RW4Y4XNQ.js} +19 -14
- package/cache-unzip-src-unzip.js +434 -428
- package/{chunk-6YXVQ5HC.js → chunk-2PLIV3N3.js} +1 -27
- package/{chunk-G6PG3AGN.js → chunk-3SQ5Y324.js} +11 -8
- package/{chunk-ZUP6UTME.js → chunk-4RZDJQ5U.js} +42 -61
- package/{chunk-M2WD7IBO.js → chunk-4ZXA6RLP.js} +1 -1
- package/{chunk-R44FR7BY.js → chunk-7NHXV6AH.js} +439 -433
- package/{chunk-SIXXDCBI.js → chunk-CCQYIYTA.js} +7 -7
- package/{chunk-FXDRM4ZO.js → chunk-CLVRCGOZ.js} +247 -235
- package/{chunk-YCQTLBWF.js → chunk-CNSTFT7U.js} +1 -1
- package/{chunk-7XE7OES7.js → chunk-D5CP6O6G.js} +3 -3
- package/{chunk-YQXDHMHG.js → chunk-E5YE7UTZ.js} +3167 -2991
- package/chunk-E74WGW5C.js +49 -0
- package/{chunk-DFNHGGGV.js → chunk-EFWPI6IY.js} +1 -1
- package/{chunk-5UXEBLLT.js → chunk-EHEVBLDB.js} +68 -7
- 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-HB7CKTYO.js +75 -0
- package/{chunk-KRGA5VLT.js → chunk-ICJRCXSG.js} +31 -27
- package/{chunk-FBTBHRPG.js → chunk-LCDBW6IT.js} +1 -1
- package/{chunk-IAKUGHGT.js → chunk-MT76WHSM.js} +1 -1
- package/{chunk-3TVABXAG.js → chunk-MU7Y4R5E.js} +3 -3
- package/{chunk-JKAZKVQU.js → chunk-PW6S6AIO.js} +15 -11
- package/{chunk-DI2CYYXF.js → chunk-U6DM3ROE.js} +706 -442
- package/chunk-UBLFPJHV.js +40 -0
- package/{chunk-SDBTQF2Y.js → chunk-UCD3RJYG.js} +5 -5
- package/{chunk-XFQ2EH5D.js → chunk-VM2RMMY4.js} +3 -3
- package/{chunk-DIKKTUBV.js → chunk-VZ7UNZHR.js} +3 -3
- package/{chunk-2V4AQPBR.js → chunk-WP6CYBPM.js} +81 -46
- package/{chunk-LEX7YPHR.js → chunk-WXMYKCQW.js} +118 -92
- package/{chunk-LRPTCGTW.js → chunk-XA47WS4N.js} +11 -15
- package/{chunk-NLFBANVO.js → chunk-Y7CQIZ7Y.js} +106 -150
- package/{ci-FQJANSQW.js → ci-MTYU2K2A.js} +14 -10
- package/cli-package.json +6 -2
- package/{config-4KQTTXJH.js → config-6NXV2BXW.js} +15 -13
- package/{config-LRL3N7TN.js → config-TVAXCTQO.js} +13 -11
- package/{create-KN6AXEA6.js → create-LXI5DCDW.js} +24 -19
- package/{deprecate-P26WHVFB.js → deprecate-2AQBL5XT.js} +22 -14
- package/{devtools-6NFQDW4L.js → devtools-HGLF4KAO.js} +82 -28
- package/{dist-tag-FA2BT7SA.js → dist-tag-BFSYLRIH.js} +16 -9
- package/{docs-OAPIY4SC.js → docs-ADPJ4B4C.js} +19 -17
- package/{exec-CVZGHJZS.js → exec-GMS54RAC.js} +24 -19
- package/{exec-cache-3AHODVRN.js → exec-cache-R5LVZL5Z.js} +22 -17
- package/{exec-local-I4OJX76E.js → exec-local-TVCLZGIM.js} +17 -14
- package/{help-QFIQSPNS.js → help-6CECUD6C.js} +5 -4
- package/{init-QLADIAP5.js → init-XXFLGYVP.js} +12 -10
- package/{install-B7CU2BLC.js → install-6KMXYSF5.js} +27 -12
- package/{list-OTFV3LOM.js → list-RUO3SUKY.js} +20 -15
- package/{login-LG2ZOIDQ.js → login-6I2CGO7I.js} +23 -9
- package/{logout-KUI773AM.js → logout-JTU4BJKH.js} +19 -8
- package/{pack-C55TTBIQ.js → pack-NCWH2TUA.js} +17 -13
- package/package.json +8 -1
- package/{ping-VNUOC26G.js → ping-4MEAC2WD.js} +17 -10
- package/{pkg-H4RJEBK5.js → pkg-ENSKG6G7.js} +13 -11
- package/{profile-DIJ5JUSE.js → profile-62YHNFSO.js} +16 -8
- package/{publish-XF2TRBPH.js → publish-PPY724N2.js} +58 -23
- package/{query-BGP5JMJ7.js → query-NLWXKOOT.js} +61 -15
- package/registry-QGI44LG4.js +117 -0
- package/registry-client-package.json +6 -2
- package/registry-client-src-revalidate.js +1245 -977
- package/{repo-NCEHK7KB.js → repo-BFRAXIVU.js} +19 -17
- package/{reporter-OB6SNHOZ.js → reporter-2XBYWAVU.js} +3 -2
- package/{run-ZNJJYEJF.js → run-7O65747G.js} +17 -14
- package/{run-exec-F5OV7MVN.js → run-exec-2OYWHL6K.js} +19 -14
- package/security-archive-src-update-expired.js +16 -11
- package/setup-MMIDAIJI.js +181 -0
- package/{src-M3WI7TSB.js → src-OK3KHDYR.js} +25 -17
- package/{token-KXCVRJGF.js → token-VLVXUW54.js} +20 -9
- package/{uninstall-33SUWR6K.js → uninstall-TAG6QIAG.js} +15 -11
- package/{unpublish-7AZPBZF2.js → unpublish-Y4L5J2IA.js} +17 -9
- package/{update-2EQF6IKZ.js → update-RYH4RKBS.js} +14 -10
- package/{version-HFYI3SEX.js → version-COHB32ON.js} +12 -10
- package/{view-C5OT36OB.js → view-P7U4MF43.js} +18 -14
- 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-47MVFMZC.js} +19 -8
- package/chunk-FXIBCUIM.js +0 -73
|
@@ -13,38 +13,38 @@ import {
|
|
|
13
13
|
error
|
|
14
14
|
} from "./chunk-WZWDS3W4.js";
|
|
15
15
|
|
|
16
|
-
// ../../node_modules/.vlt/~npm~lru-cache@11.
|
|
17
|
-
import { tracingChannel as
|
|
18
|
-
var S =
|
|
19
|
-
var W =
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
typeof
|
|
16
|
+
// ../../node_modules/.vlt/~npm~lru-cache@11.5.2/node_modules/lru-cache/dist/esm/node/index.min.js
|
|
17
|
+
import { tracingChannel as G, channel as P } from "node:diagnostics_channel";
|
|
18
|
+
var S = P("lru-cache:metrics");
|
|
19
|
+
var W = G("lru-cache");
|
|
20
|
+
var L = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
21
|
+
var R = () => S.hasSubscribers || W.hasSubscribers;
|
|
22
|
+
var U = /* @__PURE__ */ new Set();
|
|
23
|
+
var M = typeof process == "object" && process ? process : {};
|
|
24
|
+
var k = (d4, e, t, i2) => {
|
|
25
|
+
typeof M.emitWarning == "function" ? M.emitWarning(d4, e, t, i2) : console.error(`[${t}] ${e}: ${d4}`);
|
|
26
26
|
};
|
|
27
|
-
var H = (
|
|
28
|
-
var
|
|
29
|
-
var
|
|
27
|
+
var H = (d4) => !U.has(d4);
|
|
28
|
+
var T = (d4) => !!d4 && d4 === Math.floor(d4) && d4 > 0 && isFinite(d4);
|
|
29
|
+
var j = (d4) => T(d4) ? d4 <= Math.pow(2, 8) ? Uint8Array : d4 <= Math.pow(2, 16) ? Uint16Array : d4 <= Math.pow(2, 32) ? Uint32Array : d4 <= Number.MAX_SAFE_INTEGER ? O : null : null;
|
|
30
30
|
var O = class extends Array {
|
|
31
31
|
constructor(e) {
|
|
32
32
|
super(e), this.fill(0);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
var
|
|
35
|
+
var x = class d {
|
|
36
36
|
heap;
|
|
37
37
|
length;
|
|
38
38
|
static #o = false;
|
|
39
39
|
static create(e) {
|
|
40
|
-
let t =
|
|
40
|
+
let t = j(e);
|
|
41
41
|
if (!t) return [];
|
|
42
|
-
|
|
43
|
-
let i2 = new
|
|
44
|
-
return
|
|
42
|
+
d.#o = true;
|
|
43
|
+
let i2 = new d(e, t);
|
|
44
|
+
return d.#o = false, i2;
|
|
45
45
|
}
|
|
46
46
|
constructor(e, t) {
|
|
47
|
-
if (!
|
|
47
|
+
if (!d.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
48
48
|
this.heap = new t(e), this.length = 0;
|
|
49
49
|
}
|
|
50
50
|
push(e) {
|
|
@@ -54,14 +54,14 @@ var R = class u {
|
|
|
54
54
|
return this.heap[--this.length];
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
var
|
|
57
|
+
var I = class d2 {
|
|
58
58
|
#o;
|
|
59
|
-
#
|
|
60
|
-
#w;
|
|
61
|
-
#D;
|
|
59
|
+
#c;
|
|
62
60
|
#S;
|
|
61
|
+
#O;
|
|
62
|
+
#w;
|
|
63
63
|
#M;
|
|
64
|
-
#
|
|
64
|
+
#I;
|
|
65
65
|
#m;
|
|
66
66
|
get perf() {
|
|
67
67
|
return this.#m;
|
|
@@ -81,14 +81,15 @@ var L = class u2 {
|
|
|
81
81
|
allowStaleOnFetchAbort;
|
|
82
82
|
allowStaleOnFetchRejection;
|
|
83
83
|
ignoreFetchAbort;
|
|
84
|
+
backgroundFetchSize;
|
|
84
85
|
#n;
|
|
85
86
|
#b;
|
|
86
87
|
#s;
|
|
87
88
|
#i;
|
|
88
89
|
#t;
|
|
89
|
-
#a;
|
|
90
|
-
#c;
|
|
91
90
|
#l;
|
|
91
|
+
#u;
|
|
92
|
+
#a;
|
|
92
93
|
#h;
|
|
93
94
|
#y;
|
|
94
95
|
#r;
|
|
@@ -97,12 +98,12 @@ var L = class u2 {
|
|
|
97
98
|
#d;
|
|
98
99
|
#g;
|
|
99
100
|
#T;
|
|
100
|
-
#
|
|
101
|
+
#U;
|
|
101
102
|
#f;
|
|
102
|
-
#
|
|
103
|
+
#D;
|
|
103
104
|
static unsafeExposeInternals(e) {
|
|
104
|
-
return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#
|
|
105
|
-
return e.#
|
|
105
|
+
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() {
|
|
106
|
+
return e.#a;
|
|
106
107
|
}, get tail() {
|
|
107
108
|
return e.#h;
|
|
108
109
|
}, free: e.#y, isBackgroundFetch: (t) => e.#e(t), backgroundFetch: (t, i2, s, n7) => e.#P(t, i2, s, n7), moveToTail: (t) => e.#L(t), indexes: (t) => e.#A(t), rindexes: (t) => e.#z(t), isStale: (t) => e.#p(t) };
|
|
@@ -111,7 +112,7 @@ var L = class u2 {
|
|
|
111
112
|
return this.#o;
|
|
112
113
|
}
|
|
113
114
|
get maxSize() {
|
|
114
|
-
return this.#
|
|
115
|
+
return this.#c;
|
|
115
116
|
}
|
|
116
117
|
get calculatedSize() {
|
|
117
118
|
return this.#b;
|
|
@@ -123,134 +124,139 @@ var L = class u2 {
|
|
|
123
124
|
return this.#M;
|
|
124
125
|
}
|
|
125
126
|
get memoMethod() {
|
|
126
|
-
return this.#
|
|
127
|
+
return this.#I;
|
|
127
128
|
}
|
|
128
129
|
get dispose() {
|
|
129
|
-
return this.#
|
|
130
|
+
return this.#S;
|
|
130
131
|
}
|
|
131
132
|
get onInsert() {
|
|
132
|
-
return this.#
|
|
133
|
+
return this.#O;
|
|
133
134
|
}
|
|
134
135
|
get disposeAfter() {
|
|
135
|
-
return this.#
|
|
136
|
+
return this.#w;
|
|
136
137
|
}
|
|
137
138
|
constructor(e) {
|
|
138
|
-
let { max: t = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n7, updateAgeOnGet: o, updateAgeOnHas:
|
|
139
|
-
if (
|
|
140
|
-
if (this.#m =
|
|
141
|
-
let v3 = t ?
|
|
139
|
+
let { max: t = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n7, updateAgeOnGet: o, updateAgeOnHas: l, allowStale: h, dispose: r, onInsert: c, disposeAfter: m2, noDisposeOnSet: _3, noUpdateTTL: u2, maxSize: g2 = 0, maxEntrySize: f = 0, sizeCalculation: y2, fetchMethod: a2, memoMethod: w2, noDeleteOnFetchRejection: F3, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: A3, ignoreFetchAbort: z, backgroundFetchSize: C3 = 1, perf: E } = e;
|
|
140
|
+
if (this.backgroundFetchSize = C3, E !== void 0 && typeof E?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
141
|
+
if (this.#m = E ?? L, t !== 0 && !T(t)) throw new TypeError("max option must be a nonnegative integer");
|
|
142
|
+
let v3 = t ? j(t) : Array;
|
|
142
143
|
if (!v3) throw new Error("invalid max value: " + t);
|
|
143
|
-
if (this.#o = t, this.#
|
|
144
|
-
if (!this.#
|
|
144
|
+
if (this.#o = t, this.#c = g2, this.maxEntrySize = f || this.#c, this.sizeCalculation = y2, this.sizeCalculation) {
|
|
145
|
+
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
145
146
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
146
147
|
}
|
|
147
|
-
if (
|
|
148
|
-
if (this.#
|
|
149
|
-
if (this.#M = a2, this.#
|
|
150
|
-
if (this.#
|
|
151
|
-
if (!
|
|
148
|
+
if (w2 !== void 0 && typeof w2 != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
149
|
+
if (this.#I = w2, a2 !== void 0 && typeof a2 != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
150
|
+
if (this.#M = a2, this.#U = !!a2, 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 v3(t), this.#u = new v3(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 m2 == "function" ? (this.#w = m2, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#S, this.#D = !!this.#O, this.#f = !!this.#w, this.noDisposeOnSet = !!_3, this.noUpdateTTL = !!u2, this.noDeleteOnFetchRejection = !!F3, this.allowStaleOnFetchRejection = !!p, this.allowStaleOnFetchAbort = !!A3, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
151
|
+
if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
152
|
+
if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
152
153
|
this.#X();
|
|
153
154
|
}
|
|
154
|
-
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!
|
|
155
|
-
if (!
|
|
156
|
-
this.#
|
|
155
|
+
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 = i2 || 0, this.ttl) {
|
|
156
|
+
if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
157
|
+
this.#k();
|
|
157
158
|
}
|
|
158
|
-
if (this.#o === 0 && this.ttl === 0 && this.#
|
|
159
|
-
if (!this.ttlAutopurge && !this.#o && !this.#
|
|
160
|
-
let
|
|
161
|
-
H(
|
|
159
|
+
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
160
|
+
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
161
|
+
let D2 = "LRU_CACHE_UNBOUNDED";
|
|
162
|
+
H(D2) && (U.add(D2), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", D2, d2));
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
getRemainingTTL(e) {
|
|
165
166
|
return this.#s.has(e) ? 1 / 0 : 0;
|
|
166
167
|
}
|
|
167
|
-
#
|
|
168
|
+
#k() {
|
|
168
169
|
let e = new O(this.#o), t = new O(this.#o);
|
|
169
170
|
this.#d = e, this.#F = t;
|
|
170
171
|
let i2 = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
171
|
-
this.#g = i2, this.#
|
|
172
|
-
t[
|
|
173
|
-
}, this.#
|
|
174
|
-
t[
|
|
172
|
+
this.#g = i2, this.#H = (h, r, c = this.#m.now()) => {
|
|
173
|
+
t[h] = r !== 0 ? c : 0, e[h] = r, s(h, r);
|
|
174
|
+
}, this.#R = (h) => {
|
|
175
|
+
t[h] = e[h] !== 0 ? this.#m.now() : 0, s(h, e[h]);
|
|
175
176
|
};
|
|
176
|
-
let s = this.ttlAutopurge ? (
|
|
177
|
-
if (i2?.[
|
|
178
|
-
let
|
|
179
|
-
this.#p(
|
|
180
|
-
},
|
|
181
|
-
|
|
177
|
+
let s = this.ttlAutopurge ? (h, r) => {
|
|
178
|
+
if (i2?.[h] && (clearTimeout(i2[h]), i2[h] = void 0), r && r !== 0 && i2) {
|
|
179
|
+
let c = setTimeout(() => {
|
|
180
|
+
this.#p(h) ? (this.#E(this.#i[h], "expire"), i2[h] = void 0) : s(h, l(h));
|
|
181
|
+
}, r + 1);
|
|
182
|
+
c.unref && c.unref(), i2[h] = c;
|
|
182
183
|
}
|
|
183
184
|
} : () => {
|
|
184
185
|
};
|
|
185
|
-
this.#
|
|
186
|
-
if (e[
|
|
187
|
-
let
|
|
188
|
-
if (!
|
|
189
|
-
|
|
190
|
-
let
|
|
191
|
-
|
|
186
|
+
this.#v = (h, r) => {
|
|
187
|
+
if (e[r]) {
|
|
188
|
+
let c = e[r], m2 = t[r];
|
|
189
|
+
if (!c || !m2) return;
|
|
190
|
+
h.ttl = c, h.start = m2, h.now = n7 || o();
|
|
191
|
+
let _3 = h.now - m2;
|
|
192
|
+
h.remainingTTL = c - _3;
|
|
192
193
|
}
|
|
193
194
|
};
|
|
194
195
|
let n7 = 0, o = () => {
|
|
195
|
-
let
|
|
196
|
+
let h = this.#m.now();
|
|
196
197
|
if (this.ttlResolution > 0) {
|
|
197
|
-
n7 =
|
|
198
|
-
let
|
|
199
|
-
|
|
198
|
+
n7 = h;
|
|
199
|
+
let r = setTimeout(() => n7 = 0, this.ttlResolution);
|
|
200
|
+
r.unref && r.unref();
|
|
200
201
|
}
|
|
201
|
-
return
|
|
202
|
+
return h;
|
|
202
203
|
};
|
|
203
|
-
this.getRemainingTTL = (
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
let
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
204
|
+
this.getRemainingTTL = (h) => {
|
|
205
|
+
let r = this.#s.get(h);
|
|
206
|
+
return r === void 0 ? 0 : l(r);
|
|
207
|
+
};
|
|
208
|
+
let l = (h) => {
|
|
209
|
+
let r = e[h], c = t[h];
|
|
210
|
+
if (!r || !c) return 1 / 0;
|
|
211
|
+
let m2 = (n7 || o()) - c;
|
|
212
|
+
return r - m2;
|
|
213
|
+
};
|
|
214
|
+
this.#p = (h) => {
|
|
215
|
+
let r = t[h], c = e[h];
|
|
216
|
+
return !!c && !!r && (n7 || o()) - r > c;
|
|
213
217
|
};
|
|
214
218
|
}
|
|
215
|
-
#
|
|
219
|
+
#R = () => {
|
|
216
220
|
};
|
|
217
|
-
#
|
|
221
|
+
#v = () => {
|
|
218
222
|
};
|
|
219
|
-
#
|
|
223
|
+
#H = () => {
|
|
220
224
|
};
|
|
221
225
|
#p = () => false;
|
|
222
226
|
#X() {
|
|
223
227
|
let e = new O(this.#o);
|
|
224
|
-
this.#b = 0, this.#_ = e, this.#
|
|
228
|
+
this.#b = 0, this.#_ = e, this.#x = (t) => {
|
|
225
229
|
this.#b -= e[t], e[t] = 0;
|
|
226
|
-
}, this.#
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
-
if (
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
}, this.#N = (t, i2, s, n7) => {
|
|
231
|
+
if (!T(s)) {
|
|
232
|
+
if (this.#e(i2)) return this.backgroundFetchSize;
|
|
233
|
+
if (n7) {
|
|
234
|
+
if (typeof n7 != "function") throw new TypeError("sizeCalculation must be a function");
|
|
235
|
+
if (s = n7(i2, t), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
236
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
237
|
+
}
|
|
232
238
|
return s;
|
|
233
|
-
}, this.#
|
|
234
|
-
if (e[t] = i2, this.#
|
|
235
|
-
let n7 = this.#
|
|
239
|
+
}, this.#j = (t, i2, s) => {
|
|
240
|
+
if (e[t] = i2, this.#c) {
|
|
241
|
+
let n7 = this.#c - e[t];
|
|
236
242
|
for (; this.#b > n7; ) this.#G(true);
|
|
237
243
|
}
|
|
238
244
|
this.#b += e[t], s && (s.entrySize = i2, s.totalCalculatedSize = this.#b);
|
|
239
245
|
};
|
|
240
246
|
}
|
|
241
|
-
#
|
|
247
|
+
#x = (e) => {
|
|
242
248
|
};
|
|
243
|
-
#
|
|
249
|
+
#j = (e, t, i2) => {
|
|
244
250
|
};
|
|
245
|
-
#
|
|
251
|
+
#N = (e, t, i2, s) => {
|
|
246
252
|
if (i2 || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
247
253
|
return 0;
|
|
248
254
|
};
|
|
249
255
|
*#A({ allowStale: e = this.allowStale } = {}) {
|
|
250
|
-
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#
|
|
256
|
+
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#a); ) t = this.#u[t];
|
|
251
257
|
}
|
|
252
258
|
*#z({ allowStale: e = this.allowStale } = {}) {
|
|
253
|
-
if (this.#n) for (let t = this.#
|
|
259
|
+
if (this.#n) for (let t = this.#a; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#h); ) t = this.#l[t];
|
|
254
260
|
}
|
|
255
261
|
#V(e) {
|
|
256
262
|
return e !== void 0 && this.#s.get(this.#i[e]) === e;
|
|
@@ -303,7 +309,7 @@ var L = class u2 {
|
|
|
303
309
|
}
|
|
304
310
|
purgeStale() {
|
|
305
311
|
let e = false;
|
|
306
|
-
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#
|
|
312
|
+
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#E(this.#i[t], "expire"), e = true);
|
|
307
313
|
return e;
|
|
308
314
|
}
|
|
309
315
|
info(e) {
|
|
@@ -313,9 +319,9 @@ var L = class u2 {
|
|
|
313
319
|
if (s === void 0) return;
|
|
314
320
|
let n7 = { value: s };
|
|
315
321
|
if (this.#d && this.#F) {
|
|
316
|
-
let o = this.#d[t],
|
|
317
|
-
if (o &&
|
|
318
|
-
let h = o - (this.#m.now() -
|
|
322
|
+
let o = this.#d[t], l = this.#F[t];
|
|
323
|
+
if (o && l) {
|
|
324
|
+
let h = o - (this.#m.now() - l);
|
|
319
325
|
n7.ttl = h, n7.start = Date.now();
|
|
320
326
|
}
|
|
321
327
|
}
|
|
@@ -329,8 +335,8 @@ var L = class u2 {
|
|
|
329
335
|
let o = { value: n7 };
|
|
330
336
|
if (this.#d && this.#F) {
|
|
331
337
|
o.ttl = this.#d[t];
|
|
332
|
-
let
|
|
333
|
-
o.start = Math.floor(Date.now() -
|
|
338
|
+
let l = this.#m.now() - this.#F[t];
|
|
339
|
+
o.start = Math.floor(Date.now() - l);
|
|
334
340
|
}
|
|
335
341
|
this.#_ && (o.size = this.#_[t]), e.unshift([i2, o]);
|
|
336
342
|
}
|
|
@@ -343,51 +349,49 @@ var L = class u2 {
|
|
|
343
349
|
let s = Date.now() - i2.start;
|
|
344
350
|
i2.start = this.#m.now() - s;
|
|
345
351
|
}
|
|
346
|
-
this.#
|
|
352
|
+
this.#W(t, i2.value, i2);
|
|
347
353
|
}
|
|
348
354
|
}
|
|
349
355
|
set(e, t, i2 = {}) {
|
|
350
356
|
let { status: s = S.hasSubscribers ? {} : void 0 } = i2;
|
|
351
|
-
i2.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t));
|
|
352
|
-
let n7 = this.#
|
|
357
|
+
i2.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t), s.cache = this);
|
|
358
|
+
let n7 = this.#W(e, t, i2);
|
|
353
359
|
return s && S.hasSubscribers && S.publish(s), n7;
|
|
354
360
|
}
|
|
355
|
-
#
|
|
356
|
-
let { ttl:
|
|
357
|
-
if (t === void 0) return
|
|
358
|
-
let { noUpdateTTL:
|
|
359
|
-
|
|
360
|
-
let
|
|
361
|
-
if (this.maxEntrySize &&
|
|
362
|
-
let
|
|
363
|
-
if (
|
|
361
|
+
#W(e, t, i2, s) {
|
|
362
|
+
let { ttl: n7 = this.ttl, start: o, noDisposeOnSet: l = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i2, c = this.#e(t);
|
|
363
|
+
if (t === void 0) return r && (r.set = "deleted"), this.delete(e), this;
|
|
364
|
+
let { noUpdateTTL: m2 = this.noUpdateTTL } = i2;
|
|
365
|
+
r && !c && (r.value = t);
|
|
366
|
+
let _3 = this.#N(e, t, i2.size || 0, h, r);
|
|
367
|
+
if (this.maxEntrySize && _3 > this.maxEntrySize) return this.#E(e, "set"), r && (r.set = "miss", r.maxEntrySizeExceeded = true), this;
|
|
368
|
+
let u2 = this.#n === 0 ? void 0 : this.#s.get(e);
|
|
369
|
+
if (u2 === void 0) u2 = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(false) : this.#n, this.#i[u2] = e, this.#t[u2] = t, this.#s.set(e, u2), this.#l[this.#h] = u2, this.#u[u2] = this.#h, this.#h = u2, this.#n++, this.#j(u2, _3, r), r && (r.set = "add"), m2 = false, this.#D && !c && this.#O?.(t, e, "add");
|
|
364
370
|
else {
|
|
365
|
-
this.#L(
|
|
366
|
-
let g2 = this.#t[
|
|
371
|
+
this.#L(u2);
|
|
372
|
+
let g2 = this.#t[u2];
|
|
367
373
|
if (t !== g2) {
|
|
368
|
-
if (
|
|
369
|
-
g2.__abortController.abort(new Error("replaced"));
|
|
370
|
-
let { __staleWhileFetching:
|
|
371
|
-
|
|
372
|
-
} else
|
|
373
|
-
if (this.#
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
p !== void 0 && (h.oldValue = p);
|
|
374
|
+
if (!l) if (this.#e(g2)) {
|
|
375
|
+
g2 !== s && g2.__abortController.abort(new Error("replaced"));
|
|
376
|
+
let { __staleWhileFetching: f } = g2;
|
|
377
|
+
f !== void 0 && f !== t && (this.#T && this.#S?.(f, e, "set"), this.#f && this.#r?.push([f, e, "set"]));
|
|
378
|
+
} else this.#T && this.#S?.(g2, e, "set"), this.#f && this.#r?.push([g2, e, "set"]);
|
|
379
|
+
if (this.#x(u2), this.#j(u2, _3, r), this.#t[u2] = t, !c) {
|
|
380
|
+
let f = g2 && this.#e(g2) ? g2.__staleWhileFetching : g2, y2 = f === void 0 ? "add" : t !== f ? "replace" : "update";
|
|
381
|
+
r && (r.set = y2, f !== void 0 && (r.oldValue = f)), this.#D && this.onInsert?.(t, e, y2);
|
|
377
382
|
}
|
|
378
|
-
} else
|
|
379
|
-
this.#j && this.onInsert?.(t, e, t === g2 ? "update" : "replace");
|
|
383
|
+
} else c || (r && (r.set = "update"), this.#D && this.onInsert?.(t, e, "update"));
|
|
380
384
|
}
|
|
381
|
-
if (
|
|
382
|
-
let g2 = this.#r,
|
|
383
|
-
for (;
|
|
385
|
+
if (n7 !== 0 && !this.#d && this.#k(), this.#d && (m2 || this.#H(u2, n7, o), r && this.#v(r, u2)), !l && this.#f && this.#r) {
|
|
386
|
+
let g2 = this.#r, f;
|
|
387
|
+
for (; f = g2?.shift(); ) this.#w?.(...f);
|
|
384
388
|
}
|
|
385
389
|
return this;
|
|
386
390
|
}
|
|
387
391
|
pop() {
|
|
388
392
|
try {
|
|
389
393
|
for (; this.#n; ) {
|
|
390
|
-
let e = this.#t[this.#
|
|
394
|
+
let e = this.#t[this.#a];
|
|
391
395
|
if (this.#G(true), this.#e(e)) {
|
|
392
396
|
if (e.__staleWhileFetching) return e.__staleWhileFetching;
|
|
393
397
|
} else if (e !== void 0) return e;
|
|
@@ -395,17 +399,19 @@ var L = class u2 {
|
|
|
395
399
|
} finally {
|
|
396
400
|
if (this.#f && this.#r) {
|
|
397
401
|
let e = this.#r, t;
|
|
398
|
-
for (; t = e?.shift(); ) this.#
|
|
402
|
+
for (; t = e?.shift(); ) this.#w?.(...t);
|
|
399
403
|
}
|
|
400
404
|
}
|
|
401
405
|
}
|
|
402
406
|
#G(e) {
|
|
403
|
-
let t = this.#
|
|
404
|
-
|
|
407
|
+
let t = this.#a, i2 = this.#i[t], s = this.#t[t], n7 = this.#e(s);
|
|
408
|
+
n7 && s.__abortController.abort(new Error("evicted"));
|
|
409
|
+
let o = n7 ? s.__staleWhileFetching : s;
|
|
410
|
+
return (this.#T || this.#f) && o !== void 0 && (this.#T && this.#S?.(o, i2, "evict"), this.#f && this.#r?.push([o, i2, "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(i2), this.#n--, t;
|
|
405
411
|
}
|
|
406
412
|
has(e, t = {}) {
|
|
407
413
|
let { status: i2 = S.hasSubscribers ? {} : void 0 } = t;
|
|
408
|
-
t.status = i2, i2 && (i2.op = "has", i2.key = e);
|
|
414
|
+
t.status = i2, i2 && (i2.op = "has", i2.key = e, i2.cache = this);
|
|
409
415
|
let s = this.#Y(e, t);
|
|
410
416
|
return S.hasSubscribers && S.publish(i2), s;
|
|
411
417
|
}
|
|
@@ -414,14 +420,14 @@ var L = class u2 {
|
|
|
414
420
|
if (n7 !== void 0) {
|
|
415
421
|
let o = this.#t[n7];
|
|
416
422
|
if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
|
|
417
|
-
if (this.#p(n7)) s && (s.has = "stale", this.#
|
|
418
|
-
else return i2 && this.#
|
|
423
|
+
if (this.#p(n7)) s && (s.has = "stale", this.#v(s, n7));
|
|
424
|
+
else return i2 && this.#R(n7), s && (s.has = "hit", this.#v(s, n7)), true;
|
|
419
425
|
} else s && (s.has = "miss");
|
|
420
426
|
return false;
|
|
421
427
|
}
|
|
422
428
|
peek(e, t = {}) {
|
|
423
|
-
let { status: i2 =
|
|
424
|
-
i2 && (i2.op = "peek", i2.key = e), t.status = i2;
|
|
429
|
+
let { status: i2 = R() ? {} : void 0 } = t;
|
|
430
|
+
i2 && (i2.op = "peek", i2.key = e, i2.cache = this), t.status = i2;
|
|
425
431
|
let s = this.#J(e, t);
|
|
426
432
|
return S.hasSubscribers && S.publish(i2), s;
|
|
427
433
|
}
|
|
@@ -431,70 +437,70 @@ var L = class u2 {
|
|
|
431
437
|
i2 && (i2.peek = n7 === void 0 ? "miss" : "stale");
|
|
432
438
|
return;
|
|
433
439
|
}
|
|
434
|
-
let o = this.#t[n7],
|
|
435
|
-
return i2 && (
|
|
440
|
+
let o = this.#t[n7], l = this.#e(o) ? o.__staleWhileFetching : o;
|
|
441
|
+
return i2 && (l !== void 0 ? (i2.peek = "hit", i2.value = l) : i2.peek = "miss"), l;
|
|
436
442
|
}
|
|
437
443
|
#P(e, t, i2, s) {
|
|
438
444
|
let n7 = t === void 0 ? void 0 : this.#t[t];
|
|
439
445
|
if (this.#e(n7)) return n7;
|
|
440
|
-
let o = new AbortController(), { signal:
|
|
441
|
-
|
|
442
|
-
let h = { signal: o.signal, options: i2, context: s },
|
|
443
|
-
let { aborted: a2 } = o.signal,
|
|
444
|
-
if (i2.status && (a2 && !y2 ? (i2.status.fetchAborted = true, i2.status.fetchError = o.signal.reason,
|
|
445
|
-
let b =
|
|
446
|
-
return (
|
|
447
|
-
}, c = (
|
|
448
|
-
let { aborted: a2 } = o.signal,
|
|
449
|
-
if (this.#t[t] ===
|
|
450
|
-
if (
|
|
451
|
-
},
|
|
446
|
+
let o = new AbortController(), { signal: l } = i2;
|
|
447
|
+
l?.addEventListener("abort", () => o.abort(l.reason), { signal: o.signal });
|
|
448
|
+
let h = { signal: o.signal, options: i2, context: s }, r = (f, y2 = false) => {
|
|
449
|
+
let { aborted: a2 } = o.signal, w2 = i2.ignoreFetchAbort && f !== void 0, F3 = i2.ignoreFetchAbort || !!(i2.allowStaleOnFetchAbort && f !== void 0);
|
|
450
|
+
if (i2.status && (a2 && !y2 ? (i2.status.fetchAborted = true, i2.status.fetchError = o.signal.reason, w2 && (i2.status.fetchAbortIgnored = true)) : i2.status.fetchResolved = true), a2 && !w2 && !y2) return m2(o.signal.reason, F3);
|
|
451
|
+
let b = u2, p = this.#t[t];
|
|
452
|
+
return (p === u2 || p === void 0 && w2 && y2) && (f === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[t] = b.__staleWhileFetching : this.#E(e, "fetch") : (i2.status && (i2.status.fetchUpdated = true), this.#W(e, f, h.options, b))), f;
|
|
453
|
+
}, c = (f) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = f), m2(f, false)), m2 = (f, y2) => {
|
|
454
|
+
let { aborted: a2 } = o.signal, w2 = a2 && i2.allowStaleOnFetchAbort, F3 = w2 || i2.allowStaleOnFetchRejection, b = F3 || i2.noDeleteOnFetchRejection, p = u2;
|
|
455
|
+
if (this.#t[t] === u2 && (!b || !y2 && p.__staleWhileFetching === void 0 ? this.#E(e, "fetch") : w2 || (this.#t[t] = p.__staleWhileFetching)), F3) return i2.status && p.__staleWhileFetching !== void 0 && (i2.status.returnedStale = true), p.__staleWhileFetching;
|
|
456
|
+
if (p.__returned === p) throw f;
|
|
457
|
+
}, _3 = (f, y2) => {
|
|
452
458
|
let a2 = this.#M?.(e, n7, h);
|
|
453
|
-
|
|
454
|
-
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (
|
|
455
|
-
});
|
|
459
|
+
o.signal.addEventListener("abort", () => {
|
|
460
|
+
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (f(void 0), i2.allowStaleOnFetchAbort && (f = (w2) => r(w2, true)));
|
|
461
|
+
}), a2 && a2 instanceof Promise ? a2.then((w2) => f(w2 === void 0 ? void 0 : w2), y2) : a2 !== void 0 && f(a2);
|
|
456
462
|
};
|
|
457
463
|
i2.status && (i2.status.fetchDispatched = true);
|
|
458
|
-
let
|
|
459
|
-
return t === void 0 ? (this.#
|
|
464
|
+
let u2 = new Promise(_3).then(r, c), g2 = Object.assign(u2, { __abortController: o, __staleWhileFetching: n7, __returned: void 0 });
|
|
465
|
+
return t === void 0 ? (this.#W(e, g2, { ...h.options, status: void 0 }), t = this.#s.get(e)) : this.#t[t] = g2, g2;
|
|
460
466
|
}
|
|
461
467
|
#e(e) {
|
|
462
|
-
if (!this.#
|
|
468
|
+
if (!this.#U) return false;
|
|
463
469
|
let t = e;
|
|
464
470
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
465
471
|
}
|
|
466
472
|
fetch(e, t = {}) {
|
|
467
|
-
let i2 = W.hasSubscribers, { status: s =
|
|
473
|
+
let i2 = W.hasSubscribers, { status: s = R() ? {} : void 0 } = t;
|
|
468
474
|
t.status = s, s && t.context && (s.context = t.context);
|
|
469
475
|
let n7 = this.#B(e, t);
|
|
470
|
-
return s &&
|
|
476
|
+
return s && i2 && (s.trace = true, W.tracePromise(() => n7, s).catch(() => {
|
|
471
477
|
})), n7;
|
|
472
478
|
}
|
|
473
479
|
async #B(e, t = {}) {
|
|
474
|
-
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet:
|
|
475
|
-
if (a2 && (a2.op = "fetch", a2.key = e, y2 && (a2.forceRefresh = true)), !this.#
|
|
476
|
-
let
|
|
480
|
+
let { allowStale: i2 = 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: m2 = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: _3 = this.allowStaleOnFetchRejection, ignoreFetchAbort: u2 = this.ignoreFetchAbort, allowStaleOnFetchAbort: g2 = this.allowStaleOnFetchAbort, context: f, forceRefresh: y2 = false, status: a2, signal: w2 } = t;
|
|
481
|
+
if (a2 && (a2.op = "fetch", a2.key = e, y2 && (a2.forceRefresh = true), a2.cache = this), !this.#U) return a2 && (a2.fetch = "get"), this.#C(e, { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n7, status: a2 });
|
|
482
|
+
let F3 = { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n7, ttl: o, noDisposeOnSet: l, size: h, sizeCalculation: r, noUpdateTTL: c, noDeleteOnFetchRejection: m2, allowStaleOnFetchRejection: _3, allowStaleOnFetchAbort: g2, ignoreFetchAbort: u2, status: a2, signal: w2 }, b = this.#s.get(e);
|
|
477
483
|
if (b === void 0) {
|
|
478
484
|
a2 && (a2.fetch = "miss");
|
|
479
|
-
let
|
|
480
|
-
return
|
|
485
|
+
let p = this.#P(e, b, F3, f);
|
|
486
|
+
return p.__returned = p;
|
|
481
487
|
} else {
|
|
482
|
-
let
|
|
483
|
-
if (this.#e(
|
|
484
|
-
let
|
|
485
|
-
return a2 && (a2.fetch = "inflight",
|
|
488
|
+
let p = this.#t[b];
|
|
489
|
+
if (this.#e(p)) {
|
|
490
|
+
let v3 = i2 && p.__staleWhileFetching !== void 0;
|
|
491
|
+
return a2 && (a2.fetch = "inflight", v3 && (a2.returnedStale = true)), v3 ? p.__staleWhileFetching : p.__returned = p;
|
|
486
492
|
}
|
|
487
493
|
let A3 = this.#p(b);
|
|
488
|
-
if (!y2 && !A3) return a2 && (a2.fetch = "hit"), this.#L(b), s && this.#
|
|
489
|
-
let z = this.#P(e, b,
|
|
490
|
-
return a2 && (a2.fetch = A3 ? "stale" : "refresh",
|
|
494
|
+
if (!y2 && !A3) return a2 && (a2.fetch = "hit"), this.#L(b), s && this.#R(b), a2 && this.#v(a2, b), p;
|
|
495
|
+
let z = this.#P(e, b, F3, f), E = z.__staleWhileFetching !== void 0 && i2;
|
|
496
|
+
return a2 && (a2.fetch = A3 ? "stale" : "refresh", E && A3 && (a2.returnedStale = true)), E ? z.__staleWhileFetching : z.__returned = z;
|
|
491
497
|
}
|
|
492
498
|
}
|
|
493
499
|
forceFetch(e, t = {}) {
|
|
494
|
-
let i2 = W.hasSubscribers, { status: s =
|
|
500
|
+
let i2 = W.hasSubscribers, { status: s = R() ? {} : void 0 } = t;
|
|
495
501
|
t.status = s, s && t.context && (s.context = t.context);
|
|
496
502
|
let n7 = this.#K(e, t);
|
|
497
|
-
return s &&
|
|
503
|
+
return s && i2 && (s.trace = true, W.tracePromise(() => n7, s).catch(() => {
|
|
498
504
|
})), n7;
|
|
499
505
|
}
|
|
500
506
|
async #K(e, t = {}) {
|
|
@@ -504,67 +510,67 @@ var L = class u2 {
|
|
|
504
510
|
}
|
|
505
511
|
memo(e, t = {}) {
|
|
506
512
|
let { status: i2 = S.hasSubscribers ? {} : void 0 } = t;
|
|
507
|
-
t.status = i2, i2 && (i2.op = "memo", i2.key = e, t.context && (i2.context = t.context));
|
|
513
|
+
t.status = i2, i2 && (i2.op = "memo", i2.key = e, t.context && (i2.context = t.context), i2.cache = this);
|
|
508
514
|
let s = this.#Q(e, t);
|
|
509
515
|
return i2 && (i2.value = s), S.hasSubscribers && S.publish(i2), s;
|
|
510
516
|
}
|
|
511
517
|
#Q(e, t = {}) {
|
|
512
|
-
let i2 = this.#
|
|
518
|
+
let i2 = this.#I;
|
|
513
519
|
if (!i2) throw new Error("no memoMethod provided to constructor");
|
|
514
|
-
let { context: s, status: n7, forceRefresh: o, ...
|
|
520
|
+
let { context: s, status: n7, forceRefresh: o, ...l } = t;
|
|
515
521
|
n7 && o && (n7.forceRefresh = true);
|
|
516
|
-
let h = this.#C(e,
|
|
517
|
-
if (n7 && (n7.memo =
|
|
518
|
-
let c = i2(e, h, { options:
|
|
519
|
-
return n7 && (n7.value = c), this.#
|
|
522
|
+
let h = this.#C(e, l), r = o || h === void 0;
|
|
523
|
+
if (n7 && (n7.memo = r ? "miss" : "hit", r || (n7.value = h)), !r) return h;
|
|
524
|
+
let c = i2(e, h, { options: l, context: s });
|
|
525
|
+
return n7 && (n7.value = c), this.#W(e, c, l), c;
|
|
520
526
|
}
|
|
521
527
|
get(e, t = {}) {
|
|
522
528
|
let { status: i2 = S.hasSubscribers ? {} : void 0 } = t;
|
|
523
|
-
t.status = i2, i2 && (i2.op = "get", i2.key = e);
|
|
529
|
+
t.status = i2, i2 && (i2.op = "get", i2.key = e, i2.cache = this);
|
|
524
530
|
let s = this.#C(e, t);
|
|
525
531
|
return i2 && (s !== void 0 && (i2.value = s), S.hasSubscribers && S.publish(i2)), s;
|
|
526
532
|
}
|
|
527
533
|
#C(e, t = {}) {
|
|
528
|
-
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, status: o } = t,
|
|
529
|
-
if (
|
|
534
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, status: o } = t, l = this.#s.get(e);
|
|
535
|
+
if (l === void 0) {
|
|
530
536
|
o && (o.get = "miss");
|
|
531
537
|
return;
|
|
532
538
|
}
|
|
533
|
-
let h = this.#t[
|
|
534
|
-
return o && this.#
|
|
539
|
+
let h = this.#t[l], r = this.#e(h);
|
|
540
|
+
return o && this.#v(o, l), this.#p(l) ? r ? (o && (o.get = "stale-fetching"), i2 && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = true), h.__staleWhileFetching) : void 0) : (n7 || this.#E(e, "expire"), o && (o.get = "stale"), i2 ? (o && (o.returnedStale = true), h) : void 0) : (o && (o.get = r ? "fetching" : "hit"), this.#L(l), s && this.#R(l), r ? h.__staleWhileFetching : h);
|
|
535
541
|
}
|
|
536
542
|
#$(e, t) {
|
|
537
|
-
this.#
|
|
543
|
+
this.#u[t] = e, this.#l[e] = t;
|
|
538
544
|
}
|
|
539
545
|
#L(e) {
|
|
540
|
-
e !== this.#h && (e === this.#
|
|
546
|
+
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);
|
|
541
547
|
}
|
|
542
548
|
delete(e) {
|
|
543
|
-
return this.#
|
|
549
|
+
return this.#E(e, "delete");
|
|
544
550
|
}
|
|
545
|
-
#
|
|
546
|
-
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e });
|
|
551
|
+
#E(e, t) {
|
|
552
|
+
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e, cache: this });
|
|
547
553
|
let i2 = false;
|
|
548
554
|
if (this.#n !== 0) {
|
|
549
555
|
let s = this.#s.get(e);
|
|
550
|
-
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g
|
|
556
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g[s]), this.#g[s] = void 0), i2 = true, this.#n === 1) this.#q(t);
|
|
551
557
|
else {
|
|
552
|
-
this.#
|
|
558
|
+
this.#x(s);
|
|
553
559
|
let n7 = this.#t[s];
|
|
554
|
-
if (this.#e(n7) ? n7.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#
|
|
555
|
-
else if (s === this.#
|
|
560
|
+
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];
|
|
561
|
+
else if (s === this.#a) this.#a = this.#l[s];
|
|
556
562
|
else {
|
|
557
|
-
let o = this.#
|
|
558
|
-
this.#
|
|
559
|
-
let
|
|
560
|
-
this.#
|
|
563
|
+
let o = this.#u[s];
|
|
564
|
+
this.#l[o] = this.#l[s];
|
|
565
|
+
let l = this.#l[s];
|
|
566
|
+
this.#u[l] = this.#u[s];
|
|
561
567
|
}
|
|
562
568
|
this.#n--, this.#y.push(s);
|
|
563
569
|
}
|
|
564
570
|
}
|
|
565
571
|
if (this.#f && this.#r?.length) {
|
|
566
572
|
let s = this.#r, n7;
|
|
567
|
-
for (; n7 = s?.shift(); ) this.#
|
|
573
|
+
for (; n7 = s?.shift(); ) this.#w?.(...n7);
|
|
568
574
|
}
|
|
569
575
|
return i2;
|
|
570
576
|
}
|
|
@@ -577,7 +583,7 @@ var L = class u2 {
|
|
|
577
583
|
if (this.#e(i2)) i2.__abortController.abort(new Error("deleted"));
|
|
578
584
|
else {
|
|
579
585
|
let s = this.#i[t];
|
|
580
|
-
this.#T && this.#
|
|
586
|
+
this.#T && this.#S?.(i2, s, e), this.#f && this.#r?.push([i2, s, e]);
|
|
581
587
|
}
|
|
582
588
|
}
|
|
583
589
|
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
@@ -585,9 +591,9 @@ var L = class u2 {
|
|
|
585
591
|
for (let t of this.#g ?? []) t !== void 0 && clearTimeout(t);
|
|
586
592
|
this.#g?.fill(void 0);
|
|
587
593
|
}
|
|
588
|
-
if (this.#_ && this.#_.fill(0), this.#
|
|
594
|
+
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) {
|
|
589
595
|
let t = this.#r, i2;
|
|
590
|
-
for (; i2 = t?.shift(); ) this.#
|
|
596
|
+
for (; i2 = t?.shift(); ) this.#w?.(...i2);
|
|
591
597
|
}
|
|
592
598
|
}
|
|
593
599
|
};
|
|
@@ -677,19 +683,19 @@ function promiseSpawn(command, args, opts = {}, extra = {}) {
|
|
|
677
683
|
// ../../node_modules/.vlt/~npm~isexe@3.1.5/node_modules/isexe/dist/esm/index.min.js
|
|
678
684
|
import { statSync as w } from "node:fs";
|
|
679
685
|
import { stat as S2 } from "node:fs/promises";
|
|
680
|
-
import { statSync as
|
|
686
|
+
import { statSync as k2 } from "node:fs";
|
|
681
687
|
import { stat as I2 } from "node:fs/promises";
|
|
682
688
|
import { delimiter as _ } from "node:path";
|
|
683
689
|
var y = Object.defineProperty;
|
|
684
|
-
var
|
|
690
|
+
var u = (t, r) => {
|
|
685
691
|
for (var e in r) y(t, e, { get: r[e], enumerable: true });
|
|
686
692
|
};
|
|
687
693
|
var i = {};
|
|
688
|
-
|
|
689
|
-
var
|
|
694
|
+
u(i, { isexe: () => C, sync: () => A });
|
|
695
|
+
var C = async (t, r = {}) => {
|
|
690
696
|
let { ignoreErrors: e = false } = r;
|
|
691
697
|
try {
|
|
692
|
-
return
|
|
698
|
+
return d3(await S2(t), r);
|
|
693
699
|
} catch (s) {
|
|
694
700
|
let o = s;
|
|
695
701
|
if (e || o.code === "EACCES") return false;
|
|
@@ -699,23 +705,23 @@ var C2 = async (t, r = {}) => {
|
|
|
699
705
|
var A = (t, r = {}) => {
|
|
700
706
|
let { ignoreErrors: e = false } = r;
|
|
701
707
|
try {
|
|
702
|
-
return
|
|
708
|
+
return d3(w(t), r);
|
|
703
709
|
} catch (s) {
|
|
704
710
|
let o = s;
|
|
705
711
|
if (e || o.code === "EACCES") return false;
|
|
706
712
|
throw o;
|
|
707
713
|
}
|
|
708
714
|
};
|
|
709
|
-
var
|
|
710
|
-
var
|
|
715
|
+
var d3 = (t, r) => t.isFile() && T2(t, r);
|
|
716
|
+
var T2 = (t, r) => {
|
|
711
717
|
let e = r.uid ?? process.getuid?.(), s = r.groups ?? process.getgroups?.() ?? [], o = r.gid ?? process.getgid?.() ?? s[0];
|
|
712
718
|
if (e === void 0 || o === void 0) throw new Error("cannot get uid or gid");
|
|
713
|
-
let c = /* @__PURE__ */ new Set([o, ...s]), n7 = t.mode, l = t.uid, E = t.gid, f = parseInt("100", 8), p = parseInt("010", 8),
|
|
714
|
-
return !!(n7 &
|
|
719
|
+
let c = /* @__PURE__ */ new Set([o, ...s]), n7 = t.mode, l = t.uid, E = t.gid, f = parseInt("100", 8), p = parseInt("010", 8), x3 = parseInt("001", 8), h = f | p;
|
|
720
|
+
return !!(n7 & x3 || n7 & p && c.has(E) || n7 & f && l === e || n7 & h && e === 0);
|
|
715
721
|
};
|
|
716
722
|
var a = {};
|
|
717
|
-
|
|
718
|
-
var
|
|
723
|
+
u(a, { isexe: () => F, sync: () => L2 });
|
|
724
|
+
var F = async (t, r = {}) => {
|
|
719
725
|
let { ignoreErrors: e = false } = r;
|
|
720
726
|
try {
|
|
721
727
|
return m(await I2(t), t, r);
|
|
@@ -728,7 +734,7 @@ var F2 = async (t, r = {}) => {
|
|
|
728
734
|
var L2 = (t, r = {}) => {
|
|
729
735
|
let { ignoreErrors: e = false } = r;
|
|
730
736
|
try {
|
|
731
|
-
return m(
|
|
737
|
+
return m(k2(t), t, r);
|
|
732
738
|
} catch (s) {
|
|
733
739
|
let o = s;
|
|
734
740
|
if (e || o.code === "EACCES") return false;
|
|
@@ -859,16 +865,16 @@ var ce = (n7, t) => {
|
|
|
859
865
|
return e ? e[0] : null;
|
|
860
866
|
};
|
|
861
867
|
var ss = (n7, t, e) => {
|
|
862
|
-
let s, i2, r, o, h, a2 = e.indexOf(n7), l = e.indexOf(t, a2 + 1),
|
|
868
|
+
let s, i2, r, o, h, a2 = e.indexOf(n7), l = e.indexOf(t, a2 + 1), u2 = a2;
|
|
863
869
|
if (a2 >= 0 && l > 0) {
|
|
864
870
|
if (n7 === t) return [a2, l];
|
|
865
|
-
for (s = [], r = e.length;
|
|
866
|
-
if (
|
|
871
|
+
for (s = [], r = e.length; u2 >= 0 && !h; ) {
|
|
872
|
+
if (u2 === a2) s.push(u2), a2 = e.indexOf(n7, u2 + 1);
|
|
867
873
|
else if (s.length === 1) {
|
|
868
874
|
let c = s.pop();
|
|
869
875
|
c !== void 0 && (h = [c, l]);
|
|
870
|
-
} else i2 = s.pop(), i2 !== void 0 && i2 < r && (r = i2, o = l), l = e.indexOf(t,
|
|
871
|
-
|
|
876
|
+
} else i2 = s.pop(), i2 !== void 0 && i2 < r && (r = i2, o = l), l = e.indexOf(t, u2 + 1);
|
|
877
|
+
u2 = a2 < l && a2 >= 0 ? a2 : l;
|
|
872
878
|
}
|
|
873
879
|
s.length && o !== void 0 && (h = [r, o]);
|
|
874
880
|
}
|
|
@@ -934,17 +940,17 @@ function ht(n7, t, e) {
|
|
|
934
940
|
s.push(a2);
|
|
935
941
|
}
|
|
936
942
|
else {
|
|
937
|
-
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i2.body), a2 = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i2.body), l = h || a2,
|
|
938
|
-
if (!l && !
|
|
943
|
+
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i2.body), a2 = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i2.body), l = h || a2, u2 = i2.body.indexOf(",") >= 0;
|
|
944
|
+
if (!l && !u2) return i2.post.match(/,(?!,).*\}/) ? (n7 = i2.pre + "{" + i2.body + qt + i2.post, ht(n7, t, true)) : [n7];
|
|
939
945
|
let c;
|
|
940
946
|
if (l) c = i2.body.split(/\.\./);
|
|
941
947
|
else if (c = me(i2.body), c.length === 1 && c[0] !== void 0 && (c = ht(c[0], t, false).map(gs), c.length === 1)) return o.map((f) => i2.pre + c[0] + f);
|
|
942
|
-
let
|
|
948
|
+
let d4;
|
|
943
949
|
if (l && c[0] !== void 0 && c[1] !== void 0) {
|
|
944
950
|
let f = Ht(c[0]), m2 = Ht(c[1]), p = Math.max(c[0].length, c[1].length), w2 = c.length === 3 && c[2] !== void 0 ? Math.abs(Ht(c[2])) : 1, g2 = ys;
|
|
945
951
|
m2 < f && (w2 *= -1, g2 = bs);
|
|
946
952
|
let E = c.some(ws);
|
|
947
|
-
|
|
953
|
+
d4 = [];
|
|
948
954
|
for (let y2 = f; g2(y2, m2); y2 += w2) {
|
|
949
955
|
let b;
|
|
950
956
|
if (a2) b = String.fromCharCode(y2), b === "\\" && (b = "");
|
|
@@ -955,14 +961,14 @@ function ht(n7, t, e) {
|
|
|
955
961
|
y2 < 0 ? b = "-" + $ + b.slice(1) : b = $ + b;
|
|
956
962
|
}
|
|
957
963
|
}
|
|
958
|
-
|
|
964
|
+
d4.push(b);
|
|
959
965
|
}
|
|
960
966
|
} else {
|
|
961
|
-
|
|
962
|
-
for (let f = 0; f < c.length; f++)
|
|
967
|
+
d4 = [];
|
|
968
|
+
for (let f = 0; f < c.length; f++) d4.push.apply(d4, ht(c[f], t, false));
|
|
963
969
|
}
|
|
964
|
-
for (let f = 0; f <
|
|
965
|
-
let p = r +
|
|
970
|
+
for (let f = 0; f < d4.length; f++) for (let m2 = 0; m2 < o.length && s.length < t; m2++) {
|
|
971
|
+
let p = r + d4[f] + o[m2];
|
|
966
972
|
(!e || l || p) && s.push(p);
|
|
967
973
|
}
|
|
968
974
|
}
|
|
@@ -979,7 +985,7 @@ var we = (n7) => n7.join("");
|
|
|
979
985
|
var ye = (n7, t) => {
|
|
980
986
|
let e = t;
|
|
981
987
|
if (n7.charAt(e) !== "[") throw new Error("not in a brace expression");
|
|
982
|
-
let s = [], i2 = [], r = e + 1, o = false, h = false, a2 = false, l = false,
|
|
988
|
+
let s = [], i2 = [], r = e + 1, o = false, h = false, a2 = false, l = false, u2 = e, c = "";
|
|
983
989
|
t: for (; r < n7.length; ) {
|
|
984
990
|
let p = n7.charAt(r);
|
|
985
991
|
if ((p === "!" || p === "^") && r === e + 1) {
|
|
@@ -987,7 +993,7 @@ var ye = (n7, t) => {
|
|
|
987
993
|
continue;
|
|
988
994
|
}
|
|
989
995
|
if (p === "]" && o && !a2) {
|
|
990
|
-
|
|
996
|
+
u2 = r + 1;
|
|
991
997
|
break;
|
|
992
998
|
}
|
|
993
999
|
if (o = true, p === "\\" && !a2) {
|
|
@@ -1015,14 +1021,14 @@ var ye = (n7, t) => {
|
|
|
1015
1021
|
}
|
|
1016
1022
|
s.push(lt(p)), r++;
|
|
1017
1023
|
}
|
|
1018
|
-
if (
|
|
1024
|
+
if (u2 < r) return ["", false, 0, false];
|
|
1019
1025
|
if (!s.length && !i2.length) return ["$.", false, n7.length - e, true];
|
|
1020
1026
|
if (i2.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l) {
|
|
1021
1027
|
let p = s[0].length === 2 ? s[0].slice(-1) : s[0];
|
|
1022
|
-
return [Es(p), false,
|
|
1028
|
+
return [Es(p), false, u2 - e, false];
|
|
1023
1029
|
}
|
|
1024
|
-
let
|
|
1025
|
-
return [s.length && i2.length ? "(" +
|
|
1030
|
+
let d4 = "[" + (l ? "^" : "") + we(s) + "]", f = "[" + (l ? "" : "^") + we(i2) + "]";
|
|
1031
|
+
return [s.length && i2.length ? "(" + d4 + "|" + f + ")" : s.length ? d4 : f, h, u2 - e, true];
|
|
1026
1032
|
};
|
|
1027
1033
|
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");
|
|
1028
1034
|
var xs = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
@@ -1141,32 +1147,32 @@ var Q = class n {
|
|
|
1141
1147
|
}
|
|
1142
1148
|
return e.push(m2), f;
|
|
1143
1149
|
}
|
|
1144
|
-
let l = s + 1,
|
|
1150
|
+
let l = s + 1, u2 = new n(null, e), c = [], d4 = "";
|
|
1145
1151
|
for (; l < t.length; ) {
|
|
1146
1152
|
let f = t.charAt(l++);
|
|
1147
1153
|
if (r || f === "\\") {
|
|
1148
|
-
r = !r,
|
|
1154
|
+
r = !r, d4 += f;
|
|
1149
1155
|
continue;
|
|
1150
1156
|
}
|
|
1151
1157
|
if (o) {
|
|
1152
|
-
l === h + 1 ? (f === "^" || f === "!") && (a2 = true) : f === "]" && !(l === h + 2 && a2) && (o = false),
|
|
1158
|
+
l === h + 1 ? (f === "^" || f === "!") && (a2 = true) : f === "]" && !(l === h + 2 && a2) && (o = false), d4 += f;
|
|
1153
1159
|
continue;
|
|
1154
1160
|
} else if (f === "[") {
|
|
1155
|
-
o = true, h = l, a2 = false,
|
|
1161
|
+
o = true, h = l, a2 = false, d4 += f;
|
|
1156
1162
|
continue;
|
|
1157
1163
|
}
|
|
1158
1164
|
if (be(f) && t.charAt(l) === "(") {
|
|
1159
|
-
|
|
1160
|
-
let m2 = new n(f,
|
|
1161
|
-
|
|
1165
|
+
u2.push(d4), d4 = "";
|
|
1166
|
+
let m2 = new n(f, u2);
|
|
1167
|
+
u2.push(m2), l = n.#i(t, m2, l, i2);
|
|
1162
1168
|
continue;
|
|
1163
1169
|
}
|
|
1164
1170
|
if (f === "|") {
|
|
1165
|
-
|
|
1171
|
+
u2.push(d4), d4 = "", c.push(u2), u2 = new n(null, e);
|
|
1166
1172
|
continue;
|
|
1167
1173
|
}
|
|
1168
|
-
if (f === ")") return
|
|
1169
|
-
|
|
1174
|
+
if (f === ")") return d4 === "" && e.#r.length === 0 && (e.#f = true), u2.push(d4), d4 = "", e.push(...c, u2), l;
|
|
1175
|
+
d4 += f;
|
|
1170
1176
|
}
|
|
1171
1177
|
return e.type = null, e.#s = void 0, e.#r = [t.substring(s - 1)], l;
|
|
1172
1178
|
}
|
|
@@ -1190,13 +1196,13 @@ var Q = class n {
|
|
|
1190
1196
|
let a2 = this.isStart() && this.isEnd() && !this.#r.some((f) => typeof f != "string"), l = this.#r.map((f) => {
|
|
1191
1197
|
let [m2, p, w2, g2] = typeof f == "string" ? n.#E(f, this.#s, a2) : f.toRegExpSource(t);
|
|
1192
1198
|
return this.#s = this.#s || w2, this.#n = this.#n || g2, m2;
|
|
1193
|
-
}).join(""),
|
|
1199
|
+
}).join(""), u2 = "";
|
|
1194
1200
|
if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && Ts.has(this.#r[0]))) {
|
|
1195
1201
|
let m2 = Cs, p = e && m2.has(l.charAt(0)) || l.startsWith("\\.") && m2.has(l.charAt(2)) || l.startsWith("\\.\\.") && m2.has(l.charAt(4)), w2 = !e && !t && m2.has(l.charAt(0));
|
|
1196
|
-
|
|
1202
|
+
u2 = p ? vs : w2 ? Ct : "";
|
|
1197
1203
|
}
|
|
1198
1204
|
let c = "";
|
|
1199
|
-
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c = "(?:$|\\/)"), [
|
|
1205
|
+
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c = "(?:$|\\/)"), [u2 + l + c, W2(l), this.#s = !!this.#s, this.#n];
|
|
1200
1206
|
}
|
|
1201
1207
|
let s = this.type === "*" || this.type === "+", i2 = this.type === "!" ? "(?:(?!(?:" : "(?:", r = this.#d(e);
|
|
1202
1208
|
if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
|
|
@@ -1238,9 +1244,9 @@ var Q = class n {
|
|
|
1238
1244
|
continue;
|
|
1239
1245
|
}
|
|
1240
1246
|
if (l === "[") {
|
|
1241
|
-
let [
|
|
1242
|
-
if (
|
|
1243
|
-
r +=
|
|
1247
|
+
let [u2, c, d4, f] = ye(t, a2);
|
|
1248
|
+
if (d4) {
|
|
1249
|
+
r += u2, o = o || c, a2 += d4 - 1, e = e || f;
|
|
1244
1250
|
continue;
|
|
1245
1251
|
}
|
|
1246
1252
|
}
|
|
@@ -1254,7 +1260,7 @@ var Q = class n {
|
|
|
1254
1260
|
}
|
|
1255
1261
|
};
|
|
1256
1262
|
var tt = (n7, { windowsPathsNoEscape: t = false, magicalBraces: e = false } = {}) => e ? t ? n7.replace(/[?*()[\]{}]/g, "[$&]") : n7.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n7.replace(/[?*()[\]]/g, "[$&]") : n7.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1257
|
-
var O2 = (n7, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? false : new
|
|
1263
|
+
var O2 = (n7, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? false : new D(t, e).match(n7));
|
|
1258
1264
|
var Rs = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1259
1265
|
var Os = (n7) => (t) => !t.startsWith(".") && t.endsWith(n7);
|
|
1260
1266
|
var Fs = (n7) => (t) => t.endsWith(n7);
|
|
@@ -1328,16 +1334,16 @@ var Zs = (n7) => {
|
|
|
1328
1334
|
O2.defaults = Zs;
|
|
1329
1335
|
var ke = (n7, t = {}) => (at(n7), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n7) ? [n7] : ge(n7, { max: t.braceExpandMax }));
|
|
1330
1336
|
O2.braceExpand = ke;
|
|
1331
|
-
var Qs = (n7, t = {}) => new
|
|
1337
|
+
var Qs = (n7, t = {}) => new D(n7, t).makeRe();
|
|
1332
1338
|
O2.makeRe = Qs;
|
|
1333
1339
|
var ti = (n7, t, e = {}) => {
|
|
1334
|
-
let s = new
|
|
1340
|
+
let s = new D(t, e);
|
|
1335
1341
|
return n7 = n7.filter((i2) => s.match(i2)), s.options.nonull && !n7.length && n7.push(t), n7;
|
|
1336
1342
|
};
|
|
1337
1343
|
O2.match = ti;
|
|
1338
1344
|
var ve = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1339
1345
|
var ei = (n7) => n7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1340
|
-
var
|
|
1346
|
+
var D = class {
|
|
1341
1347
|
options;
|
|
1342
1348
|
set;
|
|
1343
1349
|
pattern;
|
|
@@ -1383,8 +1389,8 @@ var D2 = class {
|
|
|
1383
1389
|
let i2 = this.globParts.map((r, o, h) => {
|
|
1384
1390
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1385
1391
|
let a2 = r[0] === "" && r[1] === "" && (r[2] === "?" || !ve.test(r[2])) && !ve.test(r[3]), l = /^[a-z]:/i.test(r[0]);
|
|
1386
|
-
if (a2) return [...r.slice(0, 4), ...r.slice(4).map((
|
|
1387
|
-
if (l) return [r[0], ...r.slice(1).map((
|
|
1392
|
+
if (a2) return [...r.slice(0, 4), ...r.slice(4).map((u2) => this.parse(u2))];
|
|
1393
|
+
if (l) return [r[0], ...r.slice(1).map((u2) => this.parse(u2))];
|
|
1388
1394
|
}
|
|
1389
1395
|
return r.map((a2) => this.parse(a2));
|
|
1390
1396
|
});
|
|
@@ -1448,8 +1454,8 @@ var D2 = class {
|
|
|
1448
1454
|
let h = s[i2 + 1], a2 = s[i2 + 2], l = s[i2 + 3];
|
|
1449
1455
|
if (h !== ".." || !a2 || a2 === "." || a2 === ".." || !l || l === "." || l === "..") continue;
|
|
1450
1456
|
e = true, s.splice(i2, 1);
|
|
1451
|
-
let
|
|
1452
|
-
|
|
1457
|
+
let u2 = s.slice(0);
|
|
1458
|
+
u2[i2] = "**", t.push(u2), i2--;
|
|
1453
1459
|
}
|
|
1454
1460
|
if (!this.preserveMultipleSlashes) {
|
|
1455
1461
|
for (let o = 1; o < s.length - 1; o++) {
|
|
@@ -1514,30 +1520,30 @@ var D2 = class {
|
|
|
1514
1520
|
r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
|
|
1515
1521
|
for (var o = 0, h = 0, a2 = t.length, l = e.length; o < a2 && h < l; o++, h++) {
|
|
1516
1522
|
this.debug("matchOne loop");
|
|
1517
|
-
var
|
|
1518
|
-
if (this.debug(e,
|
|
1519
|
-
if (
|
|
1520
|
-
this.debug("GLOBSTAR", [e,
|
|
1521
|
-
var
|
|
1523
|
+
var u2 = e[h], c = t[o];
|
|
1524
|
+
if (this.debug(e, u2, c), u2 === false) return false;
|
|
1525
|
+
if (u2 === A2) {
|
|
1526
|
+
this.debug("GLOBSTAR", [e, u2, c]);
|
|
1527
|
+
var d4 = o, f = h + 1;
|
|
1522
1528
|
if (f === l) {
|
|
1523
1529
|
for (this.debug("** at the end"); o < a2; o++) if (t[o] === "." || t[o] === ".." || !i2.dot && t[o].charAt(0) === ".") return false;
|
|
1524
1530
|
return true;
|
|
1525
1531
|
}
|
|
1526
|
-
for (;
|
|
1527
|
-
var m2 = t[
|
|
1532
|
+
for (; d4 < a2; ) {
|
|
1533
|
+
var m2 = t[d4];
|
|
1528
1534
|
if (this.debug(`
|
|
1529
|
-
globstar while`, t,
|
|
1535
|
+
globstar while`, t, d4, e, f, m2), this.matchOne(t.slice(d4), e.slice(f), s)) return this.debug("globstar found match!", d4, a2, m2), true;
|
|
1530
1536
|
if (m2 === "." || m2 === ".." || !i2.dot && m2.charAt(0) === ".") {
|
|
1531
|
-
this.debug("dot detected!", t,
|
|
1537
|
+
this.debug("dot detected!", t, d4, e, f);
|
|
1532
1538
|
break;
|
|
1533
1539
|
}
|
|
1534
|
-
this.debug("globstar swallow a segment, and continue"),
|
|
1540
|
+
this.debug("globstar swallow a segment, and continue"), d4++;
|
|
1535
1541
|
}
|
|
1536
1542
|
return !!(s && (this.debug(`
|
|
1537
|
-
>>> no match, partial?`, t,
|
|
1543
|
+
>>> no match, partial?`, t, d4, e, f), d4 === a2));
|
|
1538
1544
|
}
|
|
1539
1545
|
let p;
|
|
1540
|
-
if (typeof
|
|
1546
|
+
if (typeof u2 == "string" ? (p = c === u2, this.debug("string match", u2, c, p)) : (p = u2.test(c), this.debug("pattern match", u2, c, p)), !p) return false;
|
|
1541
1547
|
}
|
|
1542
1548
|
if (o === a2 && h === l) return true;
|
|
1543
1549
|
if (o === a2) return s;
|
|
@@ -1563,20 +1569,20 @@ globstar while`, t, d2, e, f, m2), this.matchOne(t.slice(d2), e.slice(f), s)) re
|
|
|
1563
1569
|
if (!t.length) return this.regexp = false, this.regexp;
|
|
1564
1570
|
let e = this.options, s = e.noglobstar ? Vs : e.dot ? Ys : Xs, i2 = new Set(e.nocase ? ["i"] : []), r = t.map((a2) => {
|
|
1565
1571
|
let l = a2.map((c) => {
|
|
1566
|
-
if (c instanceof RegExp) for (let
|
|
1572
|
+
if (c instanceof RegExp) for (let d4 of c.flags.split("")) i2.add(d4);
|
|
1567
1573
|
return typeof c == "string" ? ei(c) : c === A2 ? A2 : c._src;
|
|
1568
1574
|
});
|
|
1569
|
-
l.forEach((c,
|
|
1570
|
-
let f = l[
|
|
1571
|
-
c !== A2 || m2 === A2 || (m2 === void 0 ? f !== void 0 && f !== A2 ? l[
|
|
1575
|
+
l.forEach((c, d4) => {
|
|
1576
|
+
let f = l[d4 + 1], m2 = l[d4 - 1];
|
|
1577
|
+
c !== A2 || m2 === A2 || (m2 === void 0 ? f !== void 0 && f !== A2 ? l[d4 + 1] = "(?:\\/|" + s + "\\/)?" + f : l[d4] = s : f === void 0 ? l[d4 - 1] = m2 + "(?:\\/|\\/" + s + ")?" : f !== A2 && (l[d4 - 1] = m2 + "(?:\\/|\\/" + s + "\\/)" + f, l[d4 + 1] = A2));
|
|
1572
1578
|
});
|
|
1573
|
-
let
|
|
1574
|
-
if (this.partial &&
|
|
1579
|
+
let u2 = l.filter((c) => c !== A2);
|
|
1580
|
+
if (this.partial && u2.length >= 1) {
|
|
1575
1581
|
let c = [];
|
|
1576
|
-
for (let
|
|
1582
|
+
for (let d4 = 1; d4 <= u2.length; d4++) c.push(u2.slice(0, d4).join("/"));
|
|
1577
1583
|
return "(?:" + c.join("|") + ")";
|
|
1578
1584
|
}
|
|
1579
|
-
return
|
|
1585
|
+
return u2.join("/");
|
|
1580
1586
|
}).join("|"), [o, h] = t.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1581
1587
|
r = "^" + o + r + h + "$", this.partial && (r = "^(?:\\/|" + o + r.slice(1, -1) + h + ")$"), this.negate && (r = "^(?!" + r + ").+$");
|
|
1582
1588
|
try {
|
|
@@ -1612,7 +1618,7 @@ globstar while`, t, d2, e, f, m2), this.matchOne(t.slice(d2), e.slice(f), s)) re
|
|
|
1612
1618
|
}
|
|
1613
1619
|
};
|
|
1614
1620
|
O2.AST = Q;
|
|
1615
|
-
O2.Minimatch =
|
|
1621
|
+
O2.Minimatch = D;
|
|
1616
1622
|
O2.escape = tt;
|
|
1617
1623
|
O2.unescape = W2;
|
|
1618
1624
|
var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
@@ -1760,7 +1766,7 @@ var ft = class Me {
|
|
|
1760
1766
|
return this.#o;
|
|
1761
1767
|
}
|
|
1762
1768
|
constructor(t) {
|
|
1763
|
-
let { max: e = 0, ttl: s, ttlResolution: i2 = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a2, dispose: l, onInsert:
|
|
1769
|
+
let { max: e = 0, ttl: s, ttlResolution: i2 = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a2, dispose: l, onInsert: u2, disposeAfter: c, noDisposeOnSet: d4, noUpdateTTL: f, maxSize: m2 = 0, maxEntrySize: p = 0, sizeCalculation: w2, fetchMethod: g2, memoMethod: S3, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y2, allowStaleOnFetchRejection: b, allowStaleOnFetchAbort: z, ignoreFetchAbort: $, perf: J } = t;
|
|
1764
1770
|
if (J !== void 0 && typeof J?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
1765
1771
|
if (this.#c = J ?? si, e !== 0 && !q(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
1766
1772
|
let Z = e ? De(e) : Array;
|
|
@@ -1771,7 +1777,7 @@ var ft = class Me {
|
|
|
1771
1777
|
}
|
|
1772
1778
|
if (S3 !== void 0 && typeof S3 != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
1773
1779
|
if (this.#w = S3, g2 !== void 0 && typeof g2 != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
1774
|
-
if (this.#S = g2, this.#A = !!g2, 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
|
|
1780
|
+
if (this.#S = g2, this.#A = !!g2, 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 u2 == "function" && (this.#r = u2), 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 = !!d4, this.noUpdateTTL = !!f, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!b, this.allowStaleOnFetchAbort = !!z, this.ignoreFetchAbort = !!$, this.maxEntrySize !== 0) {
|
|
1775
1781
|
if (this.#s !== 0 && !q(this.#s)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
1776
1782
|
if (!q(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1777
1783
|
this.#G();
|
|
@@ -1807,8 +1813,8 @@ var ft = class Me {
|
|
|
1807
1813
|
let a2 = t[h], l = e[h];
|
|
1808
1814
|
if (!a2 || !l) return;
|
|
1809
1815
|
o.ttl = a2, o.start = l, o.now = i2 || r();
|
|
1810
|
-
let
|
|
1811
|
-
o.remainingTTL = a2 -
|
|
1816
|
+
let u2 = o.now - l;
|
|
1817
|
+
o.remainingTTL = a2 - u2;
|
|
1812
1818
|
}
|
|
1813
1819
|
};
|
|
1814
1820
|
let i2 = 0, r = () => {
|
|
@@ -1825,8 +1831,8 @@ var ft = class Me {
|
|
|
1825
1831
|
if (h === void 0) return 0;
|
|
1826
1832
|
let a2 = t[h], l = e[h];
|
|
1827
1833
|
if (!a2 || !l) return 1 / 0;
|
|
1828
|
-
let
|
|
1829
|
-
return a2 -
|
|
1834
|
+
let u2 = (i2 || r()) - l;
|
|
1835
|
+
return a2 - u2;
|
|
1830
1836
|
}, this.#v = (o) => {
|
|
1831
1837
|
let h = e[o], a2 = t[o];
|
|
1832
1838
|
return !!a2 && !!h && (i2 || r()) - h > a2;
|
|
@@ -1968,30 +1974,30 @@ var ft = class Me {
|
|
|
1968
1974
|
}
|
|
1969
1975
|
set(t, e, s = {}) {
|
|
1970
1976
|
if (e === void 0) return this.delete(t), this;
|
|
1971
|
-
let { ttl: i2 = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a2 } = s, { noUpdateTTL: l = this.noUpdateTTL } = s,
|
|
1972
|
-
if (this.maxEntrySize &&
|
|
1977
|
+
let { ttl: i2 = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a2 } = s, { noUpdateTTL: l = this.noUpdateTTL } = s, u2 = this.#I(t, e, s.size || 0, h);
|
|
1978
|
+
if (this.maxEntrySize && u2 > this.maxEntrySize) return a2 && (a2.set = "miss", a2.maxEntrySizeExceeded = true), this.#O(t, "set"), this;
|
|
1973
1979
|
let c = this.#h === 0 ? void 0 : this.#f.get(t);
|
|
1974
|
-
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,
|
|
1980
|
+
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, u2, a2), a2 && (a2.set = "add"), l = false, this.#_ && this.#r?.(e, t, "add");
|
|
1975
1981
|
else {
|
|
1976
1982
|
this.#W(c);
|
|
1977
|
-
let
|
|
1978
|
-
if (e !==
|
|
1979
|
-
if (this.#A && this.#l(
|
|
1980
|
-
|
|
1981
|
-
let { __staleWhileFetching: f } =
|
|
1983
|
+
let d4 = this.#i[c];
|
|
1984
|
+
if (e !== d4) {
|
|
1985
|
+
if (this.#A && this.#l(d4)) {
|
|
1986
|
+
d4.__abortController.abort(new Error("replaced"));
|
|
1987
|
+
let { __staleWhileFetching: f } = d4;
|
|
1982
1988
|
f !== void 0 && !o && (this.#x && this.#n?.(f, t, "set"), this.#e && this.#m?.push([f, t, "set"]));
|
|
1983
|
-
} else o || (this.#x && this.#n?.(
|
|
1984
|
-
if (this.#P(c), this.#L(c,
|
|
1989
|
+
} else o || (this.#x && this.#n?.(d4, t, "set"), this.#e && this.#m?.push([d4, t, "set"]));
|
|
1990
|
+
if (this.#P(c), this.#L(c, u2, a2), this.#i[c] = e, a2) {
|
|
1985
1991
|
a2.set = "replace";
|
|
1986
|
-
let f =
|
|
1992
|
+
let f = d4 && this.#l(d4) ? d4.__staleWhileFetching : d4;
|
|
1987
1993
|
f !== void 0 && (a2.oldValue = f);
|
|
1988
1994
|
}
|
|
1989
1995
|
} else a2 && (a2.set = "update");
|
|
1990
|
-
this.#_ && this.onInsert?.(e, t, e ===
|
|
1996
|
+
this.#_ && this.onInsert?.(e, t, e === d4 ? "update" : "replace");
|
|
1991
1997
|
}
|
|
1992
1998
|
if (i2 !== 0 && !this.#g && this.#M(), this.#g && (l || this.#j(c, i2, r), a2 && this.#N(a2, c)), !o && this.#e && this.#m) {
|
|
1993
|
-
let
|
|
1994
|
-
for (; f =
|
|
1999
|
+
let d4 = this.#m, f;
|
|
2000
|
+
for (; f = d4?.shift(); ) this.#o?.(...f);
|
|
1995
2001
|
}
|
|
1996
2002
|
return this;
|
|
1997
2003
|
}
|
|
@@ -2040,18 +2046,18 @@ var ft = class Me {
|
|
|
2040
2046
|
if (s.status && (g2 && !w2 ? (s.status.fetchAborted = true, s.status.fetchError = o.signal.reason, S3 && (s.status.fetchAbortIgnored = true)) : s.status.fetchResolved = true), g2 && !S3 && !w2) return c(o.signal.reason, E);
|
|
2041
2047
|
let y2 = f, b = this.#i[e];
|
|
2042
2048
|
return (b === f || S3 && w2 && b === void 0) && (p === void 0 ? y2.__staleWhileFetching !== void 0 ? this.#i[e] = y2.__staleWhileFetching : this.#O(t, "fetch") : (s.status && (s.status.fetchUpdated = true), this.set(t, p, a2.options))), p;
|
|
2043
|
-
},
|
|
2049
|
+
}, u2 = (p) => (s.status && (s.status.fetchRejected = true, s.status.fetchError = p), c(p, false)), c = (p, w2) => {
|
|
2044
2050
|
let { aborted: g2 } = o.signal, S3 = g2 && s.allowStaleOnFetchAbort, E = S3 || s.allowStaleOnFetchRejection, y2 = E || s.noDeleteOnFetchRejection, b = f;
|
|
2045
2051
|
if (this.#i[e] === f && (!y2 || !w2 && b.__staleWhileFetching === void 0 ? this.#O(t, "fetch") : S3 || (this.#i[e] = b.__staleWhileFetching)), E) return s.status && b.__staleWhileFetching !== void 0 && (s.status.returnedStale = true), b.__staleWhileFetching;
|
|
2046
2052
|
if (b.__returned === b) throw p;
|
|
2047
|
-
},
|
|
2053
|
+
}, d4 = (p, w2) => {
|
|
2048
2054
|
let g2 = this.#S?.(t, r, a2);
|
|
2049
2055
|
g2 && g2 instanceof Promise && g2.then((S3) => p(S3 === void 0 ? void 0 : S3), w2), o.signal.addEventListener("abort", () => {
|
|
2050
2056
|
(!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (S3) => l(S3, true)));
|
|
2051
2057
|
});
|
|
2052
2058
|
};
|
|
2053
2059
|
s.status && (s.status.fetchDispatched = true);
|
|
2054
|
-
let f = new Promise(
|
|
2060
|
+
let f = new Promise(d4).then(l, u2), m2 = Object.assign(f, { __abortController: o, __staleWhileFetching: r, __returned: void 0 });
|
|
2055
2061
|
return e === void 0 ? (this.set(t, m2, { ...a2.options, status: void 0 }), e = this.#f.get(t)) : this.#i[e] = m2, m2;
|
|
2056
2062
|
}
|
|
2057
2063
|
#l(t) {
|
|
@@ -2060,9 +2066,9 @@ var ft = class Me {
|
|
|
2060
2066
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof At;
|
|
2061
2067
|
}
|
|
2062
2068
|
async fetch(t, e = {}) {
|
|
2063
|
-
let { allowStale: s = this.allowStale, updateAgeOnGet: i2 = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a2 = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL:
|
|
2069
|
+
let { allowStale: s = this.allowStale, updateAgeOnGet: i2 = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a2 = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: u2 = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d4 = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: m2 = this.allowStaleOnFetchAbort, context: p, forceRefresh: w2 = false, status: g2, signal: S3 } = e;
|
|
2064
2070
|
if (!this.#A) return g2 && (g2.fetch = "get"), this.get(t, { allowStale: s, updateAgeOnGet: i2, noDeleteOnStaleGet: r, status: g2 });
|
|
2065
|
-
let E = { allowStale: s, updateAgeOnGet: i2, noDeleteOnStaleGet: r, ttl: o, noDisposeOnSet: h, size: a2, sizeCalculation: l, noUpdateTTL:
|
|
2071
|
+
let E = { allowStale: s, updateAgeOnGet: i2, noDeleteOnStaleGet: r, ttl: o, noDisposeOnSet: h, size: a2, sizeCalculation: l, noUpdateTTL: u2, noDeleteOnFetchRejection: c, allowStaleOnFetchRejection: d4, allowStaleOnFetchAbort: m2, ignoreFetchAbort: f, status: g2, signal: S3 }, y2 = this.#f.get(t);
|
|
2066
2072
|
if (y2 === void 0) {
|
|
2067
2073
|
g2 && (g2.fetch = "miss");
|
|
2068
2074
|
let b = this.#U(t, y2, E, p);
|
|
@@ -2174,13 +2180,13 @@ var et = /* @__PURE__ */ Symbol("decoder");
|
|
|
2174
2180
|
var v2 = /* @__PURE__ */ Symbol("flowing");
|
|
2175
2181
|
var dt = /* @__PURE__ */ Symbol("paused");
|
|
2176
2182
|
var st = /* @__PURE__ */ Symbol("resume");
|
|
2177
|
-
var
|
|
2178
|
-
var
|
|
2179
|
-
var
|
|
2183
|
+
var C2 = /* @__PURE__ */ Symbol("buffer");
|
|
2184
|
+
var F2 = /* @__PURE__ */ Symbol("pipes");
|
|
2185
|
+
var T3 = /* @__PURE__ */ Symbol("bufferLength");
|
|
2180
2186
|
var Yt = /* @__PURE__ */ Symbol("bufferPush");
|
|
2181
2187
|
var Ft = /* @__PURE__ */ Symbol("bufferShift");
|
|
2182
|
-
var
|
|
2183
|
-
var
|
|
2188
|
+
var k3 = /* @__PURE__ */ Symbol("objectMode");
|
|
2189
|
+
var x2 = /* @__PURE__ */ Symbol("destroyed");
|
|
2184
2190
|
var Xt = /* @__PURE__ */ Symbol("error");
|
|
2185
2191
|
var Jt = /* @__PURE__ */ Symbol("emitData");
|
|
2186
2192
|
var We = /* @__PURE__ */ Symbol("emitEnd");
|
|
@@ -2226,9 +2232,9 @@ var pi = (n7) => !n7.objectMode && !!n7.encoding && n7.encoding !== "buffer";
|
|
|
2226
2232
|
var V = class extends ee {
|
|
2227
2233
|
[v2] = false;
|
|
2228
2234
|
[dt] = false;
|
|
2229
|
-
[
|
|
2230
|
-
[
|
|
2231
|
-
[
|
|
2235
|
+
[F2] = [];
|
|
2236
|
+
[C2] = [];
|
|
2237
|
+
[k3];
|
|
2232
2238
|
[P3];
|
|
2233
2239
|
[B];
|
|
2234
2240
|
[et];
|
|
@@ -2237,8 +2243,8 @@ var V = class extends ee {
|
|
|
2237
2243
|
[kt] = false;
|
|
2238
2244
|
[Rt] = false;
|
|
2239
2245
|
[ut] = null;
|
|
2240
|
-
[
|
|
2241
|
-
[
|
|
2246
|
+
[T3] = 0;
|
|
2247
|
+
[x2] = false;
|
|
2242
2248
|
[pt];
|
|
2243
2249
|
[Dt] = false;
|
|
2244
2250
|
[Y] = 0;
|
|
@@ -2248,12 +2254,12 @@ var V = class extends ee {
|
|
|
2248
2254
|
constructor(...t) {
|
|
2249
2255
|
let e = t[0] || {};
|
|
2250
2256
|
if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
|
|
2251
|
-
di(e) ? (this[
|
|
2257
|
+
di(e) ? (this[k3] = true, this[P3] = null) : pi(e) ? (this[P3] = e.encoding, this[k3] = false) : (this[k3] = false, this[P3] = null), this[B] = !!e.async, this[et] = this[P3] ? new ni(this[P3]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[C2] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[F2] });
|
|
2252
2258
|
let { signal: s } = e;
|
|
2253
2259
|
s && (this[pt] = s, s.aborted ? this[Qt]() : s.addEventListener("abort", () => this[Qt]()));
|
|
2254
2260
|
}
|
|
2255
2261
|
get bufferLength() {
|
|
2256
|
-
return this[
|
|
2262
|
+
return this[T3];
|
|
2257
2263
|
}
|
|
2258
2264
|
get encoding() {
|
|
2259
2265
|
return this[P3];
|
|
@@ -2265,7 +2271,7 @@ var V = class extends ee {
|
|
|
2265
2271
|
throw new Error("Encoding must be set at instantiation time");
|
|
2266
2272
|
}
|
|
2267
2273
|
get objectMode() {
|
|
2268
|
-
return this[
|
|
2274
|
+
return this[k3];
|
|
2269
2275
|
}
|
|
2270
2276
|
set objectMode(t) {
|
|
2271
2277
|
throw new Error("objectMode must be set at instantiation time");
|
|
@@ -2287,36 +2293,36 @@ var V = class extends ee {
|
|
|
2287
2293
|
write(t, e, s) {
|
|
2288
2294
|
if (this[Dt]) return false;
|
|
2289
2295
|
if (this[G2]) throw new Error("write after end");
|
|
2290
|
-
if (this[
|
|
2296
|
+
if (this[x2]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
2291
2297
|
typeof e == "function" && (s = e, e = "utf8"), e || (e = "utf8");
|
|
2292
2298
|
let i2 = this[B] ? mt : li;
|
|
2293
|
-
if (!this[
|
|
2299
|
+
if (!this[k3] && !Buffer.isBuffer(t)) {
|
|
2294
2300
|
if (ui(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
2295
2301
|
else if (fi(t)) t = Buffer.from(t);
|
|
2296
2302
|
else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
2297
2303
|
}
|
|
2298
|
-
return this[
|
|
2304
|
+
return this[k3] ? (this[v2] && this[T3] !== 0 && this[Ot](true), this[v2] ? this.emit("data", t) : this[Yt](t), this[T3] !== 0 && this.emit("readable"), s && i2(s), this[v2]) : t.length ? (typeof t == "string" && !(e === this[P3] && !this[et]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[P3] && (t = this[et].write(t)), this[v2] && this[T3] !== 0 && this[Ot](true), this[v2] ? this.emit("data", t) : this[Yt](t), this[T3] !== 0 && this.emit("readable"), s && i2(s), this[v2]) : (this[T3] !== 0 && this.emit("readable"), s && i2(s), this[v2]);
|
|
2299
2305
|
}
|
|
2300
2306
|
read(t) {
|
|
2301
|
-
if (this[
|
|
2302
|
-
if (this[M2] = false, this[
|
|
2303
|
-
this[
|
|
2304
|
-
let e = this[_e](t || null, this[
|
|
2307
|
+
if (this[x2]) return null;
|
|
2308
|
+
if (this[M2] = false, this[T3] === 0 || t === 0 || t && t > this[T3]) return this[H2](), null;
|
|
2309
|
+
this[k3] && (t = null), this[C2].length > 1 && !this[k3] && (this[C2] = [this[P3] ? this[C2].join("") : Buffer.concat(this[C2], this[T3])]);
|
|
2310
|
+
let e = this[_e](t || null, this[C2][0]);
|
|
2305
2311
|
return this[H2](), e;
|
|
2306
2312
|
}
|
|
2307
2313
|
[_e](t, e) {
|
|
2308
|
-
if (this[
|
|
2314
|
+
if (this[k3]) this[Ft]();
|
|
2309
2315
|
else {
|
|
2310
2316
|
let s = e;
|
|
2311
|
-
t === s.length || t === null ? this[Ft]() : typeof s == "string" ? (this[
|
|
2317
|
+
t === s.length || t === null ? this[Ft]() : typeof s == "string" ? (this[C2][0] = s.slice(t), e = s.slice(0, t), this[T3] -= t) : (this[C2][0] = s.subarray(t), e = s.subarray(0, t), this[T3] -= t);
|
|
2312
2318
|
}
|
|
2313
|
-
return this.emit("data", e), !this[
|
|
2319
|
+
return this.emit("data", e), !this[C2].length && !this[G2] && this.emit("drain"), e;
|
|
2314
2320
|
}
|
|
2315
2321
|
end(t, e, s) {
|
|
2316
2322
|
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[v2] || !this[dt]) && this[H2](), this;
|
|
2317
2323
|
}
|
|
2318
2324
|
[st]() {
|
|
2319
|
-
this[
|
|
2325
|
+
this[x2] || (!this[Y] && !this[F2].length && (this[M2] = true), this[dt] = false, this[v2] = true, this.emit("resume"), this[C2].length ? this[Ot]() : this[G2] ? this[H2]() : this.emit("drain"));
|
|
2320
2326
|
}
|
|
2321
2327
|
resume() {
|
|
2322
2328
|
return this[st]();
|
|
@@ -2325,7 +2331,7 @@ var V = class extends ee {
|
|
|
2325
2331
|
this[v2] = false, this[dt] = true, this[M2] = false;
|
|
2326
2332
|
}
|
|
2327
2333
|
get destroyed() {
|
|
2328
|
-
return this[
|
|
2334
|
+
return this[x2];
|
|
2329
2335
|
}
|
|
2330
2336
|
get flowing() {
|
|
2331
2337
|
return this[v2];
|
|
@@ -2334,37 +2340,37 @@ var V = class extends ee {
|
|
|
2334
2340
|
return this[dt];
|
|
2335
2341
|
}
|
|
2336
2342
|
[Yt](t) {
|
|
2337
|
-
this[
|
|
2343
|
+
this[k3] ? this[T3] += 1 : this[T3] += t.length, this[C2].push(t);
|
|
2338
2344
|
}
|
|
2339
2345
|
[Ft]() {
|
|
2340
|
-
return this[
|
|
2346
|
+
return this[k3] ? this[T3] -= 1 : this[T3] -= this[C2][0].length, this[C2].shift();
|
|
2341
2347
|
}
|
|
2342
2348
|
[Ot](t = false) {
|
|
2343
2349
|
do
|
|
2344
2350
|
;
|
|
2345
|
-
while (this[Le](this[Ft]()) && this[
|
|
2346
|
-
!t && !this[
|
|
2351
|
+
while (this[Le](this[Ft]()) && this[C2].length);
|
|
2352
|
+
!t && !this[C2].length && !this[G2] && this.emit("drain");
|
|
2347
2353
|
}
|
|
2348
2354
|
[Le](t) {
|
|
2349
2355
|
return this.emit("data", t), this[v2];
|
|
2350
2356
|
}
|
|
2351
2357
|
pipe(t, e) {
|
|
2352
|
-
if (this[
|
|
2358
|
+
if (this[x2]) return t;
|
|
2353
2359
|
this[M2] = false;
|
|
2354
2360
|
let s = this[K];
|
|
2355
|
-
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[
|
|
2361
|
+
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[F2].push(e.proxyErrors ? new te(this, t, e) : new Mt(this, t, e)), this[B] ? mt(() => this[st]()) : this[st]()), t;
|
|
2356
2362
|
}
|
|
2357
2363
|
unpipe(t) {
|
|
2358
|
-
let e = this[
|
|
2359
|
-
e && (this[
|
|
2364
|
+
let e = this[F2].find((s) => s.dest === t);
|
|
2365
|
+
e && (this[F2].length === 1 ? (this[v2] && this[Y] === 0 && (this[v2] = false), this[F2] = []) : this[F2].splice(this[F2].indexOf(e), 1), e.unpipe());
|
|
2360
2366
|
}
|
|
2361
2367
|
addListener(t, e) {
|
|
2362
2368
|
return this.on(t, e);
|
|
2363
2369
|
}
|
|
2364
2370
|
on(t, e) {
|
|
2365
2371
|
let s = super.on(t, e);
|
|
2366
|
-
if (t === "data") this[M2] = false, this[Y]++, !this[
|
|
2367
|
-
else if (t === "readable" && this[
|
|
2372
|
+
if (t === "data") this[M2] = false, this[Y]++, !this[F2].length && !this[v2] && this[st]();
|
|
2373
|
+
else if (t === "readable" && this[T3] !== 0) super.emit("readable");
|
|
2368
2374
|
else if (ci(t) && this[K]) super.emit(t), this.removeAllListeners(t);
|
|
2369
2375
|
else if (t === "error" && this[ut]) {
|
|
2370
2376
|
let i2 = e;
|
|
@@ -2377,25 +2383,25 @@ var V = class extends ee {
|
|
|
2377
2383
|
}
|
|
2378
2384
|
off(t, e) {
|
|
2379
2385
|
let s = super.off(t, e);
|
|
2380
|
-
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M2] && !this[
|
|
2386
|
+
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M2] && !this[F2].length && (this[v2] = false)), s;
|
|
2381
2387
|
}
|
|
2382
2388
|
removeAllListeners(t) {
|
|
2383
2389
|
let e = super.removeAllListeners(t);
|
|
2384
|
-
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M2] && !this[
|
|
2390
|
+
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M2] && !this[F2].length && (this[v2] = false)), e;
|
|
2385
2391
|
}
|
|
2386
2392
|
get emittedEnd() {
|
|
2387
2393
|
return this[K];
|
|
2388
2394
|
}
|
|
2389
2395
|
[H2]() {
|
|
2390
|
-
!this[kt] && !this[K] && !this[
|
|
2396
|
+
!this[kt] && !this[K] && !this[x2] && this[C2].length === 0 && this[G2] && (this[kt] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Rt] && this.emit("close"), this[kt] = false);
|
|
2391
2397
|
}
|
|
2392
2398
|
emit(t, ...e) {
|
|
2393
2399
|
let s = e[0];
|
|
2394
|
-
if (t !== "error" && t !== "close" && t !==
|
|
2395
|
-
if (t === "data") return !this[
|
|
2400
|
+
if (t !== "error" && t !== "close" && t !== x2 && this[x2]) return false;
|
|
2401
|
+
if (t === "data") return !this[k3] && !s ? false : this[B] ? (mt(() => this[Jt](s)), true) : this[Jt](s);
|
|
2396
2402
|
if (t === "end") return this[We]();
|
|
2397
2403
|
if (t === "close") {
|
|
2398
|
-
if (this[Rt] = true, !this[K] && !this[
|
|
2404
|
+
if (this[Rt] = true, !this[K] && !this[x2]) return false;
|
|
2399
2405
|
let r = super.emit("close");
|
|
2400
2406
|
return this.removeAllListeners("close"), r;
|
|
2401
2407
|
} else if (t === "error") {
|
|
@@ -2413,7 +2419,7 @@ var V = class extends ee {
|
|
|
2413
2419
|
return this[H2](), i2;
|
|
2414
2420
|
}
|
|
2415
2421
|
[Jt](t) {
|
|
2416
|
-
for (let s of this[
|
|
2422
|
+
for (let s of this[F2]) s.dest.write(t) === false && this.pause();
|
|
2417
2423
|
let e = this[M2] ? false : super.emit("data", t);
|
|
2418
2424
|
return this[H2](), e;
|
|
2419
2425
|
}
|
|
@@ -2424,30 +2430,30 @@ var V = class extends ee {
|
|
|
2424
2430
|
if (this[et]) {
|
|
2425
2431
|
let e = this[et].end();
|
|
2426
2432
|
if (e) {
|
|
2427
|
-
for (let s of this[
|
|
2433
|
+
for (let s of this[F2]) s.dest.write(e);
|
|
2428
2434
|
this[M2] || super.emit("data", e);
|
|
2429
2435
|
}
|
|
2430
2436
|
}
|
|
2431
|
-
for (let e of this[
|
|
2437
|
+
for (let e of this[F2]) e.end();
|
|
2432
2438
|
let t = super.emit("end");
|
|
2433
2439
|
return this.removeAllListeners("end"), t;
|
|
2434
2440
|
}
|
|
2435
2441
|
async collect() {
|
|
2436
2442
|
let t = Object.assign([], { dataLength: 0 });
|
|
2437
|
-
this[
|
|
2443
|
+
this[k3] || (t.dataLength = 0);
|
|
2438
2444
|
let e = this.promise();
|
|
2439
2445
|
return this.on("data", (s) => {
|
|
2440
|
-
t.push(s), this[
|
|
2446
|
+
t.push(s), this[k3] || (t.dataLength += s.length);
|
|
2441
2447
|
}), await e, t;
|
|
2442
2448
|
}
|
|
2443
2449
|
async concat() {
|
|
2444
|
-
if (this[
|
|
2450
|
+
if (this[k3]) throw new Error("cannot concat in objectMode");
|
|
2445
2451
|
let t = await this.collect();
|
|
2446
2452
|
return this[P3] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
2447
2453
|
}
|
|
2448
2454
|
async promise() {
|
|
2449
2455
|
return new Promise((t, e) => {
|
|
2450
|
-
this.on(
|
|
2456
|
+
this.on(x2, () => e(new Error("stream destroyed"))), this.on("error", (s) => e(s)), this.on("end", () => t());
|
|
2451
2457
|
});
|
|
2452
2458
|
}
|
|
2453
2459
|
[Symbol.asyncIterator]() {
|
|
@@ -2459,14 +2465,14 @@ var V = class extends ee {
|
|
|
2459
2465
|
if (i2 !== null) return Promise.resolve({ done: false, value: i2 });
|
|
2460
2466
|
if (this[G2]) return e();
|
|
2461
2467
|
let r, o, h = (c) => {
|
|
2462
|
-
this.off("data", a2), this.off("end", l), this.off(
|
|
2468
|
+
this.off("data", a2), this.off("end", l), this.off(x2, u2), e(), o(c);
|
|
2463
2469
|
}, a2 = (c) => {
|
|
2464
|
-
this.off("error", h), this.off("end", l), this.off(
|
|
2470
|
+
this.off("error", h), this.off("end", l), this.off(x2, u2), this.pause(), r({ value: c, done: !!this[G2] });
|
|
2465
2471
|
}, l = () => {
|
|
2466
|
-
this.off("error", h), this.off("data", a2), this.off(
|
|
2467
|
-
},
|
|
2468
|
-
return new Promise((c,
|
|
2469
|
-
o =
|
|
2472
|
+
this.off("error", h), this.off("data", a2), this.off(x2, u2), e(), r({ done: true, value: void 0 });
|
|
2473
|
+
}, u2 = () => h(new Error("stream destroyed"));
|
|
2474
|
+
return new Promise((c, d4) => {
|
|
2475
|
+
o = d4, r = c, this.once(x2, u2), this.once("error", h), this.once("end", l), this.once("data", a2);
|
|
2470
2476
|
});
|
|
2471
2477
|
}, throw: e, return: e, [Symbol.asyncIterator]() {
|
|
2472
2478
|
return this;
|
|
@@ -2475,21 +2481,21 @@ var V = class extends ee {
|
|
|
2475
2481
|
}
|
|
2476
2482
|
[Symbol.iterator]() {
|
|
2477
2483
|
this[M2] = false;
|
|
2478
|
-
let t = false, e = () => (this.pause(), this.off(Xt, e), this.off(
|
|
2484
|
+
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 = () => {
|
|
2479
2485
|
if (t) return e();
|
|
2480
2486
|
let i2 = this.read();
|
|
2481
2487
|
return i2 === null ? e() : { done: false, value: i2 };
|
|
2482
2488
|
};
|
|
2483
|
-
return this.once("end", e), this.once(Xt, e), this.once(
|
|
2489
|
+
return this.once("end", e), this.once(Xt, e), this.once(x2, e), { next: s, throw: e, return: e, [Symbol.iterator]() {
|
|
2484
2490
|
return this;
|
|
2485
2491
|
}, [Symbol.dispose]: () => {
|
|
2486
2492
|
} };
|
|
2487
2493
|
}
|
|
2488
2494
|
destroy(t) {
|
|
2489
|
-
if (this[
|
|
2490
|
-
this[
|
|
2495
|
+
if (this[x2]) return t ? this.emit("error", t) : this.emit(x2), this;
|
|
2496
|
+
this[x2] = true, this[M2] = true, this[C2].length = 0, this[T3] = 0;
|
|
2491
2497
|
let e = this;
|
|
2492
|
-
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(
|
|
2498
|
+
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(x2), this;
|
|
2493
2499
|
}
|
|
2494
2500
|
static get isStream() {
|
|
2495
2501
|
return oi;
|
|
@@ -2853,8 +2859,8 @@ var R3 = class {
|
|
|
2853
2859
|
}
|
|
2854
2860
|
}
|
|
2855
2861
|
#$(t) {
|
|
2856
|
-
let { atime: e, atimeMs: s, birthtime: i2, birthtimeMs: r, blksize: o, blocks: h, ctime: a2, ctimeMs: l, dev:
|
|
2857
|
-
this.#b = e, this.#a = s, this.#m = i2, this.#E = r, this.#c = o, this.#f = h, this.#R = a2, this.#d = l, this.#s =
|
|
2862
|
+
let { atime: e, atimeMs: s, birthtime: i2, birthtimeMs: r, blksize: o, blocks: h, ctime: a2, ctimeMs: l, dev: u2, gid: c, ino: d4, mode: f, mtime: m2, mtimeMs: p, nlink: w2, rdev: g2, size: S3, uid: E } = t;
|
|
2863
|
+
this.#b = e, this.#a = s, this.#m = i2, this.#E = r, this.#c = o, this.#f = h, this.#R = a2, this.#d = l, this.#s = u2, this.#S = c, this.#h = d4, this.#n = f, this.#p = m2, this.#i = p, this.#r = w2, this.#w = g2, this.#u = S3, this.#o = E;
|
|
2858
2864
|
let y2 = ie(t);
|
|
2859
2865
|
this.#e = this.#e & gt | y2 | je, y2 !== L3 && y2 !== U3 && y2 !== X && (this.#e |= yt);
|
|
2860
2866
|
}
|
|
@@ -3010,10 +3016,10 @@ var It = class {
|
|
|
3010
3016
|
let a2 = h.substring(this.rootPath.length).split(s);
|
|
3011
3017
|
if (a2.length === 1 && !a2[0] && a2.pop(), i2 === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor");
|
|
3012
3018
|
this.nocase = i2, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root;
|
|
3013
|
-
let l = this.root,
|
|
3019
|
+
let l = this.root, u2 = a2.length - 1, c = e.sep, d4 = this.rootPath, f = false;
|
|
3014
3020
|
for (let m2 of a2) {
|
|
3015
|
-
let p =
|
|
3016
|
-
l = l.child(m2, { relative: new Array(p).fill("..").join(c), relativePosix: new Array(p).fill("..").join("/"), fullpath:
|
|
3021
|
+
let p = u2--;
|
|
3022
|
+
l = l.child(m2, { relative: new Array(p).fill("..").join(c), relativePosix: new Array(p).fill("..").join("/"), fullpath: d4 += (f ? "" : c) + m2 }), f = true;
|
|
3017
3023
|
}
|
|
3018
3024
|
this.cwd = l;
|
|
3019
3025
|
}
|
|
@@ -3100,20 +3106,20 @@ var It = class {
|
|
|
3100
3106
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R3 || (e = t, t = this.cwd);
|
|
3101
3107
|
let { withFileTypes: s = true, follow: i2 = false, filter: r, walkFilter: o } = e, h = [];
|
|
3102
3108
|
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
3103
|
-
let a2 = /* @__PURE__ */ new Set(), l = (c,
|
|
3109
|
+
let a2 = /* @__PURE__ */ new Set(), l = (c, d4) => {
|
|
3104
3110
|
a2.add(c), c.readdirCB((f, m2) => {
|
|
3105
|
-
if (f) return
|
|
3111
|
+
if (f) return d4(f);
|
|
3106
3112
|
let p = m2.length;
|
|
3107
|
-
if (!p) return
|
|
3113
|
+
if (!p) return d4();
|
|
3108
3114
|
let w2 = () => {
|
|
3109
|
-
--p === 0 &&
|
|
3115
|
+
--p === 0 && d4();
|
|
3110
3116
|
};
|
|
3111
3117
|
for (let g2 of m2) (!r || r(g2)) && h.push(s ? g2 : g2.fullpath()), i2 && g2.isSymbolicLink() ? g2.realpath().then((S3) => S3?.isUnknown() ? S3.lstat() : S3).then((S3) => S3?.shouldWalk(a2, o) ? l(S3, w2) : w2()) : g2.shouldWalk(a2, o) ? l(g2, w2) : w2();
|
|
3112
3118
|
}, true);
|
|
3113
|
-
},
|
|
3114
|
-
return new Promise((c,
|
|
3115
|
-
l(
|
|
3116
|
-
if (f) return
|
|
3119
|
+
}, u2 = t;
|
|
3120
|
+
return new Promise((c, d4) => {
|
|
3121
|
+
l(u2, (f) => {
|
|
3122
|
+
if (f) return d4(f);
|
|
3117
3123
|
c(h);
|
|
3118
3124
|
});
|
|
3119
3125
|
});
|
|
@@ -3124,15 +3130,15 @@ var It = class {
|
|
|
3124
3130
|
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
3125
3131
|
let a2 = /* @__PURE__ */ new Set([t]);
|
|
3126
3132
|
for (let l of a2) {
|
|
3127
|
-
let
|
|
3128
|
-
for (let c of
|
|
3133
|
+
let u2 = l.readdirSync();
|
|
3134
|
+
for (let c of u2) {
|
|
3129
3135
|
(!r || r(c)) && h.push(s ? c : c.fullpath());
|
|
3130
|
-
let
|
|
3136
|
+
let d4 = c;
|
|
3131
3137
|
if (c.isSymbolicLink()) {
|
|
3132
|
-
if (!(i2 && (
|
|
3133
|
-
|
|
3138
|
+
if (!(i2 && (d4 = c.realpathSync()))) continue;
|
|
3139
|
+
d4.isUnknown() && d4.lstatSync();
|
|
3134
3140
|
}
|
|
3135
|
-
|
|
3141
|
+
d4.shouldWalk(a2, o) && a2.add(d4);
|
|
3136
3142
|
}
|
|
3137
3143
|
}
|
|
3138
3144
|
return h;
|
|
@@ -3153,11 +3159,11 @@ var It = class {
|
|
|
3153
3159
|
let h = /* @__PURE__ */ new Set([t]);
|
|
3154
3160
|
for (let a2 of h) {
|
|
3155
3161
|
let l = a2.readdirSync();
|
|
3156
|
-
for (let
|
|
3157
|
-
(!r || r(
|
|
3158
|
-
let c =
|
|
3159
|
-
if (
|
|
3160
|
-
if (!(i2 && (c =
|
|
3162
|
+
for (let u2 of l) {
|
|
3163
|
+
(!r || r(u2)) && (yield s ? u2 : u2.fullpath());
|
|
3164
|
+
let c = u2;
|
|
3165
|
+
if (u2.isSymbolicLink()) {
|
|
3166
|
+
if (!(i2 && (c = u2.realpathSync()))) continue;
|
|
3161
3167
|
c.isUnknown() && c.lstatSync();
|
|
3162
3168
|
}
|
|
3163
3169
|
c.shouldWalk(h, o) && h.add(c);
|
|
@@ -3168,15 +3174,15 @@ var It = class {
|
|
|
3168
3174
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R3 || (e = t, t = this.cwd);
|
|
3169
3175
|
let { withFileTypes: s = true, follow: i2 = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true });
|
|
3170
3176
|
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
3171
|
-
let a2 = /* @__PURE__ */ new Set(), l = [t],
|
|
3172
|
-
let
|
|
3173
|
-
for (; !
|
|
3177
|
+
let a2 = /* @__PURE__ */ new Set(), l = [t], u2 = 0, c = () => {
|
|
3178
|
+
let d4 = false;
|
|
3179
|
+
for (; !d4; ) {
|
|
3174
3180
|
let f = l.shift();
|
|
3175
3181
|
if (!f) {
|
|
3176
|
-
|
|
3182
|
+
u2 === 0 && h.end();
|
|
3177
3183
|
return;
|
|
3178
3184
|
}
|
|
3179
|
-
|
|
3185
|
+
u2++, a2.add(f);
|
|
3180
3186
|
let m2 = (w2, g2, S3 = false) => {
|
|
3181
3187
|
if (w2) return h.emit("error", w2);
|
|
3182
3188
|
if (i2 && !S3) {
|
|
@@ -3187,13 +3193,13 @@ var It = class {
|
|
|
3187
3193
|
return;
|
|
3188
3194
|
}
|
|
3189
3195
|
}
|
|
3190
|
-
for (let E of g2) E && (!r || r(E)) && (h.write(s ? E : E.fullpath()) || (
|
|
3191
|
-
|
|
3196
|
+
for (let E of g2) E && (!r || r(E)) && (h.write(s ? E : E.fullpath()) || (d4 = true));
|
|
3197
|
+
u2--;
|
|
3192
3198
|
for (let E of g2) {
|
|
3193
3199
|
let y2 = E.realpathCached() || E;
|
|
3194
3200
|
y2.shouldWalk(a2, o) && l.push(y2);
|
|
3195
3201
|
}
|
|
3196
|
-
|
|
3202
|
+
d4 && !h.flowing ? h.once("drain", c) : p || c();
|
|
3197
3203
|
}, p = true;
|
|
3198
3204
|
f.readdirCB(m2, true), p = false;
|
|
3199
3205
|
}
|
|
@@ -3204,18 +3210,18 @@ var It = class {
|
|
|
3204
3210
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R3 || (e = t, t = this.cwd);
|
|
3205
3211
|
let { withFileTypes: s = true, follow: i2 = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true }), a2 = /* @__PURE__ */ new Set();
|
|
3206
3212
|
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
3207
|
-
let l = [t],
|
|
3208
|
-
let
|
|
3209
|
-
for (; !
|
|
3213
|
+
let l = [t], u2 = 0, c = () => {
|
|
3214
|
+
let d4 = false;
|
|
3215
|
+
for (; !d4; ) {
|
|
3210
3216
|
let f = l.shift();
|
|
3211
3217
|
if (!f) {
|
|
3212
|
-
|
|
3218
|
+
u2 === 0 && h.end();
|
|
3213
3219
|
return;
|
|
3214
3220
|
}
|
|
3215
|
-
|
|
3221
|
+
u2++, a2.add(f);
|
|
3216
3222
|
let m2 = f.readdirSync();
|
|
3217
|
-
for (let p of m2) (!r || r(p)) && (h.write(s ? p : p.fullpath()) || (
|
|
3218
|
-
|
|
3223
|
+
for (let p of m2) (!r || r(p)) && (h.write(s ? p : p.fullpath()) || (d4 = true));
|
|
3224
|
+
u2--;
|
|
3219
3225
|
for (let p of m2) {
|
|
3220
3226
|
let w2 = p;
|
|
3221
3227
|
if (p.isSymbolicLink()) {
|
|
@@ -3225,7 +3231,7 @@ var It = class {
|
|
|
3225
3231
|
w2.shouldWalk(a2, o) && l.push(w2);
|
|
3226
3232
|
}
|
|
3227
3233
|
}
|
|
3228
|
-
|
|
3234
|
+
d4 && !h.flowing && h.once("drain", c);
|
|
3229
3235
|
};
|
|
3230
3236
|
return c(), h;
|
|
3231
3237
|
}
|
|
@@ -3297,15 +3303,15 @@ var nt = class n4 {
|
|
|
3297
3303
|
if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range");
|
|
3298
3304
|
if (this.#t = t, this.#s = e, this.#n = s, this.#r = i2, this.#n === 0) {
|
|
3299
3305
|
if (this.isUNC()) {
|
|
3300
|
-
let [r, o, h, a2, ...l] = this.#t, [
|
|
3306
|
+
let [r, o, h, a2, ...l] = this.#t, [u2, c, d4, f, ...m2] = this.#s;
|
|
3301
3307
|
l[0] === "" && (l.shift(), m2.shift());
|
|
3302
|
-
let p = [r, o, h, a2, ""].join("/"), w2 = [
|
|
3308
|
+
let p = [r, o, h, a2, ""].join("/"), w2 = [u2, c, d4, f, ""].join("/");
|
|
3303
3309
|
this.#t = [p, ...l], this.#s = [w2, ...m2], this.length = this.#t.length;
|
|
3304
3310
|
} else if (this.isDrive() || this.isAbsolute()) {
|
|
3305
3311
|
let [r, ...o] = this.#t, [h, ...a2] = this.#s;
|
|
3306
3312
|
o[0] === "" && (o.shift(), a2.shift());
|
|
3307
|
-
let l = r + "/",
|
|
3308
|
-
this.#t = [l, ...o], this.#s = [
|
|
3313
|
+
let l = r + "/", u2 = h + "/";
|
|
3314
|
+
this.#t = [l, ...o], this.#s = [u2, ...a2], this.length = this.#t.length;
|
|
3309
3315
|
}
|
|
3310
3316
|
}
|
|
3311
3317
|
}
|
|
@@ -3369,12 +3375,12 @@ var ot = class {
|
|
|
3369
3375
|
for (let h of t) this.add(h);
|
|
3370
3376
|
}
|
|
3371
3377
|
add(t) {
|
|
3372
|
-
let e = new
|
|
3378
|
+
let e = new D(t, this.mmopts);
|
|
3373
3379
|
for (let s = 0; s < e.set.length; s++) {
|
|
3374
3380
|
let i2 = e.set[s], r = e.globParts[s];
|
|
3375
3381
|
if (!i2 || !r) throw new Error("invalid pattern object");
|
|
3376
3382
|
for (; i2[0] === "." && r[0] === "."; ) i2.shift(), r.shift();
|
|
3377
|
-
let o = new nt(i2, r, 0, this.platform), h = new
|
|
3383
|
+
let o = new nt(i2, r, 0, this.platform), h = new D(o.globString(), this.mmopts), a2 = r[r.length - 1] === "**", l = o.isAbsolute();
|
|
3378
3384
|
l ? this.absolute.push(h) : this.relative.push(h), a2 && (l ? this.absoluteChildren.push(h) : this.relativeChildren.push(h));
|
|
3379
3385
|
}
|
|
3380
3386
|
}
|
|
@@ -3463,9 +3469,9 @@ var Et = class n6 {
|
|
|
3463
3469
|
}
|
|
3464
3470
|
}
|
|
3465
3471
|
if (i2.isENOENT()) continue;
|
|
3466
|
-
let a2, l,
|
|
3467
|
-
for (; typeof (a2 = r.pattern()) == "string" && (l = r.rest()); ) i2 = i2.resolve(a2), r = l,
|
|
3468
|
-
if (a2 = r.pattern(), l = r.rest(),
|
|
3472
|
+
let a2, l, u2 = false;
|
|
3473
|
+
for (; typeof (a2 = r.pattern()) == "string" && (l = r.rest()); ) i2 = i2.resolve(a2), r = l, u2 = true;
|
|
3474
|
+
if (a2 = r.pattern(), l = r.rest(), u2) {
|
|
3469
3475
|
if (this.hasWalkedCache.hasWalked(i2, r)) continue;
|
|
3470
3476
|
this.hasWalkedCache.storeWalked(i2, r);
|
|
3471
3477
|
}
|
|
@@ -3475,11 +3481,11 @@ var Et = class n6 {
|
|
|
3475
3481
|
continue;
|
|
3476
3482
|
} else if (a2 === A2) {
|
|
3477
3483
|
(!i2.isSymbolicLink() || this.follow || r.checkFollowGlobstar()) && this.subwalks.add(i2, r);
|
|
3478
|
-
let c = l?.pattern(),
|
|
3479
|
-
if (!l || (c === "" || c === ".") && !
|
|
3484
|
+
let c = l?.pattern(), d4 = l?.rest();
|
|
3485
|
+
if (!l || (c === "" || c === ".") && !d4) this.matches.add(i2, h, c === "" || c === ".");
|
|
3480
3486
|
else if (c === "..") {
|
|
3481
3487
|
let f = i2.parent || i2;
|
|
3482
|
-
|
|
3488
|
+
d4 ? this.hasWalkedCache.hasWalked(f, d4) || this.subwalks.add(f, d4) : this.matches.add(f, h, true);
|
|
3483
3489
|
}
|
|
3484
3490
|
} else a2 instanceof RegExp && this.subwalks.add(i2, r);
|
|
3485
3491
|
}
|
|
@@ -3632,7 +3638,7 @@ var zt = class {
|
|
|
3632
3638
|
if (this.maxDepth !== 1 / 0 && h.depth() >= this.maxDepth) continue;
|
|
3633
3639
|
r++;
|
|
3634
3640
|
let a2 = h.readdirCached();
|
|
3635
|
-
h.calledReaddir() ? this.walkCB3(h, a2, s, o) : h.readdirCB((l,
|
|
3641
|
+
h.calledReaddir() ? this.walkCB3(h, a2, s, o) : h.readdirCB((l, u2) => this.walkCB3(h, u2, s, o), true);
|
|
3636
3642
|
}
|
|
3637
3643
|
o();
|
|
3638
3644
|
}
|
|
@@ -3761,11 +3767,11 @@ var I3 = class {
|
|
|
3761
3767
|
this.scurry = new a2(this.cwd, { nocase: e.nocase, fs: e.fs });
|
|
3762
3768
|
}
|
|
3763
3769
|
this.nocase = this.scurry.nocase;
|
|
3764
|
-
let s = this.platform === "darwin" || this.platform === "win32", i2 = { 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((a2) => new
|
|
3770
|
+
let s = this.platform === "darwin" || this.platform === "win32", i2 = { 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((a2) => new D(a2, i2)), [o, h] = r.reduce((a2, l) => (a2[0].push(...l.set), a2[1].push(...l.globParts), a2), [[], []]);
|
|
3765
3771
|
this.patterns = o.map((a2, l) => {
|
|
3766
|
-
let
|
|
3767
|
-
if (!
|
|
3768
|
-
return new nt(a2,
|
|
3772
|
+
let u2 = h[l];
|
|
3773
|
+
if (!u2) throw new Error("invalid pattern object");
|
|
3774
|
+
return new nt(a2, u2, 0, this.platform);
|
|
3769
3775
|
});
|
|
3770
3776
|
}
|
|
3771
3777
|
async walk() {
|
|
@@ -3795,7 +3801,7 @@ var I3 = class {
|
|
|
3795
3801
|
};
|
|
3796
3802
|
var le = (n7, t = {}) => {
|
|
3797
3803
|
Array.isArray(n7) || (n7 = [n7]);
|
|
3798
|
-
for (let e of n7) if (new
|
|
3804
|
+
for (let e of n7) if (new D(e, t).hasMagic()) return true;
|
|
3799
3805
|
return false;
|
|
3800
3806
|
};
|
|
3801
3807
|
function Bt(n7, t = {}) {
|
|
@@ -4473,7 +4479,7 @@ var rimraf = Object.assign(rimraf_, {
|
|
|
4473
4479
|
rimraf.rimraf = rimraf;
|
|
4474
4480
|
|
|
4475
4481
|
export {
|
|
4476
|
-
|
|
4482
|
+
I,
|
|
4477
4483
|
promiseSpawn,
|
|
4478
4484
|
which,
|
|
4479
4485
|
whichSync,
|