@vltpkg/cli-js 1.0.0-rc.27 → 1.0.0-rc.28
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-6HRR4HXE.js +293 -0
- package/{bugs-CS34LDPD.js → bugs-2CAZQ32S.js} +19 -22
- package/{build-XHEFAWMN.js → build-OAWTNBMS.js} +10 -13
- package/{cache-LII2V5IM.js → cache-ZR7VPPVQ.js} +14 -15
- package/cache-unzip-src-unzip.js +606 -575
- package/chunk-2FIRKA7R.js +73 -0
- package/{chunk-D27QPHKI.js → chunk-2V4AQPBR.js} +67 -20
- package/{chunk-JQHMLTO5.js → chunk-3MWZTKGK.js} +419 -328
- package/chunk-5TSPKXO4.js +116 -0
- package/{chunk-DJBBJDHI.js → chunk-7RZL7BZI.js} +159 -74
- package/{chunk-LAG2R3YJ.js → chunk-BW6C3YUV.js} +6 -6
- package/{chunk-DYL7AFY7.js → chunk-CPM47YUH.js} +5 -3
- package/{chunk-5E5GX4G6.js → chunk-FBTBHRPG.js} +1 -1
- package/{chunk-AZLX27EM.js → chunk-FXDRM4ZO.js} +296 -258
- package/{chunk-6YTJVEK2.js → chunk-HAG4VBEA.js} +11 -11
- package/{chunk-INXSTZAX.js → chunk-HAGUS4HI.js} +21 -21
- package/{chunk-FI5TUER7.js → chunk-HQ4US6G3.js} +681 -687
- package/chunk-IEISSXS4.js +711 -0
- package/{chunk-TRXTSZFT.js → chunk-IYO5QKUW.js} +1 -1
- package/{chunk-XSUIV5NF.js → chunk-M7HPHM7B.js} +14 -12
- package/{chunk-BIUCOMBH.js → chunk-MAIQR5GM.js} +5 -5
- package/{chunk-TDTJOKF2.js → chunk-NLFBANVO.js} +8 -1
- package/{chunk-QWWYZ3TT.js → chunk-OUUIOZ2I.js} +1 -1
- package/{chunk-XWF3GJKE.js → chunk-Q3DNNTPG.js} +27 -1
- package/{chunk-VCSVHRCS.js → chunk-R44FR7BY.js} +1269 -590
- package/{chunk-P2HZ4ISK.js → chunk-RK2PISOZ.js} +54 -6
- package/{chunk-QDGZZ5FZ.js → chunk-TYV4N3S3.js} +6 -692
- package/{chunk-LKFTVDWS.js → chunk-VPKJNCKL.js} +26 -13
- package/{chunk-VTZZIXYW.js → chunk-VRIS5HAW.js} +3 -3
- package/{chunk-S5I2UOBT.js → chunk-WX2DCAG2.js} +7 -7
- package/{chunk-YR47M5L7.js → chunk-XYCCQT7N.js} +34 -39
- package/{chunk-D7U7KDEM.js → chunk-YCQTLBWF.js} +1 -1
- package/{chunk-SR66HWMM.js → chunk-ZINDEKAU.js} +144 -93
- package/{chunk-DJBVQKBB.js → chunk-ZS2RCG25.js} +5 -5
- package/{ci-EEXNEPKP.js → ci-TOJJVHI4.js} +13 -16
- package/cli-package.json +2 -1
- package/{config-4ZFJD5AY.js → config-DVAPEE5D.js} +12 -14
- package/{config-6MUU2TRJ.js → config-GOV4E2KK.js} +26 -26
- package/{create-DEKJKPYX.js → create-CDFZFVHL.js} +24 -26
- package/deprecate-WROL4AHK.js +176 -0
- package/{devtools-NOLON5YL.js → devtools-TPMVKPB5.js} +80 -77
- package/dist-tag-WZXXWXMB.js +204 -0
- package/{docs-5EKPZANX.js → docs-YCOZFMZG.js} +19 -22
- package/{exec-I4YPE6YW.js → exec-V4K5KJMZ.js} +24 -26
- package/{exec-cache-XEWPABLK.js → exec-cache-FHCGIY6J.js} +21 -23
- package/{exec-local-OQXG2VPW.js → exec-local-YU6PF7HM.js} +19 -21
- package/{help-OG655SE5.js → help-DADL3NOX.js} +4 -5
- package/{init-LJH2YTBM.js → init-XNMWYATA.js} +10 -8
- package/{install-KP2FGWOR.js → install-FEGZHZRR.js} +28 -17
- package/{list-ACZ3ZSIZ.js → list-JWAIDRFZ.js} +19 -21
- package/{login-VFTRKZE2.js → login-52SA2DSI.js} +6 -9
- package/{logout-Z4AVG64D.js → logout-5YYHNV5W.js} +6 -9
- package/{pack-GPJNX7RP.js → pack-B7QZHMYP.js} +14 -17
- package/package.json +1 -1
- package/{ping-B2YS4SR3.js → ping-PRGDYDRI.js} +6 -9
- package/{pkg-WUYJDFSH.js → pkg-UEIQIVVD.js} +15 -19
- package/profile-46FKVQEL.js +129 -0
- package/{publish-WTMGC4ET.js → publish-HBYHOSKH.js} +17 -20
- package/{query-UCM35VVC.js → query-UJ2LXHJ5.js} +19 -21
- package/registry-client-package.json +1 -1
- package/registry-client-src-revalidate.js +1157 -1032
- package/{repo-MZCPTQZU.js → repo-I6X66PHD.js} +19 -22
- package/{reporter-XRZ37LFK.js → reporter-NUXJTV4G.js} +2 -3
- package/{run-CAX4Z2SC.js → run-4VSEFXVM.js} +19 -21
- package/{run-exec-SM42FE7W.js → run-exec-5JVZDUZD.js} +19 -21
- package/security-archive-src-update-expired.js +8 -7
- package/{src-SDJWTPCU.js → src-GIDTI3OJ.js} +20 -22
- package/token-YK6L74PA.js +206 -0
- package/{uninstall-YYPPXM2O.js → uninstall-UBUZBV7E.js} +14 -17
- package/unpublish-ZHJEKT7A.js +224 -0
- package/{update-YFUTH33A.js → update-WO4BHJF4.js} +13 -16
- package/{version-SK256WED.js → version-RLESYHML.js} +13 -16
- package/{view-CBYGJ76J.js → view-UA5HXFXG.js} +16 -17
- 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-ZT4ZEN2C.js → whoami-7H3FPR2O.js} +6 -9
- package/chunk-52LBC3AX.js +0 -75
- package/chunk-BGQCUUCA.js +0 -667
- package/chunk-E74WGW5C.js +0 -49
- package/chunk-JLJKOF75.js +0 -40
- package/chunk-YP4YNE5Y.js +0 -68
- package/token-YCURCCNR.js +0 -103
package/cache-unzip-src-unzip.js
CHANGED
|
@@ -34,79 +34,55 @@ import {
|
|
|
34
34
|
writeFile
|
|
35
35
|
} from "node:fs/promises";
|
|
36
36
|
|
|
37
|
-
// ../../node_modules/.vlt/~npm~lru-cache@11.
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
|
|
37
|
+
// ../../node_modules/.vlt/~npm~lru-cache@11.3.5/node_modules/lru-cache/dist/esm/node/index.min.js
|
|
38
|
+
import { tracingChannel as j, channel as I } from "node:diagnostics_channel";
|
|
39
|
+
var S = I("lru-cache:metrics");
|
|
40
|
+
var W = j("lru-cache");
|
|
41
|
+
var D = () => S.hasSubscribers || W.hasSubscribers;
|
|
42
|
+
var G = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
43
|
+
var M = /* @__PURE__ */ new Set();
|
|
44
|
+
var C = typeof process == "object" && process ? process : {};
|
|
45
|
+
var P = (u3, e, t, i) => {
|
|
46
|
+
typeof C.emitWarning == "function" ? C.emitWarning(u3, e, t, i) : console.error(`[${t}] ${e}: ${u3}`);
|
|
43
47
|
};
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
reason;
|
|
51
|
-
aborted = false;
|
|
52
|
-
addEventListener(i, s) {
|
|
53
|
-
this._onabort.push(s);
|
|
54
|
-
}
|
|
55
|
-
}, C = class {
|
|
56
|
-
constructor() {
|
|
57
|
-
t();
|
|
58
|
-
}
|
|
59
|
-
signal = new D();
|
|
60
|
-
abort(i) {
|
|
61
|
-
if (!this.signal.aborted) {
|
|
62
|
-
this.signal.reason = i, this.signal.aborted = true;
|
|
63
|
-
for (let s of this.signal._onabort) s(i);
|
|
64
|
-
this.signal.onabort?.(i);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
let c3 = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
69
|
-
c3 && (c3 = false, U("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
var G = (c3) => !I.has(c3);
|
|
73
|
-
var y = (c3) => c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
|
|
74
|
-
var M = (c3) => y(c3) ? c3 <= Math.pow(2, 8) ? Uint8Array : c3 <= Math.pow(2, 16) ? Uint16Array : c3 <= Math.pow(2, 32) ? Uint32Array : c3 <= Number.MAX_SAFE_INTEGER ? z : null : null;
|
|
75
|
-
var z = class extends Array {
|
|
76
|
-
constructor(t) {
|
|
77
|
-
super(t), this.fill(0);
|
|
48
|
+
var H = (u3) => !M.has(u3);
|
|
49
|
+
var F = (u3) => !!u3 && u3 === Math.floor(u3) && u3 > 0 && isFinite(u3);
|
|
50
|
+
var U = (u3) => F(u3) ? u3 <= Math.pow(2, 8) ? Uint8Array : u3 <= Math.pow(2, 16) ? Uint16Array : u3 <= Math.pow(2, 32) ? Uint32Array : u3 <= Number.MAX_SAFE_INTEGER ? O : null : null;
|
|
51
|
+
var O = class extends Array {
|
|
52
|
+
constructor(e) {
|
|
53
|
+
super(e), this.fill(0);
|
|
78
54
|
}
|
|
79
55
|
};
|
|
80
|
-
var
|
|
56
|
+
var R = class u {
|
|
81
57
|
heap;
|
|
82
58
|
length;
|
|
83
59
|
static #o = false;
|
|
84
|
-
static create(
|
|
85
|
-
let
|
|
86
|
-
if (!
|
|
87
|
-
|
|
88
|
-
let i = new
|
|
89
|
-
return
|
|
60
|
+
static create(e) {
|
|
61
|
+
let t = U(e);
|
|
62
|
+
if (!t) return [];
|
|
63
|
+
u.#o = true;
|
|
64
|
+
let i = new u(e, t);
|
|
65
|
+
return u.#o = false, i;
|
|
90
66
|
}
|
|
91
|
-
constructor(
|
|
92
|
-
if (!
|
|
93
|
-
this.heap = new e
|
|
67
|
+
constructor(e, t) {
|
|
68
|
+
if (!u.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
69
|
+
this.heap = new t(e), this.length = 0;
|
|
94
70
|
}
|
|
95
|
-
push(
|
|
96
|
-
this.heap[this.length++] =
|
|
71
|
+
push(e) {
|
|
72
|
+
this.heap[this.length++] = e;
|
|
97
73
|
}
|
|
98
74
|
pop() {
|
|
99
75
|
return this.heap[--this.length];
|
|
100
76
|
}
|
|
101
77
|
};
|
|
102
|
-
var L = class
|
|
78
|
+
var L = class u2 {
|
|
103
79
|
#o;
|
|
104
|
-
#
|
|
80
|
+
#u;
|
|
105
81
|
#w;
|
|
106
|
-
#
|
|
82
|
+
#D;
|
|
107
83
|
#S;
|
|
108
|
-
#
|
|
109
|
-
#
|
|
84
|
+
#M;
|
|
85
|
+
#U;
|
|
110
86
|
#m;
|
|
111
87
|
get perf() {
|
|
112
88
|
return this.#m;
|
|
@@ -127,429 +103,484 @@ var L = class c2 {
|
|
|
127
103
|
allowStaleOnFetchRejection;
|
|
128
104
|
ignoreFetchAbort;
|
|
129
105
|
#n;
|
|
130
|
-
#
|
|
106
|
+
#b;
|
|
131
107
|
#s;
|
|
132
108
|
#i;
|
|
133
109
|
#t;
|
|
134
110
|
#a;
|
|
135
|
-
#
|
|
111
|
+
#c;
|
|
136
112
|
#l;
|
|
137
113
|
#h;
|
|
138
|
-
#b;
|
|
139
|
-
#r;
|
|
140
114
|
#y;
|
|
141
|
-
#
|
|
115
|
+
#r;
|
|
116
|
+
#_;
|
|
117
|
+
#F;
|
|
142
118
|
#d;
|
|
143
119
|
#g;
|
|
144
120
|
#T;
|
|
145
|
-
#
|
|
121
|
+
#W;
|
|
146
122
|
#f;
|
|
147
|
-
#
|
|
148
|
-
static unsafeExposeInternals(
|
|
149
|
-
return { starts:
|
|
150
|
-
return
|
|
123
|
+
#j;
|
|
124
|
+
static unsafeExposeInternals(e) {
|
|
125
|
+
return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#a, prev: e.#c, get head() {
|
|
126
|
+
return e.#l;
|
|
151
127
|
}, get tail() {
|
|
152
|
-
return
|
|
153
|
-
}, free:
|
|
128
|
+
return e.#h;
|
|
129
|
+
}, free: e.#y, isBackgroundFetch: (t) => e.#e(t), backgroundFetch: (t, i, s, n7) => e.#P(t, i, s, n7), moveToTail: (t) => e.#L(t), indexes: (t) => e.#A(t), rindexes: (t) => e.#z(t), isStale: (t) => e.#p(t) };
|
|
154
130
|
}
|
|
155
131
|
get max() {
|
|
156
132
|
return this.#o;
|
|
157
133
|
}
|
|
158
134
|
get maxSize() {
|
|
159
|
-
return this.#
|
|
135
|
+
return this.#u;
|
|
160
136
|
}
|
|
161
137
|
get calculatedSize() {
|
|
162
|
-
return this.#
|
|
138
|
+
return this.#b;
|
|
163
139
|
}
|
|
164
140
|
get size() {
|
|
165
141
|
return this.#n;
|
|
166
142
|
}
|
|
167
143
|
get fetchMethod() {
|
|
168
|
-
return this.#
|
|
144
|
+
return this.#M;
|
|
169
145
|
}
|
|
170
146
|
get memoMethod() {
|
|
171
|
-
return this.#
|
|
147
|
+
return this.#U;
|
|
172
148
|
}
|
|
173
149
|
get dispose() {
|
|
174
150
|
return this.#w;
|
|
175
151
|
}
|
|
176
152
|
get onInsert() {
|
|
177
|
-
return this.#
|
|
153
|
+
return this.#D;
|
|
178
154
|
}
|
|
179
155
|
get disposeAfter() {
|
|
180
156
|
return this.#S;
|
|
181
157
|
}
|
|
182
|
-
constructor(
|
|
183
|
-
let { max:
|
|
184
|
-
if (
|
|
185
|
-
if (this.#m =
|
|
186
|
-
let
|
|
187
|
-
if (!
|
|
188
|
-
if (this.#o =
|
|
189
|
-
if (!this.#
|
|
158
|
+
constructor(e) {
|
|
159
|
+
let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n7, updateAgeOnGet: o, updateAgeOnHas: r, allowStale: h, dispose: l, onInsert: c, disposeAfter: f, noDisposeOnSet: g, noUpdateTTL: p, maxSize: T2 = 0, maxEntrySize: w = 0, sizeCalculation: y, fetchMethod: a, memoMethod: m, noDeleteOnFetchRejection: _2, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A2, ignoreFetchAbort: z, perf: x2 } = e;
|
|
160
|
+
if (x2 !== void 0 && typeof x2?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
161
|
+
if (this.#m = x2 ?? G, t !== 0 && !F(t)) throw new TypeError("max option must be a nonnegative integer");
|
|
162
|
+
let v2 = t ? U(t) : Array;
|
|
163
|
+
if (!v2) throw new Error("invalid max value: " + t);
|
|
164
|
+
if (this.#o = t, this.#u = T2, this.maxEntrySize = w || this.#u, this.sizeCalculation = y, this.sizeCalculation) {
|
|
165
|
+
if (!this.#u && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
190
166
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
191
167
|
}
|
|
192
|
-
if (
|
|
193
|
-
if (this.#
|
|
194
|
-
if (this.#
|
|
195
|
-
if (this.#
|
|
196
|
-
if (!
|
|
197
|
-
this.#
|
|
168
|
+
if (m !== void 0 && typeof m != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
169
|
+
if (this.#U = m, a !== void 0 && typeof a != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
170
|
+
if (this.#M = a, this.#W = !!a, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: t }).fill(void 0), this.#t = Array.from({ length: t }).fill(void 0), this.#a = new v2(t), this.#c = new v2(t), this.#l = 0, this.#h = 0, this.#y = R.create(t), this.#n = 0, this.#b = 0, typeof l == "function" && (this.#w = l), typeof c == "function" && (this.#D = c), typeof f == "function" ? (this.#S = f, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#w, this.#j = !!this.#D, this.#f = !!this.#S, this.noDisposeOnSet = !!g, this.noUpdateTTL = !!p, this.noDeleteOnFetchRejection = !!_2, this.allowStaleOnFetchRejection = !!d, this.allowStaleOnFetchAbort = !!A2, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
171
|
+
if (this.#u !== 0 && !F(this.#u)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
172
|
+
if (!F(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
173
|
+
this.#X();
|
|
198
174
|
}
|
|
199
|
-
if (this.allowStale = !!
|
|
200
|
-
if (!
|
|
201
|
-
this.#
|
|
175
|
+
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!r, this.ttlResolution = F(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n7, this.ttl = i || 0, this.ttl) {
|
|
176
|
+
if (!F(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
177
|
+
this.#H();
|
|
202
178
|
}
|
|
203
|
-
if (this.#o === 0 && this.ttl === 0 && this.#
|
|
204
|
-
if (!this.ttlAutopurge && !this.#o && !this.#
|
|
179
|
+
if (this.#o === 0 && this.ttl === 0 && this.#u === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
180
|
+
if (!this.ttlAutopurge && !this.#o && !this.#u) {
|
|
205
181
|
let E = "LRU_CACHE_UNBOUNDED";
|
|
206
|
-
|
|
182
|
+
H(E) && (M.add(E), P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, u2));
|
|
207
183
|
}
|
|
208
184
|
}
|
|
209
|
-
getRemainingTTL(
|
|
210
|
-
return this.#s.has(
|
|
211
|
-
}
|
|
212
|
-
#
|
|
213
|
-
let
|
|
214
|
-
this.#d =
|
|
215
|
-
let i = this.ttlAutopurge ?
|
|
216
|
-
this.#g = i, this.#N = (
|
|
217
|
-
|
|
218
|
-
}, this.#
|
|
219
|
-
|
|
185
|
+
getRemainingTTL(e) {
|
|
186
|
+
return this.#s.has(e) ? 1 / 0 : 0;
|
|
187
|
+
}
|
|
188
|
+
#H() {
|
|
189
|
+
let e = new O(this.#o), t = new O(this.#o);
|
|
190
|
+
this.#d = e, this.#F = t;
|
|
191
|
+
let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
192
|
+
this.#g = i, this.#N = (r, h, l = this.#m.now()) => {
|
|
193
|
+
t[r] = h !== 0 ? l : 0, e[r] = h, s(r, h);
|
|
194
|
+
}, this.#x = (r) => {
|
|
195
|
+
t[r] = e[r] !== 0 ? this.#m.now() : 0, s(r, e[r]);
|
|
220
196
|
};
|
|
221
|
-
let s = this.ttlAutopurge ? (
|
|
222
|
-
if (i?.[
|
|
223
|
-
let
|
|
224
|
-
this.#p(
|
|
225
|
-
},
|
|
226
|
-
|
|
197
|
+
let s = this.ttlAutopurge ? (r, h) => {
|
|
198
|
+
if (i?.[r] && (clearTimeout(i[r]), i[r] = void 0), h && h !== 0 && i) {
|
|
199
|
+
let l = setTimeout(() => {
|
|
200
|
+
this.#p(r) && this.#v(this.#i[r], "expire");
|
|
201
|
+
}, h + 1);
|
|
202
|
+
l.unref && l.unref(), i[r] = l;
|
|
227
203
|
}
|
|
228
204
|
} : () => {
|
|
229
205
|
};
|
|
230
|
-
this.#
|
|
231
|
-
if (
|
|
232
|
-
let
|
|
233
|
-
if (!
|
|
234
|
-
|
|
235
|
-
let f =
|
|
236
|
-
|
|
206
|
+
this.#E = (r, h) => {
|
|
207
|
+
if (e[h]) {
|
|
208
|
+
let l = e[h], c = t[h];
|
|
209
|
+
if (!l || !c) return;
|
|
210
|
+
r.ttl = l, r.start = c, r.now = n7 || o();
|
|
211
|
+
let f = r.now - c;
|
|
212
|
+
r.remainingTTL = l - f;
|
|
237
213
|
}
|
|
238
214
|
};
|
|
239
215
|
let n7 = 0, o = () => {
|
|
240
|
-
let
|
|
216
|
+
let r = this.#m.now();
|
|
241
217
|
if (this.ttlResolution > 0) {
|
|
242
|
-
n7 =
|
|
243
|
-
let
|
|
244
|
-
|
|
218
|
+
n7 = r;
|
|
219
|
+
let h = setTimeout(() => n7 = 0, this.ttlResolution);
|
|
220
|
+
h.unref && h.unref();
|
|
245
221
|
}
|
|
246
|
-
return
|
|
222
|
+
return r;
|
|
247
223
|
};
|
|
248
|
-
this.getRemainingTTL = (
|
|
249
|
-
let
|
|
250
|
-
if (
|
|
251
|
-
let
|
|
252
|
-
if (!
|
|
253
|
-
let f = (n7 || o()) -
|
|
254
|
-
return
|
|
255
|
-
}, this.#p = (
|
|
256
|
-
let
|
|
257
|
-
return !!
|
|
224
|
+
this.getRemainingTTL = (r) => {
|
|
225
|
+
let h = this.#s.get(r);
|
|
226
|
+
if (h === void 0) return 0;
|
|
227
|
+
let l = e[h], c = t[h];
|
|
228
|
+
if (!l || !c) return 1 / 0;
|
|
229
|
+
let f = (n7 || o()) - c;
|
|
230
|
+
return l - f;
|
|
231
|
+
}, this.#p = (r) => {
|
|
232
|
+
let h = t[r], l = e[r];
|
|
233
|
+
return !!l && !!h && (n7 || o()) - h > l;
|
|
258
234
|
};
|
|
259
235
|
}
|
|
260
|
-
#
|
|
236
|
+
#x = () => {
|
|
261
237
|
};
|
|
262
|
-
#
|
|
238
|
+
#E = () => {
|
|
263
239
|
};
|
|
264
240
|
#N = () => {
|
|
265
241
|
};
|
|
266
242
|
#p = () => false;
|
|
267
|
-
#
|
|
268
|
-
let
|
|
269
|
-
this.#
|
|
270
|
-
this.#
|
|
271
|
-
}, this.#
|
|
243
|
+
#X() {
|
|
244
|
+
let e = new O(this.#o);
|
|
245
|
+
this.#b = 0, this.#_ = e, this.#R = (t) => {
|
|
246
|
+
this.#b -= e[t], e[t] = 0;
|
|
247
|
+
}, this.#k = (t, i, s, n7) => {
|
|
272
248
|
if (this.#e(i)) return 0;
|
|
273
|
-
if (!
|
|
249
|
+
if (!F(s)) if (n7) {
|
|
274
250
|
if (typeof n7 != "function") throw new TypeError("sizeCalculation must be a function");
|
|
275
|
-
if (s = n7(i,
|
|
251
|
+
if (s = n7(i, t), !F(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
276
252
|
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
277
253
|
return s;
|
|
278
|
-
}, this.#
|
|
279
|
-
if (t
|
|
280
|
-
let n7 = this.#
|
|
281
|
-
for (; this.#
|
|
254
|
+
}, this.#I = (t, i, s) => {
|
|
255
|
+
if (e[t] = i, this.#u) {
|
|
256
|
+
let n7 = this.#u - e[t];
|
|
257
|
+
for (; this.#b > n7; ) this.#G(true);
|
|
282
258
|
}
|
|
283
|
-
this.#
|
|
259
|
+
this.#b += e[t], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
|
|
284
260
|
};
|
|
285
261
|
}
|
|
286
|
-
#
|
|
262
|
+
#R = (e) => {
|
|
287
263
|
};
|
|
288
|
-
#
|
|
264
|
+
#I = (e, t, i) => {
|
|
289
265
|
};
|
|
290
|
-
#
|
|
266
|
+
#k = (e, t, i, s) => {
|
|
291
267
|
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
292
268
|
return 0;
|
|
293
269
|
};
|
|
294
|
-
*#
|
|
295
|
-
if (this.#n) for (let
|
|
270
|
+
*#A({ allowStale: e = this.allowStale } = {}) {
|
|
271
|
+
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#l); ) t = this.#c[t];
|
|
296
272
|
}
|
|
297
|
-
*#
|
|
298
|
-
if (this.#n) for (let
|
|
273
|
+
*#z({ allowStale: e = this.allowStale } = {}) {
|
|
274
|
+
if (this.#n) for (let t = this.#l; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#h); ) t = this.#a[t];
|
|
299
275
|
}
|
|
300
|
-
#
|
|
301
|
-
return
|
|
276
|
+
#V(e) {
|
|
277
|
+
return e !== void 0 && this.#s.get(this.#i[e]) === e;
|
|
302
278
|
}
|
|
303
279
|
*entries() {
|
|
304
|
-
for (let
|
|
280
|
+
for (let e of this.#A()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
|
|
305
281
|
}
|
|
306
282
|
*rentries() {
|
|
307
|
-
for (let
|
|
283
|
+
for (let e of this.#z()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
|
|
308
284
|
}
|
|
309
285
|
*keys() {
|
|
310
|
-
for (let
|
|
311
|
-
let
|
|
312
|
-
|
|
286
|
+
for (let e of this.#A()) {
|
|
287
|
+
let t = this.#i[e];
|
|
288
|
+
t !== void 0 && !this.#e(this.#t[e]) && (yield t);
|
|
313
289
|
}
|
|
314
290
|
}
|
|
315
291
|
*rkeys() {
|
|
316
|
-
for (let
|
|
317
|
-
let
|
|
318
|
-
|
|
292
|
+
for (let e of this.#z()) {
|
|
293
|
+
let t = this.#i[e];
|
|
294
|
+
t !== void 0 && !this.#e(this.#t[e]) && (yield t);
|
|
319
295
|
}
|
|
320
296
|
}
|
|
321
297
|
*values() {
|
|
322
|
-
for (let
|
|
298
|
+
for (let e of this.#A()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
|
|
323
299
|
}
|
|
324
300
|
*rvalues() {
|
|
325
|
-
for (let
|
|
301
|
+
for (let e of this.#z()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
|
|
326
302
|
}
|
|
327
303
|
[Symbol.iterator]() {
|
|
328
304
|
return this.entries();
|
|
329
305
|
}
|
|
330
306
|
[Symbol.toStringTag] = "LRUCache";
|
|
331
|
-
find(
|
|
332
|
-
for (let i of this.#
|
|
307
|
+
find(e, t = {}) {
|
|
308
|
+
for (let i of this.#A()) {
|
|
333
309
|
let s = this.#t[i], n7 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
334
|
-
if (n7 !== void 0 &&
|
|
310
|
+
if (n7 !== void 0 && e(n7, this.#i[i], this)) return this.#C(this.#i[i], t);
|
|
335
311
|
}
|
|
336
312
|
}
|
|
337
|
-
forEach(
|
|
338
|
-
for (let i of this.#
|
|
313
|
+
forEach(e, t = this) {
|
|
314
|
+
for (let i of this.#A()) {
|
|
339
315
|
let s = this.#t[i], n7 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
340
|
-
n7 !== void 0 &&
|
|
316
|
+
n7 !== void 0 && e.call(t, n7, this.#i[i], this);
|
|
341
317
|
}
|
|
342
318
|
}
|
|
343
|
-
rforEach(
|
|
344
|
-
for (let i of this.#
|
|
319
|
+
rforEach(e, t = this) {
|
|
320
|
+
for (let i of this.#z()) {
|
|
345
321
|
let s = this.#t[i], n7 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
346
|
-
n7 !== void 0 &&
|
|
322
|
+
n7 !== void 0 && e.call(t, n7, this.#i[i], this);
|
|
347
323
|
}
|
|
348
324
|
}
|
|
349
325
|
purgeStale() {
|
|
350
|
-
let
|
|
351
|
-
for (let
|
|
352
|
-
return
|
|
326
|
+
let e = false;
|
|
327
|
+
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#v(this.#i[t], "expire"), e = true);
|
|
328
|
+
return e;
|
|
353
329
|
}
|
|
354
|
-
info(
|
|
355
|
-
let
|
|
356
|
-
if (
|
|
357
|
-
let i = this.#t[
|
|
330
|
+
info(e) {
|
|
331
|
+
let t = this.#s.get(e);
|
|
332
|
+
if (t === void 0) return;
|
|
333
|
+
let i = this.#t[t], s = this.#e(i) ? i.__staleWhileFetching : i;
|
|
358
334
|
if (s === void 0) return;
|
|
359
335
|
let n7 = { value: s };
|
|
360
|
-
if (this.#d && this.#
|
|
361
|
-
let o = this.#d[
|
|
362
|
-
if (o &&
|
|
363
|
-
let
|
|
364
|
-
n7.ttl =
|
|
336
|
+
if (this.#d && this.#F) {
|
|
337
|
+
let o = this.#d[t], r = this.#F[t];
|
|
338
|
+
if (o && r) {
|
|
339
|
+
let h = o - (this.#m.now() - r);
|
|
340
|
+
n7.ttl = h, n7.start = Date.now();
|
|
365
341
|
}
|
|
366
342
|
}
|
|
367
|
-
return this.#
|
|
343
|
+
return this.#_ && (n7.size = this.#_[t]), n7;
|
|
368
344
|
}
|
|
369
345
|
dump() {
|
|
370
|
-
let
|
|
371
|
-
for (let
|
|
372
|
-
let i = this.#i[
|
|
346
|
+
let e = [];
|
|
347
|
+
for (let t of this.#A({ allowStale: true })) {
|
|
348
|
+
let i = this.#i[t], s = this.#t[t], n7 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
373
349
|
if (n7 === void 0 || i === void 0) continue;
|
|
374
350
|
let o = { value: n7 };
|
|
375
|
-
if (this.#d && this.#
|
|
376
|
-
o.ttl = this.#d[
|
|
377
|
-
let
|
|
378
|
-
o.start = Math.floor(Date.now() -
|
|
351
|
+
if (this.#d && this.#F) {
|
|
352
|
+
o.ttl = this.#d[t];
|
|
353
|
+
let r = this.#m.now() - this.#F[t];
|
|
354
|
+
o.start = Math.floor(Date.now() - r);
|
|
379
355
|
}
|
|
380
|
-
this.#
|
|
356
|
+
this.#_ && (o.size = this.#_[t]), e.unshift([i, o]);
|
|
381
357
|
}
|
|
382
|
-
return
|
|
358
|
+
return e;
|
|
383
359
|
}
|
|
384
|
-
load(
|
|
360
|
+
load(e) {
|
|
385
361
|
this.clear();
|
|
386
|
-
for (let [
|
|
362
|
+
for (let [t, i] of e) {
|
|
387
363
|
if (i.start) {
|
|
388
364
|
let s = Date.now() - i.start;
|
|
389
365
|
i.start = this.#m.now() - s;
|
|
390
366
|
}
|
|
391
|
-
this
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
set(
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
367
|
+
this.#O(t, i.value, i);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
set(e, t, i = {}) {
|
|
371
|
+
let { status: s = S.hasSubscribers ? {} : void 0 } = i;
|
|
372
|
+
i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t));
|
|
373
|
+
let n7 = this.#O(e, t, i);
|
|
374
|
+
return s && S.hasSubscribers && S.publish(s), n7;
|
|
375
|
+
}
|
|
376
|
+
#O(e, t, i = {}) {
|
|
377
|
+
let { ttl: s = this.ttl, start: n7, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: r = this.sizeCalculation, status: h } = i;
|
|
378
|
+
if (t === void 0) return h && (h.set = "deleted"), this.delete(e), this;
|
|
379
|
+
let { noUpdateTTL: l = this.noUpdateTTL } = i;
|
|
380
|
+
h && !this.#e(t) && (h.value = t);
|
|
381
|
+
let c = this.#k(e, t, i.size || 0, r, h);
|
|
382
|
+
if (this.maxEntrySize && c > this.maxEntrySize) return this.#v(e, "set"), h && (h.set = "miss", h.maxEntrySizeExceeded = true), this;
|
|
383
|
+
let f = this.#n === 0 ? void 0 : this.#s.get(e);
|
|
384
|
+
if (f === void 0) f = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(false) : this.#n, this.#i[f] = e, this.#t[f] = t, this.#s.set(e, f), this.#a[this.#h] = f, this.#c[f] = this.#h, this.#h = f, this.#n++, this.#I(f, c, h), h && (h.set = "add"), l = false, this.#j && this.#D?.(t, e, "add");
|
|
400
385
|
else {
|
|
401
|
-
this.#
|
|
402
|
-
let
|
|
403
|
-
if (
|
|
404
|
-
if (this.#
|
|
405
|
-
|
|
406
|
-
let { __staleWhileFetching:
|
|
407
|
-
|
|
408
|
-
} else o || (this.#T && this.#w?.(
|
|
409
|
-
if (this.#
|
|
410
|
-
|
|
411
|
-
let
|
|
412
|
-
|
|
386
|
+
this.#L(f);
|
|
387
|
+
let g = this.#t[f];
|
|
388
|
+
if (t !== g) {
|
|
389
|
+
if (this.#W && this.#e(g)) {
|
|
390
|
+
g.__abortController.abort(new Error("replaced"));
|
|
391
|
+
let { __staleWhileFetching: p } = g;
|
|
392
|
+
p !== void 0 && !o && (this.#T && this.#w?.(p, e, "set"), this.#f && this.#r?.push([p, e, "set"]));
|
|
393
|
+
} else o || (this.#T && this.#w?.(g, e, "set"), this.#f && this.#r?.push([g, e, "set"]));
|
|
394
|
+
if (this.#R(f), this.#I(f, c, h), this.#t[f] = t, h) {
|
|
395
|
+
h.set = "replace";
|
|
396
|
+
let p = g && this.#e(g) ? g.__staleWhileFetching : g;
|
|
397
|
+
p !== void 0 && (h.oldValue = p);
|
|
413
398
|
}
|
|
414
|
-
} else
|
|
415
|
-
this.#
|
|
399
|
+
} else h && (h.set = "update");
|
|
400
|
+
this.#j && this.onInsert?.(t, e, t === g ? "update" : "replace");
|
|
416
401
|
}
|
|
417
|
-
if (s !== 0 && !this.#d && this.#
|
|
418
|
-
let
|
|
419
|
-
for (;
|
|
402
|
+
if (s !== 0 && !this.#d && this.#H(), this.#d && (l || this.#N(f, s, n7), h && this.#E(h, f)), !o && this.#f && this.#r) {
|
|
403
|
+
let g = this.#r, p;
|
|
404
|
+
for (; p = g?.shift(); ) this.#S?.(...p);
|
|
420
405
|
}
|
|
421
406
|
return this;
|
|
422
407
|
}
|
|
423
408
|
pop() {
|
|
424
409
|
try {
|
|
425
410
|
for (; this.#n; ) {
|
|
426
|
-
let
|
|
427
|
-
if (this.#
|
|
428
|
-
if (
|
|
429
|
-
} else if (
|
|
411
|
+
let e = this.#t[this.#l];
|
|
412
|
+
if (this.#G(true), this.#e(e)) {
|
|
413
|
+
if (e.__staleWhileFetching) return e.__staleWhileFetching;
|
|
414
|
+
} else if (e !== void 0) return e;
|
|
430
415
|
}
|
|
431
416
|
} finally {
|
|
432
417
|
if (this.#f && this.#r) {
|
|
433
|
-
let
|
|
434
|
-
for (;
|
|
418
|
+
let e = this.#r, t;
|
|
419
|
+
for (; t = e?.shift(); ) this.#S?.(...t);
|
|
435
420
|
}
|
|
436
421
|
}
|
|
437
422
|
}
|
|
438
|
-
#
|
|
439
|
-
let
|
|
440
|
-
return this.#
|
|
423
|
+
#G(e) {
|
|
424
|
+
let t = this.#l, i = this.#i[t], s = this.#t[t];
|
|
425
|
+
return this.#W && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#w?.(s, i, "evict"), this.#f && this.#r?.push([s, i, "evict"])), this.#R(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.#l = this.#h = 0, this.#y.length = 0) : this.#l = this.#a[t], this.#s.delete(i), this.#n--, t;
|
|
441
426
|
}
|
|
442
|
-
has(
|
|
443
|
-
let {
|
|
427
|
+
has(e, t = {}) {
|
|
428
|
+
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
429
|
+
t.status = i, i && (i.op = "has", i.key = e);
|
|
430
|
+
let s = this.#Y(e, t);
|
|
431
|
+
return S.hasSubscribers && S.publish(i), s;
|
|
432
|
+
}
|
|
433
|
+
#Y(e, t = {}) {
|
|
434
|
+
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = t, n7 = this.#s.get(e);
|
|
444
435
|
if (n7 !== void 0) {
|
|
445
436
|
let o = this.#t[n7];
|
|
446
437
|
if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
|
|
447
|
-
if (this.#p(n7)) s && (s.has = "stale", this.#
|
|
448
|
-
else return i && this.#
|
|
438
|
+
if (this.#p(n7)) s && (s.has = "stale", this.#E(s, n7));
|
|
439
|
+
else return i && this.#x(n7), s && (s.has = "hit", this.#E(s, n7)), true;
|
|
449
440
|
} else s && (s.has = "miss");
|
|
450
441
|
return false;
|
|
451
442
|
}
|
|
452
|
-
peek(
|
|
453
|
-
let {
|
|
454
|
-
|
|
455
|
-
let
|
|
456
|
-
return
|
|
443
|
+
peek(e, t = {}) {
|
|
444
|
+
let { status: i = D() ? {} : void 0 } = t;
|
|
445
|
+
i && (i.op = "peek", i.key = e), t.status = i;
|
|
446
|
+
let s = this.#J(e, t);
|
|
447
|
+
return S.hasSubscribers && S.publish(i), s;
|
|
448
|
+
}
|
|
449
|
+
#J(e, t) {
|
|
450
|
+
let { status: i, allowStale: s = this.allowStale } = t, n7 = this.#s.get(e);
|
|
451
|
+
if (n7 === void 0 || !s && this.#p(n7)) {
|
|
452
|
+
i && (i.peek = n7 === void 0 ? "miss" : "stale");
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
let o = this.#t[n7], r = this.#e(o) ? o.__staleWhileFetching : o;
|
|
456
|
+
return i && (r !== void 0 ? (i.peek = "hit", i.value = r) : i.peek = "miss"), r;
|
|
457
457
|
}
|
|
458
|
-
#
|
|
459
|
-
let n7 =
|
|
458
|
+
#P(e, t, i, s) {
|
|
459
|
+
let n7 = t === void 0 ? void 0 : this.#t[t];
|
|
460
460
|
if (this.#e(n7)) return n7;
|
|
461
|
-
let o = new
|
|
462
|
-
|
|
463
|
-
let
|
|
464
|
-
let { aborted:
|
|
465
|
-
if (i.status && (
|
|
466
|
-
let
|
|
467
|
-
return (
|
|
468
|
-
},
|
|
469
|
-
let { aborted:
|
|
470
|
-
if (this.#t[
|
|
471
|
-
if (
|
|
472
|
-
},
|
|
473
|
-
let
|
|
474
|
-
|
|
475
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (
|
|
461
|
+
let o = new AbortController(), { signal: r } = i;
|
|
462
|
+
r?.addEventListener("abort", () => o.abort(r.reason), { signal: o.signal });
|
|
463
|
+
let h = { signal: o.signal, options: i, context: s }, l = (w, y = false) => {
|
|
464
|
+
let { aborted: a } = o.signal, m = i.ignoreFetchAbort && w !== void 0, _2 = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && w !== void 0);
|
|
465
|
+
if (i.status && (a && !y ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, m && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), a && !m && !y) return f(o.signal.reason, _2);
|
|
466
|
+
let b = p, d = this.#t[t];
|
|
467
|
+
return (d === p || d === void 0 && m && y) && (w === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[t] = b.__staleWhileFetching : this.#v(e, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#O(e, w, h.options))), w;
|
|
468
|
+
}, c = (w) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = w), f(w, false)), f = (w, y) => {
|
|
469
|
+
let { aborted: a } = o.signal, m = a && i.allowStaleOnFetchAbort, _2 = m || i.allowStaleOnFetchRejection, b = _2 || i.noDeleteOnFetchRejection, d = p;
|
|
470
|
+
if (this.#t[t] === p && (!b || !y && d.__staleWhileFetching === void 0 ? this.#v(e, "fetch") : m || (this.#t[t] = d.__staleWhileFetching)), _2) return i.status && d.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), d.__staleWhileFetching;
|
|
471
|
+
if (d.__returned === d) throw w;
|
|
472
|
+
}, g = (w, y) => {
|
|
473
|
+
let a = this.#M?.(e, n7, h);
|
|
474
|
+
a && a instanceof Promise && a.then((m) => w(m === void 0 ? void 0 : m), y), o.signal.addEventListener("abort", () => {
|
|
475
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (w(void 0), i.allowStaleOnFetchAbort && (w = (m) => l(m, true)));
|
|
476
476
|
});
|
|
477
477
|
};
|
|
478
478
|
i.status && (i.status.fetchDispatched = true);
|
|
479
|
-
let
|
|
480
|
-
return
|
|
481
|
-
}
|
|
482
|
-
#e(
|
|
483
|
-
if (!this.#
|
|
484
|
-
let
|
|
485
|
-
return !!
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
let
|
|
489
|
-
|
|
490
|
-
let
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
479
|
+
let p = new Promise(g).then(l, c), T2 = Object.assign(p, { __abortController: o, __staleWhileFetching: n7, __returned: void 0 });
|
|
480
|
+
return t === void 0 ? (this.#O(e, T2, { ...h.options, status: void 0 }), t = this.#s.get(e)) : this.#t[t] = T2, T2;
|
|
481
|
+
}
|
|
482
|
+
#e(e) {
|
|
483
|
+
if (!this.#W) return false;
|
|
484
|
+
let t = e;
|
|
485
|
+
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
486
|
+
}
|
|
487
|
+
fetch(e, t = {}) {
|
|
488
|
+
let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
|
|
489
|
+
t.status = s, s && t.context && (s.context = t.context);
|
|
490
|
+
let n7 = this.#B(e, t);
|
|
491
|
+
return s && D() && i && (s.trace = true, W.tracePromise(() => n7, s).catch(() => {
|
|
492
|
+
})), n7;
|
|
493
|
+
}
|
|
494
|
+
async #B(e, t = {}) {
|
|
495
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: c = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: g = this.allowStaleOnFetchRejection, ignoreFetchAbort: p = this.ignoreFetchAbort, allowStaleOnFetchAbort: T2 = this.allowStaleOnFetchAbort, context: w, forceRefresh: y = false, status: a, signal: m } = t;
|
|
496
|
+
if (a && (a.op = "fetch", a.key = e, y && (a.forceRefresh = true)), !this.#W) return a && (a.fetch = "get"), this.#C(e, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n7, status: a });
|
|
497
|
+
let _2 = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n7, ttl: o, noDisposeOnSet: r, size: h, sizeCalculation: l, noUpdateTTL: c, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: g, allowStaleOnFetchAbort: T2, ignoreFetchAbort: p, status: a, signal: m }, b = this.#s.get(e);
|
|
498
|
+
if (b === void 0) {
|
|
499
|
+
a && (a.fetch = "miss");
|
|
500
|
+
let d = this.#P(e, b, _2, w);
|
|
501
|
+
return d.__returned = d;
|
|
495
502
|
} else {
|
|
496
|
-
let
|
|
497
|
-
if (this.#e(
|
|
498
|
-
let E = i &&
|
|
499
|
-
return
|
|
503
|
+
let d = this.#t[b];
|
|
504
|
+
if (this.#e(d)) {
|
|
505
|
+
let E = i && d.__staleWhileFetching !== void 0;
|
|
506
|
+
return a && (a.fetch = "inflight", E && (a.returnedStale = true)), E ? d.__staleWhileFetching : d.__returned = d;
|
|
500
507
|
}
|
|
501
|
-
let
|
|
502
|
-
if (!
|
|
503
|
-
let
|
|
504
|
-
return
|
|
508
|
+
let A2 = this.#p(b);
|
|
509
|
+
if (!y && !A2) return a && (a.fetch = "hit"), this.#L(b), s && this.#x(b), a && this.#E(a, b), d;
|
|
510
|
+
let z = this.#P(e, b, _2, w), v2 = z.__staleWhileFetching !== void 0 && i;
|
|
511
|
+
return a && (a.fetch = A2 ? "stale" : "refresh", v2 && A2 && (a.returnedStale = true)), v2 ? z.__staleWhileFetching : z.__returned = z;
|
|
505
512
|
}
|
|
506
513
|
}
|
|
507
|
-
|
|
508
|
-
let i =
|
|
514
|
+
forceFetch(e, t = {}) {
|
|
515
|
+
let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
|
|
516
|
+
t.status = s, s && t.context && (s.context = t.context);
|
|
517
|
+
let n7 = this.#K(e, t);
|
|
518
|
+
return s && D() && i && (s.trace = true, W.tracePromise(() => n7, s).catch(() => {
|
|
519
|
+
})), n7;
|
|
520
|
+
}
|
|
521
|
+
async #K(e, t = {}) {
|
|
522
|
+
let i = await this.#B(e, t);
|
|
509
523
|
if (i === void 0) throw new Error("fetch() returned undefined");
|
|
510
524
|
return i;
|
|
511
525
|
}
|
|
512
|
-
memo(
|
|
513
|
-
let i =
|
|
514
|
-
|
|
515
|
-
let
|
|
516
|
-
|
|
517
|
-
let r = i(t, h, { options: o, context: s });
|
|
518
|
-
return this.set(t, r, o), r;
|
|
526
|
+
memo(e, t = {}) {
|
|
527
|
+
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
528
|
+
t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context));
|
|
529
|
+
let s = this.#Q(e, t);
|
|
530
|
+
return i && (i.value = s), S.hasSubscribers && S.publish(i), s;
|
|
519
531
|
}
|
|
520
|
-
|
|
521
|
-
let
|
|
522
|
-
if (
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
532
|
+
#Q(e, t = {}) {
|
|
533
|
+
let i = this.#U;
|
|
534
|
+
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
535
|
+
let { context: s, status: n7, forceRefresh: o, ...r } = t;
|
|
536
|
+
n7 && o && (n7.forceRefresh = true);
|
|
537
|
+
let h = this.#C(e, r), l = o || h === void 0;
|
|
538
|
+
if (n7 && (n7.memo = l ? "miss" : "hit", l || (n7.value = h)), !l) return h;
|
|
539
|
+
let c = i(e, h, { options: r, context: s });
|
|
540
|
+
return n7 && (n7.value = c), this.#O(e, c, r), c;
|
|
541
|
+
}
|
|
542
|
+
get(e, t = {}) {
|
|
543
|
+
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
544
|
+
t.status = i, i && (i.op = "get", i.key = e);
|
|
545
|
+
let s = this.#C(e, t);
|
|
546
|
+
return i && (s !== void 0 && (i.value = s), S.hasSubscribers && S.publish(i)), s;
|
|
547
|
+
}
|
|
548
|
+
#C(e, t = {}) {
|
|
549
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n7 = this.noDeleteOnStaleGet, status: o } = t, r = this.#s.get(e);
|
|
550
|
+
if (r === void 0) {
|
|
551
|
+
o && (o.get = "miss");
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
let h = this.#t[r], l = this.#e(h);
|
|
555
|
+
return o && this.#E(o, r), this.#p(r) ? l ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = true), h.__staleWhileFetching) : void 0) : (n7 || this.#v(e, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = true), h) : void 0) : (o && (o.get = l ? "fetching" : "hit"), this.#L(r), s && this.#x(r), l ? h.__staleWhileFetching : h);
|
|
526
556
|
}
|
|
527
|
-
|
|
528
|
-
this.#
|
|
557
|
+
#$(e, t) {
|
|
558
|
+
this.#c[t] = e, this.#a[e] = t;
|
|
529
559
|
}
|
|
530
|
-
#
|
|
531
|
-
|
|
560
|
+
#L(e) {
|
|
561
|
+
e !== this.#h && (e === this.#l ? this.#l = this.#a[e] : this.#$(this.#c[e], this.#a[e]), this.#$(this.#h, e), this.#h = e);
|
|
532
562
|
}
|
|
533
|
-
delete(
|
|
534
|
-
return this.#
|
|
563
|
+
delete(e) {
|
|
564
|
+
return this.#v(e, "delete");
|
|
535
565
|
}
|
|
536
|
-
#
|
|
566
|
+
#v(e, t) {
|
|
567
|
+
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e });
|
|
537
568
|
let i = false;
|
|
538
569
|
if (this.#n !== 0) {
|
|
539
|
-
let s = this.#s.get(
|
|
540
|
-
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#
|
|
570
|
+
let s = this.#s.get(e);
|
|
571
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#q(t);
|
|
541
572
|
else {
|
|
542
|
-
this.#
|
|
573
|
+
this.#R(s);
|
|
543
574
|
let n7 = this.#t[s];
|
|
544
|
-
if (this.#e(n7) ? n7.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(n7,
|
|
575
|
+
if (this.#e(n7) ? n7.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(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.#c[s];
|
|
545
576
|
else if (s === this.#l) this.#l = this.#a[s];
|
|
546
577
|
else {
|
|
547
|
-
let o = this.#
|
|
578
|
+
let o = this.#c[s];
|
|
548
579
|
this.#a[o] = this.#a[s];
|
|
549
|
-
let
|
|
550
|
-
this.#
|
|
580
|
+
let r = this.#a[s];
|
|
581
|
+
this.#c[r] = this.#c[s];
|
|
551
582
|
}
|
|
552
|
-
this.#n--, this.#
|
|
583
|
+
this.#n--, this.#y.push(s);
|
|
553
584
|
}
|
|
554
585
|
}
|
|
555
586
|
if (this.#f && this.#r?.length) {
|
|
@@ -559,25 +590,25 @@ var L = class c2 {
|
|
|
559
590
|
return i;
|
|
560
591
|
}
|
|
561
592
|
clear() {
|
|
562
|
-
return this.#
|
|
593
|
+
return this.#q("delete");
|
|
563
594
|
}
|
|
564
|
-
#
|
|
565
|
-
for (let
|
|
566
|
-
let i = this.#t[
|
|
595
|
+
#q(e) {
|
|
596
|
+
for (let t of this.#z({ allowStale: true })) {
|
|
597
|
+
let i = this.#t[t];
|
|
567
598
|
if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
|
|
568
599
|
else {
|
|
569
|
-
let s = this.#i[
|
|
570
|
-
this.#T && this.#w?.(i, s,
|
|
600
|
+
let s = this.#i[t];
|
|
601
|
+
this.#T && this.#w?.(i, s, e), this.#f && this.#r?.push([i, s, e]);
|
|
571
602
|
}
|
|
572
603
|
}
|
|
573
|
-
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#
|
|
574
|
-
this.#d.fill(0), this.#
|
|
575
|
-
for (let
|
|
604
|
+
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
605
|
+
this.#d.fill(0), this.#F.fill(0);
|
|
606
|
+
for (let t of this.#g ?? []) t !== void 0 && clearTimeout(t);
|
|
576
607
|
this.#g?.fill(void 0);
|
|
577
608
|
}
|
|
578
|
-
if (this.#
|
|
579
|
-
let
|
|
580
|
-
for (; i =
|
|
609
|
+
if (this.#_ && this.#_.fill(0), this.#l = 0, this.#h = 0, this.#y.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
610
|
+
let t = this.#r, i;
|
|
611
|
+
for (; i = t?.shift(); ) this.#S?.(...i);
|
|
581
612
|
}
|
|
582
613
|
}
|
|
583
614
|
};
|
|
@@ -604,16 +635,16 @@ var ce = (n7, t) => {
|
|
|
604
635
|
return e ? e[0] : null;
|
|
605
636
|
};
|
|
606
637
|
var ss = (n7, t, e) => {
|
|
607
|
-
let s, i, r, o, h, a = e.indexOf(n7), l = e.indexOf(t, a + 1),
|
|
638
|
+
let s, i, r, o, h, a = e.indexOf(n7), l = e.indexOf(t, a + 1), u3 = a;
|
|
608
639
|
if (a >= 0 && l > 0) {
|
|
609
640
|
if (n7 === t) return [a, l];
|
|
610
|
-
for (s = [], r = e.length;
|
|
611
|
-
if (
|
|
641
|
+
for (s = [], r = e.length; u3 >= 0 && !h; ) {
|
|
642
|
+
if (u3 === a) s.push(u3), a = e.indexOf(n7, u3 + 1);
|
|
612
643
|
else if (s.length === 1) {
|
|
613
|
-
let
|
|
614
|
-
|
|
615
|
-
} else i = s.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t,
|
|
616
|
-
|
|
644
|
+
let c = s.pop();
|
|
645
|
+
c !== void 0 && (h = [c, l]);
|
|
646
|
+
} else i = s.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t, u3 + 1);
|
|
647
|
+
u3 = a < l && a >= 0 ? a : l;
|
|
617
648
|
}
|
|
618
649
|
s.length && o !== void 0 && (h = [r, o]);
|
|
619
650
|
}
|
|
@@ -679,32 +710,32 @@ function ht(n7, t, e) {
|
|
|
679
710
|
s.push(a);
|
|
680
711
|
}
|
|
681
712
|
else {
|
|
682
|
-
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = h || a,
|
|
683
|
-
if (!l && !
|
|
684
|
-
let
|
|
685
|
-
if (l)
|
|
686
|
-
else if (
|
|
713
|
+
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = h || a, u3 = i.body.indexOf(",") >= 0;
|
|
714
|
+
if (!l && !u3) return i.post.match(/,(?!,).*\}/) ? (n7 = i.pre + "{" + i.body + qt + i.post, ht(n7, t, true)) : [n7];
|
|
715
|
+
let c;
|
|
716
|
+
if (l) c = i.body.split(/\.\./);
|
|
717
|
+
else if (c = me(i.body), c.length === 1 && c[0] !== void 0 && (c = ht(c[0], t, false).map(gs), c.length === 1)) return o.map((f) => i.pre + c[0] + f);
|
|
687
718
|
let d;
|
|
688
|
-
if (l &&
|
|
689
|
-
let f = Ht(
|
|
719
|
+
if (l && c[0] !== void 0 && c[1] !== void 0) {
|
|
720
|
+
let f = Ht(c[0]), m = Ht(c[1]), p = Math.max(c[0].length, c[1].length), w = c.length === 3 && c[2] !== void 0 ? Math.abs(Ht(c[2])) : 1, g = ys;
|
|
690
721
|
m < f && (w *= -1, g = bs);
|
|
691
|
-
let E =
|
|
722
|
+
let E = c.some(ws);
|
|
692
723
|
d = [];
|
|
693
|
-
for (let
|
|
724
|
+
for (let y = f; g(y, m); y += w) {
|
|
694
725
|
let b;
|
|
695
|
-
if (a) b = String.fromCharCode(
|
|
696
|
-
else if (b = String(
|
|
697
|
-
let
|
|
698
|
-
if (
|
|
699
|
-
let $ = new Array(
|
|
700
|
-
|
|
726
|
+
if (a) b = String.fromCharCode(y), b === "\\" && (b = "");
|
|
727
|
+
else if (b = String(y), E) {
|
|
728
|
+
let z = p - b.length;
|
|
729
|
+
if (z > 0) {
|
|
730
|
+
let $ = new Array(z + 1).join("0");
|
|
731
|
+
y < 0 ? b = "-" + $ + b.slice(1) : b = $ + b;
|
|
701
732
|
}
|
|
702
733
|
}
|
|
703
734
|
d.push(b);
|
|
704
735
|
}
|
|
705
736
|
} else {
|
|
706
737
|
d = [];
|
|
707
|
-
for (let f = 0; f <
|
|
738
|
+
for (let f = 0; f < c.length; f++) d.push.apply(d, ht(c[f], t, false));
|
|
708
739
|
}
|
|
709
740
|
for (let f = 0; f < d.length; f++) for (let m = 0; m < o.length && s.length < t; m++) {
|
|
710
741
|
let p = r + d[f] + o[m];
|
|
@@ -724,7 +755,7 @@ var we = (n7) => n7.join("");
|
|
|
724
755
|
var ye = (n7, t) => {
|
|
725
756
|
let e = t;
|
|
726
757
|
if (n7.charAt(e) !== "[") throw new Error("not in a brace expression");
|
|
727
|
-
let s = [], i = [], r = e + 1, o = false, h = false, a = false, l = false,
|
|
758
|
+
let s = [], i = [], r = e + 1, o = false, h = false, a = false, l = false, u3 = e, c = "";
|
|
728
759
|
t: for (; r < n7.length; ) {
|
|
729
760
|
let p = n7.charAt(r);
|
|
730
761
|
if ((p === "!" || p === "^") && r === e + 1) {
|
|
@@ -732,7 +763,7 @@ var ye = (n7, t) => {
|
|
|
732
763
|
continue;
|
|
733
764
|
}
|
|
734
765
|
if (p === "]" && o && !a) {
|
|
735
|
-
|
|
766
|
+
u3 = r + 1;
|
|
736
767
|
break;
|
|
737
768
|
}
|
|
738
769
|
if (o = true, p === "\\" && !a) {
|
|
@@ -740,14 +771,14 @@ var ye = (n7, t) => {
|
|
|
740
771
|
continue;
|
|
741
772
|
}
|
|
742
773
|
if (p === "[" && !a) {
|
|
743
|
-
for (let [w, [g,
|
|
744
|
-
if (
|
|
745
|
-
r += w.length, E ? i.push(g) : s.push(g), h = h ||
|
|
774
|
+
for (let [w, [g, S2, E]] of Object.entries(Ss)) if (n7.startsWith(w, r)) {
|
|
775
|
+
if (c) return ["$.", false, n7.length - e, true];
|
|
776
|
+
r += w.length, E ? i.push(g) : s.push(g), h = h || S2;
|
|
746
777
|
continue t;
|
|
747
778
|
}
|
|
748
779
|
}
|
|
749
|
-
if (a = false,
|
|
750
|
-
p >
|
|
780
|
+
if (a = false, c) {
|
|
781
|
+
p > c ? s.push(lt(c) + "-" + lt(p)) : p === c && s.push(lt(p)), c = "", r++;
|
|
751
782
|
continue;
|
|
752
783
|
}
|
|
753
784
|
if (n7.startsWith("-]", r + 1)) {
|
|
@@ -755,19 +786,19 @@ var ye = (n7, t) => {
|
|
|
755
786
|
continue;
|
|
756
787
|
}
|
|
757
788
|
if (n7.startsWith("-", r + 1)) {
|
|
758
|
-
|
|
789
|
+
c = p, r += 2;
|
|
759
790
|
continue;
|
|
760
791
|
}
|
|
761
792
|
s.push(lt(p)), r++;
|
|
762
793
|
}
|
|
763
|
-
if (
|
|
794
|
+
if (u3 < r) return ["", false, 0, false];
|
|
764
795
|
if (!s.length && !i.length) return ["$.", false, n7.length - e, true];
|
|
765
796
|
if (i.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l) {
|
|
766
797
|
let p = s[0].length === 2 ? s[0].slice(-1) : s[0];
|
|
767
|
-
return [Es(p), false,
|
|
798
|
+
return [Es(p), false, u3 - e, false];
|
|
768
799
|
}
|
|
769
800
|
let d = "[" + (l ? "^" : "") + we(s) + "]", f = "[" + (l ? "" : "^") + we(i) + "]";
|
|
770
|
-
return [s.length && i.length ? "(" + d + "|" + f + ")" : s.length ? d : f, h,
|
|
801
|
+
return [s.length && i.length ? "(" + d + "|" + f + ")" : s.length ? d : f, h, u3 - e, true];
|
|
771
802
|
};
|
|
772
803
|
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");
|
|
773
804
|
var xs = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
@@ -886,7 +917,7 @@ var Q = class n {
|
|
|
886
917
|
}
|
|
887
918
|
return e.push(m), f;
|
|
888
919
|
}
|
|
889
|
-
let l = s + 1,
|
|
920
|
+
let l = s + 1, u3 = new n(null, e), c = [], d = "";
|
|
890
921
|
for (; l < t.length; ) {
|
|
891
922
|
let f = t.charAt(l++);
|
|
892
923
|
if (r || f === "\\") {
|
|
@@ -901,16 +932,16 @@ var Q = class n {
|
|
|
901
932
|
continue;
|
|
902
933
|
}
|
|
903
934
|
if (be(f) && t.charAt(l) === "(") {
|
|
904
|
-
|
|
905
|
-
let m = new n(f,
|
|
906
|
-
|
|
935
|
+
u3.push(d), d = "";
|
|
936
|
+
let m = new n(f, u3);
|
|
937
|
+
u3.push(m), l = n.#i(t, m, l, i);
|
|
907
938
|
continue;
|
|
908
939
|
}
|
|
909
940
|
if (f === "|") {
|
|
910
|
-
|
|
941
|
+
u3.push(d), d = "", c.push(u3), u3 = new n(null, e);
|
|
911
942
|
continue;
|
|
912
943
|
}
|
|
913
|
-
if (f === ")") return d === "" && e.#r.length === 0 && (e.#f = true),
|
|
944
|
+
if (f === ")") return d === "" && e.#r.length === 0 && (e.#f = true), u3.push(d), d = "", e.push(...c, u3), l;
|
|
914
945
|
d += f;
|
|
915
946
|
}
|
|
916
947
|
return e.type = null, e.#s = void 0, e.#r = [t.substring(s - 1)], l;
|
|
@@ -935,13 +966,13 @@ var Q = class n {
|
|
|
935
966
|
let a = this.isStart() && this.isEnd() && !this.#r.some((f) => typeof f != "string"), l = this.#r.map((f) => {
|
|
936
967
|
let [m, p, w, g] = typeof f == "string" ? n.#E(f, this.#s, a) : f.toRegExpSource(t);
|
|
937
968
|
return this.#s = this.#s || w, this.#n = this.#n || g, m;
|
|
938
|
-
}).join(""),
|
|
969
|
+
}).join(""), u3 = "";
|
|
939
970
|
if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && Ts.has(this.#r[0]))) {
|
|
940
971
|
let m = Cs, p = e && m.has(l.charAt(0)) || l.startsWith("\\.") && m.has(l.charAt(2)) || l.startsWith("\\.\\.") && m.has(l.charAt(4)), w = !e && !t && m.has(l.charAt(0));
|
|
941
|
-
|
|
972
|
+
u3 = p ? vs : w ? Ct : "";
|
|
942
973
|
}
|
|
943
|
-
let
|
|
944
|
-
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (
|
|
974
|
+
let c = "";
|
|
975
|
+
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c = "(?:$|\\/)"), [u3 + l + c, W2(l), this.#s = !!this.#s, this.#n];
|
|
945
976
|
}
|
|
946
977
|
let s = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:", r = this.#d(e);
|
|
947
978
|
if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
|
|
@@ -983,9 +1014,9 @@ var Q = class n {
|
|
|
983
1014
|
continue;
|
|
984
1015
|
}
|
|
985
1016
|
if (l === "[") {
|
|
986
|
-
let [
|
|
1017
|
+
let [u3, c, d, f] = ye(t, a);
|
|
987
1018
|
if (d) {
|
|
988
|
-
r +=
|
|
1019
|
+
r += u3, o = o || c, a += d - 1, e = e || f;
|
|
989
1020
|
continue;
|
|
990
1021
|
}
|
|
991
1022
|
}
|
|
@@ -999,7 +1030,7 @@ var Q = class n {
|
|
|
999
1030
|
}
|
|
1000
1031
|
};
|
|
1001
1032
|
var tt = (n7, { windowsPathsNoEscape: t = false, magicalBraces: e = false } = {}) => e ? t ? n7.replace(/[?*()[\]{}]/g, "[$&]") : n7.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n7.replace(/[?*()[\]]/g, "[$&]") : n7.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1002
|
-
var
|
|
1033
|
+
var O2 = (n7, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? false : new D2(t, e).match(n7));
|
|
1003
1034
|
var Rs = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1004
1035
|
var Os = (n7) => (t) => !t.startsWith(".") && t.endsWith(n7);
|
|
1005
1036
|
var Fs = (n7) => (t) => t.endsWith(n7);
|
|
@@ -1041,19 +1072,19 @@ var Te = ([n7]) => {
|
|
|
1041
1072
|
var Ae = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1042
1073
|
var xe = { win32: { sep: "\\" }, posix: { sep: "/" } };
|
|
1043
1074
|
var qs = Ae === "win32" ? xe.win32.sep : xe.posix.sep;
|
|
1044
|
-
|
|
1075
|
+
O2.sep = qs;
|
|
1045
1076
|
var A = /* @__PURE__ */ Symbol("globstar **");
|
|
1046
|
-
|
|
1077
|
+
O2.GLOBSTAR = A;
|
|
1047
1078
|
var Ks = "[^/]";
|
|
1048
1079
|
var Vs = Ks + "*?";
|
|
1049
1080
|
var Ys = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
1050
1081
|
var Xs = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
1051
|
-
var Js = (n7, t = {}) => (e) =>
|
|
1052
|
-
|
|
1082
|
+
var Js = (n7, t = {}) => (e) => O2(e, n7, t);
|
|
1083
|
+
O2.filter = Js;
|
|
1053
1084
|
var N = (n7, t = {}) => Object.assign({}, n7, t);
|
|
1054
1085
|
var Zs = (n7) => {
|
|
1055
|
-
if (!n7 || typeof n7 != "object" || !Object.keys(n7).length) return
|
|
1056
|
-
let t =
|
|
1086
|
+
if (!n7 || typeof n7 != "object" || !Object.keys(n7).length) return O2;
|
|
1087
|
+
let t = O2;
|
|
1057
1088
|
return Object.assign((s, i, r = {}) => t(s, i, N(n7, r)), { Minimatch: class extends t.Minimatch {
|
|
1058
1089
|
constructor(i, r = {}) {
|
|
1059
1090
|
super(i, N(n7, r));
|
|
@@ -1070,16 +1101,16 @@ var Zs = (n7) => {
|
|
|
1070
1101
|
}
|
|
1071
1102
|
}, unescape: (s, i = {}) => t.unescape(s, N(n7, i)), escape: (s, i = {}) => t.escape(s, N(n7, i)), filter: (s, i = {}) => t.filter(s, N(n7, i)), defaults: (s) => t.defaults(N(n7, s)), makeRe: (s, i = {}) => t.makeRe(s, N(n7, i)), braceExpand: (s, i = {}) => t.braceExpand(s, N(n7, i)), match: (s, i, r = {}) => t.match(s, i, N(n7, r)), sep: t.sep, GLOBSTAR: A });
|
|
1072
1103
|
};
|
|
1073
|
-
|
|
1104
|
+
O2.defaults = Zs;
|
|
1074
1105
|
var ke = (n7, t = {}) => (at(n7), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n7) ? [n7] : ge(n7, { max: t.braceExpandMax }));
|
|
1075
|
-
|
|
1106
|
+
O2.braceExpand = ke;
|
|
1076
1107
|
var Qs = (n7, t = {}) => new D2(n7, t).makeRe();
|
|
1077
|
-
|
|
1108
|
+
O2.makeRe = Qs;
|
|
1078
1109
|
var ti = (n7, t, e = {}) => {
|
|
1079
1110
|
let s = new D2(t, e);
|
|
1080
1111
|
return n7 = n7.filter((i) => s.match(i)), s.options.nonull && !n7.length && n7.push(t), n7;
|
|
1081
1112
|
};
|
|
1082
|
-
|
|
1113
|
+
O2.match = ti;
|
|
1083
1114
|
var ve = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1084
1115
|
var ei = (n7) => n7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1085
1116
|
var D2 = class {
|
|
@@ -1128,8 +1159,8 @@ var D2 = class {
|
|
|
1128
1159
|
let i = this.globParts.map((r, o, h) => {
|
|
1129
1160
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1130
1161
|
let a = r[0] === "" && r[1] === "" && (r[2] === "?" || !ve.test(r[2])) && !ve.test(r[3]), l = /^[a-z]:/i.test(r[0]);
|
|
1131
|
-
if (a) return [...r.slice(0, 4), ...r.slice(4).map((
|
|
1132
|
-
if (l) return [r[0], ...r.slice(1).map((
|
|
1162
|
+
if (a) return [...r.slice(0, 4), ...r.slice(4).map((u3) => this.parse(u3))];
|
|
1163
|
+
if (l) return [r[0], ...r.slice(1).map((u3) => this.parse(u3))];
|
|
1133
1164
|
}
|
|
1134
1165
|
return r.map((a) => this.parse(a));
|
|
1135
1166
|
});
|
|
@@ -1193,8 +1224,8 @@ var D2 = class {
|
|
|
1193
1224
|
let h = s[i + 1], a = s[i + 2], l = s[i + 3];
|
|
1194
1225
|
if (h !== ".." || !a || a === "." || a === ".." || !l || l === "." || l === "..") continue;
|
|
1195
1226
|
e = true, s.splice(i, 1);
|
|
1196
|
-
let
|
|
1197
|
-
|
|
1227
|
+
let u3 = s.slice(0);
|
|
1228
|
+
u3[i] = "**", t.push(u3), i--;
|
|
1198
1229
|
}
|
|
1199
1230
|
if (!this.preserveMultipleSlashes) {
|
|
1200
1231
|
for (let o = 1; o < s.length - 1; o++) {
|
|
@@ -1249,20 +1280,20 @@ var D2 = class {
|
|
|
1249
1280
|
matchOne(t, e, s = false) {
|
|
1250
1281
|
let i = this.options;
|
|
1251
1282
|
if (this.isWindows) {
|
|
1252
|
-
let p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), w = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), g = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]),
|
|
1253
|
-
if (typeof E == "number" && typeof
|
|
1254
|
-
let [b,
|
|
1255
|
-
b.toLowerCase() ===
|
|
1283
|
+
let p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), w = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), g = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), S2 = !g && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), E = w ? 3 : p ? 0 : void 0, y = S2 ? 3 : g ? 0 : void 0;
|
|
1284
|
+
if (typeof E == "number" && typeof y == "number") {
|
|
1285
|
+
let [b, z] = [t[E], e[y]];
|
|
1286
|
+
b.toLowerCase() === z.toLowerCase() && (e[y] = b, y > E ? e = e.slice(y) : E > y && (t = t.slice(E)));
|
|
1256
1287
|
}
|
|
1257
1288
|
}
|
|
1258
1289
|
let { optimizationLevel: r = 1 } = this.options;
|
|
1259
1290
|
r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
|
|
1260
1291
|
for (var o = 0, h = 0, a = t.length, l = e.length; o < a && h < l; o++, h++) {
|
|
1261
1292
|
this.debug("matchOne loop");
|
|
1262
|
-
var
|
|
1263
|
-
if (this.debug(e,
|
|
1264
|
-
if (
|
|
1265
|
-
this.debug("GLOBSTAR", [e,
|
|
1293
|
+
var u3 = e[h], c = t[o];
|
|
1294
|
+
if (this.debug(e, u3, c), u3 === false) return false;
|
|
1295
|
+
if (u3 === A) {
|
|
1296
|
+
this.debug("GLOBSTAR", [e, u3, c]);
|
|
1266
1297
|
var d = o, f = h + 1;
|
|
1267
1298
|
if (f === l) {
|
|
1268
1299
|
for (this.debug("** at the end"); o < a; o++) if (t[o] === "." || t[o] === ".." || !i.dot && t[o].charAt(0) === ".") return false;
|
|
@@ -1282,7 +1313,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
|
|
|
1282
1313
|
>>> no match, partial?`, t, d, e, f), d === a));
|
|
1283
1314
|
}
|
|
1284
1315
|
let p;
|
|
1285
|
-
if (typeof
|
|
1316
|
+
if (typeof u3 == "string" ? (p = c === u3, this.debug("string match", u3, c, p)) : (p = u3.test(c), this.debug("pattern match", u3, c, p)), !p) return false;
|
|
1286
1317
|
}
|
|
1287
1318
|
if (o === a && h === l) return true;
|
|
1288
1319
|
if (o === a) return s;
|
|
@@ -1307,21 +1338,21 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
|
|
|
1307
1338
|
let t = this.set;
|
|
1308
1339
|
if (!t.length) return this.regexp = false, this.regexp;
|
|
1309
1340
|
let e = this.options, s = e.noglobstar ? Vs : e.dot ? Ys : Xs, i = new Set(e.nocase ? ["i"] : []), r = t.map((a) => {
|
|
1310
|
-
let l = a.map((
|
|
1311
|
-
if (
|
|
1312
|
-
return typeof
|
|
1341
|
+
let l = a.map((c) => {
|
|
1342
|
+
if (c instanceof RegExp) for (let d of c.flags.split("")) i.add(d);
|
|
1343
|
+
return typeof c == "string" ? ei(c) : c === A ? A : c._src;
|
|
1313
1344
|
});
|
|
1314
|
-
l.forEach((
|
|
1345
|
+
l.forEach((c, d) => {
|
|
1315
1346
|
let f = l[d + 1], m = l[d - 1];
|
|
1316
|
-
|
|
1347
|
+
c !== A || m === A || (m === void 0 ? f !== void 0 && f !== A ? l[d + 1] = "(?:\\/|" + s + "\\/)?" + f : l[d] = s : f === void 0 ? l[d - 1] = m + "(?:\\/|\\/" + s + ")?" : f !== A && (l[d - 1] = m + "(?:\\/|\\/" + s + "\\/)" + f, l[d + 1] = A));
|
|
1317
1348
|
});
|
|
1318
|
-
let
|
|
1319
|
-
if (this.partial &&
|
|
1320
|
-
let
|
|
1321
|
-
for (let d = 1; d <=
|
|
1322
|
-
return "(?:" +
|
|
1349
|
+
let u3 = l.filter((c) => c !== A);
|
|
1350
|
+
if (this.partial && u3.length >= 1) {
|
|
1351
|
+
let c = [];
|
|
1352
|
+
for (let d = 1; d <= u3.length; d++) c.push(u3.slice(0, d).join("/"));
|
|
1353
|
+
return "(?:" + c.join("|") + ")";
|
|
1323
1354
|
}
|
|
1324
|
-
return
|
|
1355
|
+
return u3.join("/");
|
|
1325
1356
|
}).join("|"), [o, h] = t.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1326
1357
|
r = "^" + o + r + h + "$", this.partial && (r = "^(?:\\/|" + o + r.slice(1, -1) + h + ")$"), this.negate && (r = "^(?!" + r + ").+$");
|
|
1327
1358
|
try {
|
|
@@ -1353,13 +1384,13 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
|
|
|
1353
1384
|
return s.flipNegate ? false : this.negate;
|
|
1354
1385
|
}
|
|
1355
1386
|
static defaults(t) {
|
|
1356
|
-
return
|
|
1387
|
+
return O2.defaults(t).Minimatch;
|
|
1357
1388
|
}
|
|
1358
1389
|
};
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1390
|
+
O2.AST = Q;
|
|
1391
|
+
O2.Minimatch = D2;
|
|
1392
|
+
O2.escape = tt;
|
|
1393
|
+
O2.unescape = W2;
|
|
1363
1394
|
var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
1364
1395
|
var Oe = /* @__PURE__ */ new Set();
|
|
1365
1396
|
var Vt = typeof process == "object" && process ? process : {};
|
|
@@ -1505,7 +1536,7 @@ var ft = class Me {
|
|
|
1505
1536
|
return this.#o;
|
|
1506
1537
|
}
|
|
1507
1538
|
constructor(t) {
|
|
1508
|
-
let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a, dispose: l, onInsert:
|
|
1539
|
+
let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a, dispose: l, onInsert: u3, disposeAfter: c, noDisposeOnSet: d, noUpdateTTL: f, maxSize: m = 0, maxEntrySize: p = 0, sizeCalculation: w, fetchMethod: g, memoMethod: S2, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y, allowStaleOnFetchRejection: b, allowStaleOnFetchAbort: z, ignoreFetchAbort: $, perf: J } = t;
|
|
1509
1540
|
if (J !== void 0 && typeof J?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
1510
1541
|
if (this.#c = J ?? si, e !== 0 && !q(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
1511
1542
|
let Z = e ? De(e) : Array;
|
|
@@ -1514,14 +1545,14 @@ var ft = class Me {
|
|
|
1514
1545
|
if (!this.#s && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1515
1546
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
1516
1547
|
}
|
|
1517
|
-
if (
|
|
1518
|
-
if (this.#w =
|
|
1519
|
-
if (this.#S = g, this.#A = !!g, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new Z(e), this.#E = new Z(e), this.#b = 0, this.#p = 0, this.#R = ri.create(e), this.#h = 0, this.#u = 0, typeof l == "function" && (this.#n = l), typeof
|
|
1548
|
+
if (S2 !== void 0 && typeof S2 != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
1549
|
+
if (this.#w = S2, g !== void 0 && typeof g != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
1550
|
+
if (this.#S = g, this.#A = !!g, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new Z(e), this.#E = new Z(e), this.#b = 0, this.#p = 0, this.#R = ri.create(e), this.#h = 0, this.#u = 0, typeof l == "function" && (this.#n = l), typeof u3 == "function" && (this.#r = u3), 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 = !!d, this.noUpdateTTL = !!f, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!b, this.allowStaleOnFetchAbort = !!z, this.ignoreFetchAbort = !!$, this.maxEntrySize !== 0) {
|
|
1520
1551
|
if (this.#s !== 0 && !q(this.#s)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
1521
1552
|
if (!q(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1522
1553
|
this.#G();
|
|
1523
1554
|
}
|
|
1524
|
-
if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!
|
|
1555
|
+
if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!y, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = q(i) || i === 0 ? i : 1, this.ttlAutopurge = !!r, this.ttl = s || 0, this.ttl) {
|
|
1525
1556
|
if (!q(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
1526
1557
|
this.#M();
|
|
1527
1558
|
}
|
|
@@ -1552,8 +1583,8 @@ var ft = class Me {
|
|
|
1552
1583
|
let a = t[h], l = e[h];
|
|
1553
1584
|
if (!a || !l) return;
|
|
1554
1585
|
o.ttl = a, o.start = l, o.now = i || r();
|
|
1555
|
-
let
|
|
1556
|
-
o.remainingTTL = a -
|
|
1586
|
+
let u3 = o.now - l;
|
|
1587
|
+
o.remainingTTL = a - u3;
|
|
1557
1588
|
}
|
|
1558
1589
|
};
|
|
1559
1590
|
let i = 0, r = () => {
|
|
@@ -1570,8 +1601,8 @@ var ft = class Me {
|
|
|
1570
1601
|
if (h === void 0) return 0;
|
|
1571
1602
|
let a = t[h], l = e[h];
|
|
1572
1603
|
if (!a || !l) return 1 / 0;
|
|
1573
|
-
let
|
|
1574
|
-
return a -
|
|
1604
|
+
let u3 = (i || r()) - l;
|
|
1605
|
+
return a - u3;
|
|
1575
1606
|
}, this.#v = (o) => {
|
|
1576
1607
|
let h = e[o], a = t[o];
|
|
1577
1608
|
return !!a && !!h && (i || r()) - h > a;
|
|
@@ -1713,20 +1744,20 @@ var ft = class Me {
|
|
|
1713
1744
|
}
|
|
1714
1745
|
set(t, e, s = {}) {
|
|
1715
1746
|
if (e === void 0) return this.delete(t), this;
|
|
1716
|
-
let { ttl: i = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s,
|
|
1717
|
-
if (this.maxEntrySize &&
|
|
1718
|
-
let
|
|
1719
|
-
if (
|
|
1747
|
+
let { ttl: i = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s, u3 = this.#I(t, e, s.size || 0, h);
|
|
1748
|
+
if (this.maxEntrySize && u3 > this.maxEntrySize) return a && (a.set = "miss", a.maxEntrySizeExceeded = true), this.#O(t, "set"), this;
|
|
1749
|
+
let c = this.#h === 0 ? void 0 : this.#f.get(t);
|
|
1750
|
+
if (c === void 0) c = this.#h === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#h === this.#t ? this.#B(false) : this.#h, this.#a[c] = t, this.#i[c] = e, this.#f.set(t, c), this.#d[this.#p] = c, this.#E[c] = this.#p, this.#p = c, this.#h++, this.#L(c, u3, a), a && (a.set = "add"), l = false, this.#_ && this.#r?.(e, t, "add");
|
|
1720
1751
|
else {
|
|
1721
|
-
this.#W(
|
|
1722
|
-
let d = this.#i[
|
|
1752
|
+
this.#W(c);
|
|
1753
|
+
let d = this.#i[c];
|
|
1723
1754
|
if (e !== d) {
|
|
1724
1755
|
if (this.#A && this.#l(d)) {
|
|
1725
1756
|
d.__abortController.abort(new Error("replaced"));
|
|
1726
1757
|
let { __staleWhileFetching: f } = d;
|
|
1727
1758
|
f !== void 0 && !o && (this.#x && this.#n?.(f, t, "set"), this.#e && this.#m?.push([f, t, "set"]));
|
|
1728
1759
|
} else o || (this.#x && this.#n?.(d, t, "set"), this.#e && this.#m?.push([d, t, "set"]));
|
|
1729
|
-
if (this.#P(
|
|
1760
|
+
if (this.#P(c), this.#L(c, u3, a), this.#i[c] = e, a) {
|
|
1730
1761
|
a.set = "replace";
|
|
1731
1762
|
let f = d && this.#l(d) ? d.__staleWhileFetching : d;
|
|
1732
1763
|
f !== void 0 && (a.oldValue = f);
|
|
@@ -1734,7 +1765,7 @@ var ft = class Me {
|
|
|
1734
1765
|
} else a && (a.set = "update");
|
|
1735
1766
|
this.#_ && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
1736
1767
|
}
|
|
1737
|
-
if (i !== 0 && !this.#g && this.#M(), this.#g && (l || this.#j(
|
|
1768
|
+
if (i !== 0 && !this.#g && this.#M(), this.#g && (l || this.#j(c, i, r), a && this.#N(a, c)), !o && this.#e && this.#m) {
|
|
1738
1769
|
let d = this.#m, f;
|
|
1739
1770
|
for (; f = d?.shift(); ) this.#o?.(...f);
|
|
1740
1771
|
}
|
|
@@ -1781,22 +1812,22 @@ var ft = class Me {
|
|
|
1781
1812
|
let o = new At(), { signal: h } = s;
|
|
1782
1813
|
h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
|
|
1783
1814
|
let a = { signal: o.signal, options: s, context: i }, l = (p, w = false) => {
|
|
1784
|
-
let { aborted: g } = o.signal,
|
|
1785
|
-
if (s.status && (g && !w ? (s.status.fetchAborted = true, s.status.fetchError = o.signal.reason,
|
|
1786
|
-
let
|
|
1787
|
-
return (b === f ||
|
|
1788
|
-
},
|
|
1789
|
-
let { aborted: g } = o.signal,
|
|
1790
|
-
if (this.#i[e] === f && (!
|
|
1815
|
+
let { aborted: g } = o.signal, S2 = s.ignoreFetchAbort && p !== void 0, E = s.ignoreFetchAbort || !!(s.allowStaleOnFetchAbort && p !== void 0);
|
|
1816
|
+
if (s.status && (g && !w ? (s.status.fetchAborted = true, s.status.fetchError = o.signal.reason, S2 && (s.status.fetchAbortIgnored = true)) : s.status.fetchResolved = true), g && !S2 && !w) return c(o.signal.reason, E);
|
|
1817
|
+
let y = f, b = this.#i[e];
|
|
1818
|
+
return (b === f || S2 && w && b === void 0) && (p === void 0 ? y.__staleWhileFetching !== void 0 ? this.#i[e] = y.__staleWhileFetching : this.#O(t, "fetch") : (s.status && (s.status.fetchUpdated = true), this.set(t, p, a.options))), p;
|
|
1819
|
+
}, u3 = (p) => (s.status && (s.status.fetchRejected = true, s.status.fetchError = p), c(p, false)), c = (p, w) => {
|
|
1820
|
+
let { aborted: g } = o.signal, S2 = g && s.allowStaleOnFetchAbort, E = S2 || s.allowStaleOnFetchRejection, y = E || s.noDeleteOnFetchRejection, b = f;
|
|
1821
|
+
if (this.#i[e] === f && (!y || !w && b.__staleWhileFetching === void 0 ? this.#O(t, "fetch") : S2 || (this.#i[e] = b.__staleWhileFetching)), E) return s.status && b.__staleWhileFetching !== void 0 && (s.status.returnedStale = true), b.__staleWhileFetching;
|
|
1791
1822
|
if (b.__returned === b) throw p;
|
|
1792
1823
|
}, d = (p, w) => {
|
|
1793
1824
|
let g = this.#S?.(t, r, a);
|
|
1794
|
-
g && g instanceof Promise && g.then((
|
|
1795
|
-
(!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (
|
|
1825
|
+
g && g instanceof Promise && g.then((S2) => p(S2 === void 0 ? void 0 : S2), w), o.signal.addEventListener("abort", () => {
|
|
1826
|
+
(!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (S2) => l(S2, true)));
|
|
1796
1827
|
});
|
|
1797
1828
|
};
|
|
1798
1829
|
s.status && (s.status.fetchDispatched = true);
|
|
1799
|
-
let f = new Promise(d).then(l,
|
|
1830
|
+
let f = new Promise(d).then(l, u3), m = Object.assign(f, { __abortController: o, __staleWhileFetching: r, __returned: void 0 });
|
|
1800
1831
|
return e === void 0 ? (this.set(t, m, { ...a.options, status: void 0 }), e = this.#f.get(t)) : this.#i[e] = m, m;
|
|
1801
1832
|
}
|
|
1802
1833
|
#l(t) {
|
|
@@ -1805,23 +1836,23 @@ var ft = class Me {
|
|
|
1805
1836
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof At;
|
|
1806
1837
|
}
|
|
1807
1838
|
async fetch(t, e = {}) {
|
|
1808
|
-
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL:
|
|
1839
|
+
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: u3 = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: m = this.allowStaleOnFetchAbort, context: p, forceRefresh: w = false, status: g, signal: S2 } = e;
|
|
1809
1840
|
if (!this.#A) return g && (g.fetch = "get"), this.get(t, { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, status: g });
|
|
1810
|
-
let E = { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, ttl: o, noDisposeOnSet: h, size: a, sizeCalculation: l, noUpdateTTL:
|
|
1811
|
-
if (
|
|
1841
|
+
let E = { allowStale: s, updateAgeOnGet: i, noDeleteOnStaleGet: r, ttl: o, noDisposeOnSet: h, size: a, sizeCalculation: l, noUpdateTTL: u3, noDeleteOnFetchRejection: c, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: m, ignoreFetchAbort: f, status: g, signal: S2 }, y = this.#f.get(t);
|
|
1842
|
+
if (y === void 0) {
|
|
1812
1843
|
g && (g.fetch = "miss");
|
|
1813
|
-
let b = this.#U(t,
|
|
1844
|
+
let b = this.#U(t, y, E, p);
|
|
1814
1845
|
return b.__returned = b;
|
|
1815
1846
|
} else {
|
|
1816
|
-
let b = this.#i[
|
|
1847
|
+
let b = this.#i[y];
|
|
1817
1848
|
if (this.#l(b)) {
|
|
1818
1849
|
let Z = s && b.__staleWhileFetching !== void 0;
|
|
1819
1850
|
return g && (g.fetch = "inflight", Z && (g.returnedStale = true)), Z ? b.__staleWhileFetching : b.__returned = b;
|
|
1820
1851
|
}
|
|
1821
|
-
let
|
|
1822
|
-
if (!w && !
|
|
1823
|
-
let $ = this.#U(t,
|
|
1824
|
-
return g && (g.fetch =
|
|
1852
|
+
let z = this.#v(y);
|
|
1853
|
+
if (!w && !z) return g && (g.fetch = "hit"), this.#W(y), i && this.#k(y), g && this.#N(g, y), b;
|
|
1854
|
+
let $ = this.#U(t, y, E, p), J = $.__staleWhileFetching !== void 0 && s;
|
|
1855
|
+
return g && (g.fetch = z ? "stale" : "refresh", J && z && (g.returnedStale = true)), J ? $.__staleWhileFetching : $.__returned = $;
|
|
1825
1856
|
}
|
|
1826
1857
|
}
|
|
1827
1858
|
async forceFetch(t, e = {}) {
|
|
@@ -1906,7 +1937,7 @@ var oi = (n7) => !!n7 && typeof n7 == "object" && (n7 instanceof V || n7 instanc
|
|
|
1906
1937
|
var hi = (n7) => !!n7 && typeof n7 == "object" && n7 instanceof ee && typeof n7.pipe == "function" && n7.pipe !== Pe.Writable.prototype.pipe;
|
|
1907
1938
|
var ai = (n7) => !!n7 && typeof n7 == "object" && n7 instanceof ee && typeof n7.write == "function" && typeof n7.end == "function";
|
|
1908
1939
|
var G2 = /* @__PURE__ */ Symbol("EOF");
|
|
1909
|
-
var
|
|
1940
|
+
var H2 = /* @__PURE__ */ Symbol("maybeEmitEnd");
|
|
1910
1941
|
var K = /* @__PURE__ */ Symbol("emittedEnd");
|
|
1911
1942
|
var kt = /* @__PURE__ */ Symbol("emittingEnd");
|
|
1912
1943
|
var ut = /* @__PURE__ */ Symbol("emittedError");
|
|
@@ -1914,18 +1945,18 @@ var Rt = /* @__PURE__ */ Symbol("closed");
|
|
|
1914
1945
|
var _e = /* @__PURE__ */ Symbol("read");
|
|
1915
1946
|
var Ot = /* @__PURE__ */ Symbol("flush");
|
|
1916
1947
|
var Le = /* @__PURE__ */ Symbol("flushChunk");
|
|
1917
|
-
var
|
|
1948
|
+
var P2 = /* @__PURE__ */ Symbol("encoding");
|
|
1918
1949
|
var et = /* @__PURE__ */ Symbol("decoder");
|
|
1919
1950
|
var v = /* @__PURE__ */ Symbol("flowing");
|
|
1920
1951
|
var dt = /* @__PURE__ */ Symbol("paused");
|
|
1921
1952
|
var st = /* @__PURE__ */ Symbol("resume");
|
|
1922
1953
|
var C2 = /* @__PURE__ */ Symbol("buffer");
|
|
1923
|
-
var
|
|
1954
|
+
var F2 = /* @__PURE__ */ Symbol("pipes");
|
|
1924
1955
|
var T = /* @__PURE__ */ Symbol("bufferLength");
|
|
1925
1956
|
var Yt = /* @__PURE__ */ Symbol("bufferPush");
|
|
1926
1957
|
var Ft = /* @__PURE__ */ Symbol("bufferShift");
|
|
1927
1958
|
var k = /* @__PURE__ */ Symbol("objectMode");
|
|
1928
|
-
var
|
|
1959
|
+
var x = /* @__PURE__ */ Symbol("destroyed");
|
|
1929
1960
|
var Xt = /* @__PURE__ */ Symbol("error");
|
|
1930
1961
|
var Jt = /* @__PURE__ */ Symbol("emitData");
|
|
1931
1962
|
var We = /* @__PURE__ */ Symbol("emitEnd");
|
|
@@ -1971,10 +2002,10 @@ var pi = (n7) => !n7.objectMode && !!n7.encoding && n7.encoding !== "buffer";
|
|
|
1971
2002
|
var V = class extends ee {
|
|
1972
2003
|
[v] = false;
|
|
1973
2004
|
[dt] = false;
|
|
1974
|
-
[
|
|
2005
|
+
[F2] = [];
|
|
1975
2006
|
[C2] = [];
|
|
1976
2007
|
[k];
|
|
1977
|
-
[
|
|
2008
|
+
[P2];
|
|
1978
2009
|
[B];
|
|
1979
2010
|
[et];
|
|
1980
2011
|
[G2] = false;
|
|
@@ -1983,7 +2014,7 @@ var V = class extends ee {
|
|
|
1983
2014
|
[Rt] = false;
|
|
1984
2015
|
[ut] = null;
|
|
1985
2016
|
[T] = 0;
|
|
1986
|
-
[
|
|
2017
|
+
[x] = false;
|
|
1987
2018
|
[pt];
|
|
1988
2019
|
[Dt] = false;
|
|
1989
2020
|
[Y] = 0;
|
|
@@ -1993,7 +2024,7 @@ var V = class extends ee {
|
|
|
1993
2024
|
constructor(...t) {
|
|
1994
2025
|
let e = t[0] || {};
|
|
1995
2026
|
if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
|
|
1996
|
-
di(e) ? (this[k] = true, this[
|
|
2027
|
+
di(e) ? (this[k] = true, this[P2] = null) : pi(e) ? (this[P2] = e.encoding, this[k] = false) : (this[k] = false, this[P2] = null), this[B] = !!e.async, this[et] = this[P2] ? new ni(this[P2]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[C2] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[F2] });
|
|
1997
2028
|
let { signal: s } = e;
|
|
1998
2029
|
s && (this[pt] = s, s.aborted ? this[Qt]() : s.addEventListener("abort", () => this[Qt]()));
|
|
1999
2030
|
}
|
|
@@ -2001,7 +2032,7 @@ var V = class extends ee {
|
|
|
2001
2032
|
return this[T];
|
|
2002
2033
|
}
|
|
2003
2034
|
get encoding() {
|
|
2004
|
-
return this[
|
|
2035
|
+
return this[P2];
|
|
2005
2036
|
}
|
|
2006
2037
|
set encoding(t) {
|
|
2007
2038
|
throw new Error("Encoding must be set at instantiation time");
|
|
@@ -2032,7 +2063,7 @@ var V = class extends ee {
|
|
|
2032
2063
|
write(t, e, s) {
|
|
2033
2064
|
if (this[Dt]) return false;
|
|
2034
2065
|
if (this[G2]) throw new Error("write after end");
|
|
2035
|
-
if (this[
|
|
2066
|
+
if (this[x]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
2036
2067
|
typeof e == "function" && (s = e, e = "utf8"), e || (e = "utf8");
|
|
2037
2068
|
let i = this[B] ? mt : li;
|
|
2038
2069
|
if (!this[k] && !Buffer.isBuffer(t)) {
|
|
@@ -2040,14 +2071,14 @@ var V = class extends ee {
|
|
|
2040
2071
|
else if (fi(t)) t = Buffer.from(t);
|
|
2041
2072
|
else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
2042
2073
|
}
|
|
2043
|
-
return this[k] ? (this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i(s), this[v]) : t.length ? (typeof t == "string" && !(e === this[
|
|
2074
|
+
return this[k] ? (this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i(s), this[v]) : t.length ? (typeof t == "string" && !(e === this[P2] && !this[et]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[P2] && (t = this[et].write(t)), this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i(s), this[v]) : (this[T] !== 0 && this.emit("readable"), s && i(s), this[v]);
|
|
2044
2075
|
}
|
|
2045
2076
|
read(t) {
|
|
2046
|
-
if (this[
|
|
2047
|
-
if (this[M2] = false, this[T] === 0 || t === 0 || t && t > this[T]) return this[
|
|
2048
|
-
this[k] && (t = null), this[C2].length > 1 && !this[k] && (this[C2] = [this[
|
|
2077
|
+
if (this[x]) return null;
|
|
2078
|
+
if (this[M2] = false, this[T] === 0 || t === 0 || t && t > this[T]) return this[H2](), null;
|
|
2079
|
+
this[k] && (t = null), this[C2].length > 1 && !this[k] && (this[C2] = [this[P2] ? this[C2].join("") : Buffer.concat(this[C2], this[T])]);
|
|
2049
2080
|
let e = this[_e](t || null, this[C2][0]);
|
|
2050
|
-
return this[
|
|
2081
|
+
return this[H2](), e;
|
|
2051
2082
|
}
|
|
2052
2083
|
[_e](t, e) {
|
|
2053
2084
|
if (this[k]) this[Ft]();
|
|
@@ -2058,10 +2089,10 @@ var V = class extends ee {
|
|
|
2058
2089
|
return this.emit("data", e), !this[C2].length && !this[G2] && this.emit("drain"), e;
|
|
2059
2090
|
}
|
|
2060
2091
|
end(t, e, s) {
|
|
2061
|
-
return typeof t == "function" && (s = t, t = void 0), typeof e == "function" && (s = e, e = "utf8"), t !== void 0 && this.write(t, e), s && this.once("end", s), this[G2] = true, this.writable = false, (this[v] || !this[dt]) && this[
|
|
2092
|
+
return typeof t == "function" && (s = t, t = void 0), typeof e == "function" && (s = e, e = "utf8"), t !== void 0 && this.write(t, e), s && this.once("end", s), this[G2] = true, this.writable = false, (this[v] || !this[dt]) && this[H2](), this;
|
|
2062
2093
|
}
|
|
2063
2094
|
[st]() {
|
|
2064
|
-
this[
|
|
2095
|
+
this[x] || (!this[Y] && !this[F2].length && (this[M2] = true), this[dt] = false, this[v] = true, this.emit("resume"), this[C2].length ? this[Ot]() : this[G2] ? this[H2]() : this.emit("drain"));
|
|
2065
2096
|
}
|
|
2066
2097
|
resume() {
|
|
2067
2098
|
return this[st]();
|
|
@@ -2070,7 +2101,7 @@ var V = class extends ee {
|
|
|
2070
2101
|
this[v] = false, this[dt] = true, this[M2] = false;
|
|
2071
2102
|
}
|
|
2072
2103
|
get destroyed() {
|
|
2073
|
-
return this[
|
|
2104
|
+
return this[x];
|
|
2074
2105
|
}
|
|
2075
2106
|
get flowing() {
|
|
2076
2107
|
return this[v];
|
|
@@ -2094,21 +2125,21 @@ var V = class extends ee {
|
|
|
2094
2125
|
return this.emit("data", t), this[v];
|
|
2095
2126
|
}
|
|
2096
2127
|
pipe(t, e) {
|
|
2097
|
-
if (this[
|
|
2128
|
+
if (this[x]) return t;
|
|
2098
2129
|
this[M2] = false;
|
|
2099
2130
|
let s = this[K];
|
|
2100
|
-
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[
|
|
2131
|
+
return e = e || {}, t === Ne.stdout || t === Ne.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, s ? e.end && t.end() : (this[F2].push(e.proxyErrors ? new te(this, t, e) : new Mt(this, t, e)), this[B] ? mt(() => this[st]()) : this[st]()), t;
|
|
2101
2132
|
}
|
|
2102
2133
|
unpipe(t) {
|
|
2103
|
-
let e = this[
|
|
2104
|
-
e && (this[
|
|
2134
|
+
let e = this[F2].find((s) => s.dest === t);
|
|
2135
|
+
e && (this[F2].length === 1 ? (this[v] && this[Y] === 0 && (this[v] = false), this[F2] = []) : this[F2].splice(this[F2].indexOf(e), 1), e.unpipe());
|
|
2105
2136
|
}
|
|
2106
2137
|
addListener(t, e) {
|
|
2107
2138
|
return this.on(t, e);
|
|
2108
2139
|
}
|
|
2109
2140
|
on(t, e) {
|
|
2110
2141
|
let s = super.on(t, e);
|
|
2111
|
-
if (t === "data") this[M2] = false, this[Y]++, !this[
|
|
2142
|
+
if (t === "data") this[M2] = false, this[Y]++, !this[F2].length && !this[v] && this[st]();
|
|
2112
2143
|
else if (t === "readable" && this[T] !== 0) super.emit("readable");
|
|
2113
2144
|
else if (ci(t) && this[K]) super.emit(t), this.removeAllListeners(t);
|
|
2114
2145
|
else if (t === "error" && this[ut]) {
|
|
@@ -2122,45 +2153,45 @@ var V = class extends ee {
|
|
|
2122
2153
|
}
|
|
2123
2154
|
off(t, e) {
|
|
2124
2155
|
let s = super.off(t, e);
|
|
2125
|
-
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M2] && !this[
|
|
2156
|
+
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M2] && !this[F2].length && (this[v] = false)), s;
|
|
2126
2157
|
}
|
|
2127
2158
|
removeAllListeners(t) {
|
|
2128
2159
|
let e = super.removeAllListeners(t);
|
|
2129
|
-
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M2] && !this[
|
|
2160
|
+
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M2] && !this[F2].length && (this[v] = false)), e;
|
|
2130
2161
|
}
|
|
2131
2162
|
get emittedEnd() {
|
|
2132
2163
|
return this[K];
|
|
2133
2164
|
}
|
|
2134
|
-
[
|
|
2135
|
-
!this[kt] && !this[K] && !this[
|
|
2165
|
+
[H2]() {
|
|
2166
|
+
!this[kt] && !this[K] && !this[x] && 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);
|
|
2136
2167
|
}
|
|
2137
2168
|
emit(t, ...e) {
|
|
2138
2169
|
let s = e[0];
|
|
2139
|
-
if (t !== "error" && t !== "close" && t !==
|
|
2170
|
+
if (t !== "error" && t !== "close" && t !== x && this[x]) return false;
|
|
2140
2171
|
if (t === "data") return !this[k] && !s ? false : this[B] ? (mt(() => this[Jt](s)), true) : this[Jt](s);
|
|
2141
2172
|
if (t === "end") return this[We]();
|
|
2142
2173
|
if (t === "close") {
|
|
2143
|
-
if (this[Rt] = true, !this[K] && !this[
|
|
2174
|
+
if (this[Rt] = true, !this[K] && !this[x]) return false;
|
|
2144
2175
|
let r = super.emit("close");
|
|
2145
2176
|
return this.removeAllListeners("close"), r;
|
|
2146
2177
|
} else if (t === "error") {
|
|
2147
2178
|
this[ut] = s, super.emit(Xt, s);
|
|
2148
2179
|
let r = !this[pt] || this.listeners("error").length ? super.emit("error", s) : false;
|
|
2149
|
-
return this[
|
|
2180
|
+
return this[H2](), r;
|
|
2150
2181
|
} else if (t === "resume") {
|
|
2151
2182
|
let r = super.emit("resume");
|
|
2152
|
-
return this[
|
|
2183
|
+
return this[H2](), r;
|
|
2153
2184
|
} else if (t === "finish" || t === "prefinish") {
|
|
2154
2185
|
let r = super.emit(t);
|
|
2155
2186
|
return this.removeAllListeners(t), r;
|
|
2156
2187
|
}
|
|
2157
2188
|
let i = super.emit(t, ...e);
|
|
2158
|
-
return this[
|
|
2189
|
+
return this[H2](), i;
|
|
2159
2190
|
}
|
|
2160
2191
|
[Jt](t) {
|
|
2161
|
-
for (let s of this[
|
|
2192
|
+
for (let s of this[F2]) s.dest.write(t) === false && this.pause();
|
|
2162
2193
|
let e = this[M2] ? false : super.emit("data", t);
|
|
2163
|
-
return this[
|
|
2194
|
+
return this[H2](), e;
|
|
2164
2195
|
}
|
|
2165
2196
|
[We]() {
|
|
2166
2197
|
return this[K] ? false : (this[K] = true, this.readable = false, this[B] ? (mt(() => this[Zt]()), true) : this[Zt]());
|
|
@@ -2169,11 +2200,11 @@ var V = class extends ee {
|
|
|
2169
2200
|
if (this[et]) {
|
|
2170
2201
|
let e = this[et].end();
|
|
2171
2202
|
if (e) {
|
|
2172
|
-
for (let s of this[
|
|
2203
|
+
for (let s of this[F2]) s.dest.write(e);
|
|
2173
2204
|
this[M2] || super.emit("data", e);
|
|
2174
2205
|
}
|
|
2175
2206
|
}
|
|
2176
|
-
for (let e of this[
|
|
2207
|
+
for (let e of this[F2]) e.end();
|
|
2177
2208
|
let t = super.emit("end");
|
|
2178
2209
|
return this.removeAllListeners("end"), t;
|
|
2179
2210
|
}
|
|
@@ -2188,11 +2219,11 @@ var V = class extends ee {
|
|
|
2188
2219
|
async concat() {
|
|
2189
2220
|
if (this[k]) throw new Error("cannot concat in objectMode");
|
|
2190
2221
|
let t = await this.collect();
|
|
2191
|
-
return this[
|
|
2222
|
+
return this[P2] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
2192
2223
|
}
|
|
2193
2224
|
async promise() {
|
|
2194
2225
|
return new Promise((t, e) => {
|
|
2195
|
-
this.on(
|
|
2226
|
+
this.on(x, () => e(new Error("stream destroyed"))), this.on("error", (s) => e(s)), this.on("end", () => t());
|
|
2196
2227
|
});
|
|
2197
2228
|
}
|
|
2198
2229
|
[Symbol.asyncIterator]() {
|
|
@@ -2203,15 +2234,15 @@ var V = class extends ee {
|
|
|
2203
2234
|
let i = this.read();
|
|
2204
2235
|
if (i !== null) return Promise.resolve({ done: false, value: i });
|
|
2205
2236
|
if (this[G2]) return e();
|
|
2206
|
-
let r, o, h = (
|
|
2207
|
-
this.off("data", a), this.off("end", l), this.off(
|
|
2208
|
-
}, a = (
|
|
2209
|
-
this.off("error", h), this.off("end", l), this.off(
|
|
2237
|
+
let r, o, h = (c) => {
|
|
2238
|
+
this.off("data", a), this.off("end", l), this.off(x, u3), e(), o(c);
|
|
2239
|
+
}, a = (c) => {
|
|
2240
|
+
this.off("error", h), this.off("end", l), this.off(x, u3), this.pause(), r({ value: c, done: !!this[G2] });
|
|
2210
2241
|
}, l = () => {
|
|
2211
|
-
this.off("error", h), this.off("data", a), this.off(
|
|
2212
|
-
},
|
|
2213
|
-
return new Promise((
|
|
2214
|
-
o = d, r =
|
|
2242
|
+
this.off("error", h), this.off("data", a), this.off(x, u3), e(), r({ done: true, value: void 0 });
|
|
2243
|
+
}, u3 = () => h(new Error("stream destroyed"));
|
|
2244
|
+
return new Promise((c, d) => {
|
|
2245
|
+
o = d, r = c, this.once(x, u3), this.once("error", h), this.once("end", l), this.once("data", a);
|
|
2215
2246
|
});
|
|
2216
2247
|
}, throw: e, return: e, [Symbol.asyncIterator]() {
|
|
2217
2248
|
return this;
|
|
@@ -2220,21 +2251,21 @@ var V = class extends ee {
|
|
|
2220
2251
|
}
|
|
2221
2252
|
[Symbol.iterator]() {
|
|
2222
2253
|
this[M2] = false;
|
|
2223
|
-
let t = false, e = () => (this.pause(), this.off(Xt, e), this.off(
|
|
2254
|
+
let t = false, e = () => (this.pause(), this.off(Xt, e), this.off(x, e), this.off("end", e), t = true, { done: true, value: void 0 }), s = () => {
|
|
2224
2255
|
if (t) return e();
|
|
2225
2256
|
let i = this.read();
|
|
2226
2257
|
return i === null ? e() : { done: false, value: i };
|
|
2227
2258
|
};
|
|
2228
|
-
return this.once("end", e), this.once(Xt, e), this.once(
|
|
2259
|
+
return this.once("end", e), this.once(Xt, e), this.once(x, e), { next: s, throw: e, return: e, [Symbol.iterator]() {
|
|
2229
2260
|
return this;
|
|
2230
2261
|
}, [Symbol.dispose]: () => {
|
|
2231
2262
|
} };
|
|
2232
2263
|
}
|
|
2233
2264
|
destroy(t) {
|
|
2234
|
-
if (this[
|
|
2235
|
-
this[
|
|
2265
|
+
if (this[x]) return t ? this.emit("error", t) : this.emit(x), this;
|
|
2266
|
+
this[x] = true, this[M2] = true, this[C2].length = 0, this[T] = 0;
|
|
2236
2267
|
let e = this;
|
|
2237
|
-
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(
|
|
2268
|
+
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(x), this;
|
|
2238
2269
|
}
|
|
2239
2270
|
static get isStream() {
|
|
2240
2271
|
return oi;
|
|
@@ -2259,10 +2290,10 @@ var gt = ~_;
|
|
|
2259
2290
|
var se = 16;
|
|
2260
2291
|
var je = 32;
|
|
2261
2292
|
var yt = 64;
|
|
2262
|
-
var
|
|
2293
|
+
var j2 = 128;
|
|
2263
2294
|
var Nt = 256;
|
|
2264
2295
|
var Lt = 512;
|
|
2265
|
-
var Ie = yt |
|
|
2296
|
+
var Ie = yt | j2 | Lt;
|
|
2266
2297
|
var Fi = 1023;
|
|
2267
2298
|
var ie = (n7) => n7.isFile() ? Ke : n7.isDirectory() ? U2 : n7.isSymbolicLink() ? X : n7.isCharacterDevice() ? He : n7.isBlockDevice() ? qe : n7.isSocket() ? Ve : n7.isFIFO() ? Ge : L2;
|
|
2268
2299
|
var ze = new ft({ max: 2 ** 12 });
|
|
@@ -2417,7 +2448,7 @@ var R2 = class {
|
|
|
2417
2448
|
let s = this.children(), i = this.nocase ? _t(t) : bt(t);
|
|
2418
2449
|
for (let a of s) if (a.#C === i) return a;
|
|
2419
2450
|
let r = this.parent ? this.sep : "", o = this.#g ? this.#g + r + t : void 0, h = this.newChild(t, L2, { ...e, parent: this, fullpath: o });
|
|
2420
|
-
return this.canReaddir() || (h.#e |=
|
|
2451
|
+
return this.canReaddir() || (h.#e |= j2), s.push(h), h;
|
|
2421
2452
|
}
|
|
2422
2453
|
relative() {
|
|
2423
2454
|
if (this.isCWD) return "";
|
|
@@ -2500,13 +2531,13 @@ var R2 = class {
|
|
|
2500
2531
|
if (this.#M) return true;
|
|
2501
2532
|
if (!this.parent) return false;
|
|
2502
2533
|
let t = this.#e & _;
|
|
2503
|
-
return !(t !== L2 && t !== X || this.#e & Nt || this.#e &
|
|
2534
|
+
return !(t !== L2 && t !== X || this.#e & Nt || this.#e & j2);
|
|
2504
2535
|
}
|
|
2505
2536
|
calledReaddir() {
|
|
2506
2537
|
return !!(this.#e & se);
|
|
2507
2538
|
}
|
|
2508
2539
|
isENOENT() {
|
|
2509
|
-
return !!(this.#e &
|
|
2540
|
+
return !!(this.#e & j2);
|
|
2510
2541
|
}
|
|
2511
2542
|
isNamed(t) {
|
|
2512
2543
|
return this.nocase ? this.#C === _t(t) : this.#C === bt(t);
|
|
@@ -2541,7 +2572,7 @@ var R2 = class {
|
|
|
2541
2572
|
}
|
|
2542
2573
|
}
|
|
2543
2574
|
#v() {
|
|
2544
|
-
this.#e &
|
|
2575
|
+
this.#e & j2 || (this.#e = (this.#e | j2) & gt, this.#G());
|
|
2545
2576
|
}
|
|
2546
2577
|
#G() {
|
|
2547
2578
|
let t = this.children();
|
|
@@ -2564,7 +2595,7 @@ var R2 = class {
|
|
|
2564
2595
|
}
|
|
2565
2596
|
#D(t = "") {
|
|
2566
2597
|
let e = this.#e;
|
|
2567
|
-
e |= Nt, t === "ENOENT" && (e |=
|
|
2598
|
+
e |= Nt, t === "ENOENT" && (e |= j2), (t === "EINVAL" || t === "UNKNOWN") && (e &= gt), this.#e = e, t === "ENOTDIR" && this.parent && this.parent.#L();
|
|
2568
2599
|
}
|
|
2569
2600
|
#z(t, e) {
|
|
2570
2601
|
return this.#U(t, e) || this.#B(t, e);
|
|
@@ -2584,24 +2615,24 @@ var R2 = class {
|
|
|
2584
2615
|
return e.#e = e.#e & gt | ie(t), r !== t.name && (e.name = t.name), s !== i.provisional && (s === i.length - 1 ? i.pop() : i.splice(s, 1), i.unshift(e)), i.provisional++, e;
|
|
2585
2616
|
}
|
|
2586
2617
|
async lstat() {
|
|
2587
|
-
if ((this.#e &
|
|
2618
|
+
if ((this.#e & j2) === 0) try {
|
|
2588
2619
|
return this.#$(await this.#t.promises.lstat(this.fullpath())), this;
|
|
2589
2620
|
} catch (t) {
|
|
2590
2621
|
this.#F(t.code);
|
|
2591
2622
|
}
|
|
2592
2623
|
}
|
|
2593
2624
|
lstatSync() {
|
|
2594
|
-
if ((this.#e &
|
|
2625
|
+
if ((this.#e & j2) === 0) try {
|
|
2595
2626
|
return this.#$(this.#t.lstatSync(this.fullpath())), this;
|
|
2596
2627
|
} catch (t) {
|
|
2597
2628
|
this.#F(t.code);
|
|
2598
2629
|
}
|
|
2599
2630
|
}
|
|
2600
2631
|
#$(t) {
|
|
2601
|
-
let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: o, blocks: h, ctime: a, ctimeMs: l, dev:
|
|
2602
|
-
this.#b = e, this.#a = s, this.#m = i, this.#E = r, this.#c = o, this.#f = h, this.#R = a, this.#d = l, this.#s =
|
|
2603
|
-
let
|
|
2604
|
-
this.#e = this.#e & gt |
|
|
2632
|
+
let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: o, blocks: h, ctime: a, ctimeMs: l, dev: u3, gid: c, ino: d, mode: f, mtime: m, mtimeMs: p, nlink: w, rdev: g, size: S2, uid: E } = t;
|
|
2633
|
+
this.#b = e, this.#a = s, this.#m = i, this.#E = r, this.#c = o, this.#f = h, this.#R = a, this.#d = l, this.#s = u3, this.#S = c, this.#h = d, this.#n = f, this.#p = m, this.#i = p, this.#r = w, this.#w = g, this.#u = S2, this.#o = E;
|
|
2634
|
+
let y = ie(t);
|
|
2635
|
+
this.#e = this.#e & gt | y | je, y !== L2 && y !== U2 && y !== X && (this.#e |= yt);
|
|
2605
2636
|
}
|
|
2606
2637
|
#W = [];
|
|
2607
2638
|
#O = false;
|
|
@@ -2677,7 +2708,7 @@ var R2 = class {
|
|
|
2677
2708
|
}
|
|
2678
2709
|
async realpath() {
|
|
2679
2710
|
if (this.#k) return this.#k;
|
|
2680
|
-
if (!((Lt | Nt |
|
|
2711
|
+
if (!((Lt | Nt | j2) & this.#e)) try {
|
|
2681
2712
|
let t = await this.#t.promises.realpath(this.fullpath());
|
|
2682
2713
|
return this.#k = this.resolve(t);
|
|
2683
2714
|
} catch {
|
|
@@ -2686,7 +2717,7 @@ var R2 = class {
|
|
|
2686
2717
|
}
|
|
2687
2718
|
realpathSync() {
|
|
2688
2719
|
if (this.#k) return this.#k;
|
|
2689
|
-
if (!((Lt | Nt |
|
|
2720
|
+
if (!((Lt | Nt | j2) & this.#e)) try {
|
|
2690
2721
|
let t = this.#t.realpathSync(this.fullpath());
|
|
2691
2722
|
return this.#k = this.resolve(t);
|
|
2692
2723
|
} catch {
|
|
@@ -2755,10 +2786,10 @@ var It = class {
|
|
|
2755
2786
|
let a = h.substring(this.rootPath.length).split(s);
|
|
2756
2787
|
if (a.length === 1 && !a[0] && a.pop(), i === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor");
|
|
2757
2788
|
this.nocase = i, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root;
|
|
2758
|
-
let l = this.root,
|
|
2789
|
+
let l = this.root, u3 = a.length - 1, c = e.sep, d = this.rootPath, f = false;
|
|
2759
2790
|
for (let m of a) {
|
|
2760
|
-
let p =
|
|
2761
|
-
l = l.child(m, { relative: new Array(p).fill("..").join(
|
|
2791
|
+
let p = u3--;
|
|
2792
|
+
l = l.child(m, { relative: new Array(p).fill("..").join(c), relativePosix: new Array(p).fill("..").join("/"), fullpath: d += (f ? "" : c) + m }), f = true;
|
|
2762
2793
|
}
|
|
2763
2794
|
this.cwd = l;
|
|
2764
2795
|
}
|
|
@@ -2845,21 +2876,21 @@ var It = class {
|
|
|
2845
2876
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R2 || (e = t, t = this.cwd);
|
|
2846
2877
|
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = [];
|
|
2847
2878
|
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
2848
|
-
let a = /* @__PURE__ */ new Set(), l = (
|
|
2849
|
-
a.add(
|
|
2879
|
+
let a = /* @__PURE__ */ new Set(), l = (c, d) => {
|
|
2880
|
+
a.add(c), c.readdirCB((f, m) => {
|
|
2850
2881
|
if (f) return d(f);
|
|
2851
2882
|
let p = m.length;
|
|
2852
2883
|
if (!p) return d();
|
|
2853
2884
|
let w = () => {
|
|
2854
2885
|
--p === 0 && d();
|
|
2855
2886
|
};
|
|
2856
|
-
for (let g of m) (!r || r(g)) && h.push(s ? g : g.fullpath()), i && g.isSymbolicLink() ? g.realpath().then((
|
|
2887
|
+
for (let g of m) (!r || r(g)) && h.push(s ? g : g.fullpath()), i && g.isSymbolicLink() ? g.realpath().then((S2) => S2?.isUnknown() ? S2.lstat() : S2).then((S2) => S2?.shouldWalk(a, o) ? l(S2, w) : w()) : g.shouldWalk(a, o) ? l(g, w) : w();
|
|
2857
2888
|
}, true);
|
|
2858
|
-
},
|
|
2859
|
-
return new Promise((
|
|
2860
|
-
l(
|
|
2889
|
+
}, u3 = t;
|
|
2890
|
+
return new Promise((c, d) => {
|
|
2891
|
+
l(u3, (f) => {
|
|
2861
2892
|
if (f) return d(f);
|
|
2862
|
-
|
|
2893
|
+
c(h);
|
|
2863
2894
|
});
|
|
2864
2895
|
});
|
|
2865
2896
|
}
|
|
@@ -2869,12 +2900,12 @@ var It = class {
|
|
|
2869
2900
|
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
2870
2901
|
let a = /* @__PURE__ */ new Set([t]);
|
|
2871
2902
|
for (let l of a) {
|
|
2872
|
-
let
|
|
2873
|
-
for (let
|
|
2874
|
-
(!r || r(
|
|
2875
|
-
let d =
|
|
2876
|
-
if (
|
|
2877
|
-
if (!(i && (d =
|
|
2903
|
+
let u3 = l.readdirSync();
|
|
2904
|
+
for (let c of u3) {
|
|
2905
|
+
(!r || r(c)) && h.push(s ? c : c.fullpath());
|
|
2906
|
+
let d = c;
|
|
2907
|
+
if (c.isSymbolicLink()) {
|
|
2908
|
+
if (!(i && (d = c.realpathSync()))) continue;
|
|
2878
2909
|
d.isUnknown() && d.lstatSync();
|
|
2879
2910
|
}
|
|
2880
2911
|
d.shouldWalk(a, o) && a.add(d);
|
|
@@ -2898,14 +2929,14 @@ var It = class {
|
|
|
2898
2929
|
let h = /* @__PURE__ */ new Set([t]);
|
|
2899
2930
|
for (let a of h) {
|
|
2900
2931
|
let l = a.readdirSync();
|
|
2901
|
-
for (let
|
|
2902
|
-
(!r || r(
|
|
2903
|
-
let
|
|
2904
|
-
if (
|
|
2905
|
-
if (!(i && (
|
|
2906
|
-
|
|
2932
|
+
for (let u3 of l) {
|
|
2933
|
+
(!r || r(u3)) && (yield s ? u3 : u3.fullpath());
|
|
2934
|
+
let c = u3;
|
|
2935
|
+
if (u3.isSymbolicLink()) {
|
|
2936
|
+
if (!(i && (c = u3.realpathSync()))) continue;
|
|
2937
|
+
c.isUnknown() && c.lstatSync();
|
|
2907
2938
|
}
|
|
2908
|
-
|
|
2939
|
+
c.shouldWalk(h, o) && h.add(c);
|
|
2909
2940
|
}
|
|
2910
2941
|
}
|
|
2911
2942
|
}
|
|
@@ -2913,54 +2944,54 @@ var It = class {
|
|
|
2913
2944
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R2 || (e = t, t = this.cwd);
|
|
2914
2945
|
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true });
|
|
2915
2946
|
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
2916
|
-
let a = /* @__PURE__ */ new Set(), l = [t],
|
|
2947
|
+
let a = /* @__PURE__ */ new Set(), l = [t], u3 = 0, c = () => {
|
|
2917
2948
|
let d = false;
|
|
2918
2949
|
for (; !d; ) {
|
|
2919
2950
|
let f = l.shift();
|
|
2920
2951
|
if (!f) {
|
|
2921
|
-
|
|
2952
|
+
u3 === 0 && h.end();
|
|
2922
2953
|
return;
|
|
2923
2954
|
}
|
|
2924
|
-
|
|
2925
|
-
let m = (w, g,
|
|
2955
|
+
u3++, a.add(f);
|
|
2956
|
+
let m = (w, g, S2 = false) => {
|
|
2926
2957
|
if (w) return h.emit("error", w);
|
|
2927
|
-
if (i && !
|
|
2958
|
+
if (i && !S2) {
|
|
2928
2959
|
let E = [];
|
|
2929
|
-
for (let
|
|
2960
|
+
for (let y of g) y.isSymbolicLink() && E.push(y.realpath().then((b) => b?.isUnknown() ? b.lstat() : b));
|
|
2930
2961
|
if (E.length) {
|
|
2931
2962
|
Promise.all(E).then(() => m(null, g, true));
|
|
2932
2963
|
return;
|
|
2933
2964
|
}
|
|
2934
2965
|
}
|
|
2935
2966
|
for (let E of g) E && (!r || r(E)) && (h.write(s ? E : E.fullpath()) || (d = true));
|
|
2936
|
-
|
|
2967
|
+
u3--;
|
|
2937
2968
|
for (let E of g) {
|
|
2938
|
-
let
|
|
2939
|
-
|
|
2969
|
+
let y = E.realpathCached() || E;
|
|
2970
|
+
y.shouldWalk(a, o) && l.push(y);
|
|
2940
2971
|
}
|
|
2941
|
-
d && !h.flowing ? h.once("drain",
|
|
2972
|
+
d && !h.flowing ? h.once("drain", c) : p || c();
|
|
2942
2973
|
}, p = true;
|
|
2943
2974
|
f.readdirCB(m, true), p = false;
|
|
2944
2975
|
}
|
|
2945
2976
|
};
|
|
2946
|
-
return
|
|
2977
|
+
return c(), h;
|
|
2947
2978
|
}
|
|
2948
2979
|
streamSync(t = this.cwd, e = {}) {
|
|
2949
2980
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R2 || (e = t, t = this.cwd);
|
|
2950
2981
|
let { withFileTypes: s = true, follow: i = false, filter: r, walkFilter: o } = e, h = new V({ objectMode: true }), a = /* @__PURE__ */ new Set();
|
|
2951
2982
|
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
2952
|
-
let l = [t],
|
|
2983
|
+
let l = [t], u3 = 0, c = () => {
|
|
2953
2984
|
let d = false;
|
|
2954
2985
|
for (; !d; ) {
|
|
2955
2986
|
let f = l.shift();
|
|
2956
2987
|
if (!f) {
|
|
2957
|
-
|
|
2988
|
+
u3 === 0 && h.end();
|
|
2958
2989
|
return;
|
|
2959
2990
|
}
|
|
2960
|
-
|
|
2991
|
+
u3++, a.add(f);
|
|
2961
2992
|
let m = f.readdirSync();
|
|
2962
2993
|
for (let p of m) (!r || r(p)) && (h.write(s ? p : p.fullpath()) || (d = true));
|
|
2963
|
-
|
|
2994
|
+
u3--;
|
|
2964
2995
|
for (let p of m) {
|
|
2965
2996
|
let w = p;
|
|
2966
2997
|
if (p.isSymbolicLink()) {
|
|
@@ -2970,9 +3001,9 @@ var It = class {
|
|
|
2970
3001
|
w.shouldWalk(a, o) && l.push(w);
|
|
2971
3002
|
}
|
|
2972
3003
|
}
|
|
2973
|
-
d && !h.flowing && h.once("drain",
|
|
3004
|
+
d && !h.flowing && h.once("drain", c);
|
|
2974
3005
|
};
|
|
2975
|
-
return
|
|
3006
|
+
return c(), h;
|
|
2976
3007
|
}
|
|
2977
3008
|
chdir(t = this.cwd) {
|
|
2978
3009
|
let e = this.cwd;
|
|
@@ -3042,15 +3073,15 @@ var nt = class n4 {
|
|
|
3042
3073
|
if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range");
|
|
3043
3074
|
if (this.#t = t, this.#s = e, this.#n = s, this.#r = i, this.#n === 0) {
|
|
3044
3075
|
if (this.isUNC()) {
|
|
3045
|
-
let [r, o, h, a, ...l] = this.#t, [
|
|
3076
|
+
let [r, o, h, a, ...l] = this.#t, [u3, c, d, f, ...m] = this.#s;
|
|
3046
3077
|
l[0] === "" && (l.shift(), m.shift());
|
|
3047
|
-
let p = [r, o, h, a, ""].join("/"), w = [
|
|
3078
|
+
let p = [r, o, h, a, ""].join("/"), w = [u3, c, d, f, ""].join("/");
|
|
3048
3079
|
this.#t = [p, ...l], this.#s = [w, ...m], this.length = this.#t.length;
|
|
3049
3080
|
} else if (this.isDrive() || this.isAbsolute()) {
|
|
3050
3081
|
let [r, ...o] = this.#t, [h, ...a] = this.#s;
|
|
3051
3082
|
o[0] === "" && (o.shift(), a.shift());
|
|
3052
|
-
let l = r + "/",
|
|
3053
|
-
this.#t = [l, ...o], this.#s = [
|
|
3083
|
+
let l = r + "/", u3 = h + "/";
|
|
3084
|
+
this.#t = [l, ...o], this.#s = [u3, ...a], this.length = this.#t.length;
|
|
3054
3085
|
}
|
|
3055
3086
|
}
|
|
3056
3087
|
}
|
|
@@ -3200,29 +3231,29 @@ var Et = class n6 {
|
|
|
3200
3231
|
let o = r.root(), h = r.isAbsolute() && this.opts.absolute !== false;
|
|
3201
3232
|
if (o) {
|
|
3202
3233
|
i = i.resolve(o === "/" && this.opts.root !== void 0 ? this.opts.root : o);
|
|
3203
|
-
let
|
|
3204
|
-
if (
|
|
3234
|
+
let c = r.rest();
|
|
3235
|
+
if (c) r = c;
|
|
3205
3236
|
else {
|
|
3206
3237
|
this.matches.add(i, true, false);
|
|
3207
3238
|
continue;
|
|
3208
3239
|
}
|
|
3209
3240
|
}
|
|
3210
3241
|
if (i.isENOENT()) continue;
|
|
3211
|
-
let a, l,
|
|
3212
|
-
for (; typeof (a = r.pattern()) == "string" && (l = r.rest()); ) i = i.resolve(a), r = l,
|
|
3213
|
-
if (a = r.pattern(), l = r.rest(),
|
|
3242
|
+
let a, l, u3 = false;
|
|
3243
|
+
for (; typeof (a = r.pattern()) == "string" && (l = r.rest()); ) i = i.resolve(a), r = l, u3 = true;
|
|
3244
|
+
if (a = r.pattern(), l = r.rest(), u3) {
|
|
3214
3245
|
if (this.hasWalkedCache.hasWalked(i, r)) continue;
|
|
3215
3246
|
this.hasWalkedCache.storeWalked(i, r);
|
|
3216
3247
|
}
|
|
3217
3248
|
if (typeof a == "string") {
|
|
3218
|
-
let
|
|
3219
|
-
this.matches.add(i.resolve(a), h,
|
|
3249
|
+
let c = a === ".." || a === "" || a === ".";
|
|
3250
|
+
this.matches.add(i.resolve(a), h, c);
|
|
3220
3251
|
continue;
|
|
3221
3252
|
} else if (a === A) {
|
|
3222
3253
|
(!i.isSymbolicLink() || this.follow || r.checkFollowGlobstar()) && this.subwalks.add(i, r);
|
|
3223
|
-
let
|
|
3224
|
-
if (!l || (
|
|
3225
|
-
else if (
|
|
3254
|
+
let c = l?.pattern(), d = l?.rest();
|
|
3255
|
+
if (!l || (c === "" || c === ".") && !d) this.matches.add(i, h, c === "" || c === ".");
|
|
3256
|
+
else if (c === "..") {
|
|
3226
3257
|
let f = i.parent || i;
|
|
3227
3258
|
d ? this.hasWalkedCache.hasWalked(f, d) || this.subwalks.add(f, d) : this.matches.add(f, h, true);
|
|
3228
3259
|
}
|
|
@@ -3377,7 +3408,7 @@ var zt = class {
|
|
|
3377
3408
|
if (this.maxDepth !== 1 / 0 && h.depth() >= this.maxDepth) continue;
|
|
3378
3409
|
r++;
|
|
3379
3410
|
let a = h.readdirCached();
|
|
3380
|
-
h.calledReaddir() ? this.walkCB3(h, a, s, o) : h.readdirCB((l,
|
|
3411
|
+
h.calledReaddir() ? this.walkCB3(h, a, s, o) : h.readdirCB((l, u3) => this.walkCB3(h, u3, s, o), true);
|
|
3381
3412
|
}
|
|
3382
3413
|
o();
|
|
3383
3414
|
}
|
|
@@ -3508,9 +3539,9 @@ var I2 = class {
|
|
|
3508
3539
|
this.nocase = this.scurry.nocase;
|
|
3509
3540
|
let s = this.platform === "darwin" || this.platform === "win32", i = { braceExpandMax: 1e4, ...e, dot: this.dot, matchBase: this.matchBase, nobrace: this.nobrace, nocase: this.nocase, nocaseMagicOnly: s, nocomment: true, noext: this.noext, nonegate: true, optimizationLevel: 2, platform: this.platform, windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }, r = this.pattern.map((a) => new D2(a, i)), [o, h] = r.reduce((a, l) => (a[0].push(...l.set), a[1].push(...l.globParts), a), [[], []]);
|
|
3510
3541
|
this.patterns = o.map((a, l) => {
|
|
3511
|
-
let
|
|
3512
|
-
if (!
|
|
3513
|
-
return new nt(a,
|
|
3542
|
+
let u3 = h[l];
|
|
3543
|
+
if (!u3) throw new Error("invalid pattern object");
|
|
3544
|
+
return new nt(a, u3, 0, this.platform);
|
|
3514
3545
|
});
|
|
3515
3546
|
}
|
|
3516
3547
|
async walk() {
|
|
@@ -4532,15 +4563,15 @@ var main = async (path, input = process.stdin) => {
|
|
|
4532
4563
|
const readSize = (buf, offset) => {
|
|
4533
4564
|
const a = buf[offset];
|
|
4534
4565
|
const b = buf[offset + 1];
|
|
4535
|
-
const
|
|
4566
|
+
const c = buf[offset + 2];
|
|
4536
4567
|
const d = buf[offset + 3];
|
|
4537
|
-
if (a === void 0 || b === void 0 ||
|
|
4568
|
+
if (a === void 0 || b === void 0 || c === void 0 || d === void 0) {
|
|
4538
4569
|
throw error("Invalid buffer, not long enough to readSize", {
|
|
4539
4570
|
found: buf,
|
|
4540
4571
|
offset
|
|
4541
4572
|
});
|
|
4542
4573
|
}
|
|
4543
|
-
return a << 24 | b << 16 |
|
|
4574
|
+
return a << 24 | b << 16 | c << 8 | d;
|
|
4544
4575
|
};
|
|
4545
4576
|
const results = await Promise.all(
|
|
4546
4577
|
keys.map(async (key) => {
|