@unocss/language-server 66.6.6 → 66.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-C9ebiww4.mjs → chunk-CBBoxR_p.mjs} +8 -14
- package/dist/{dist-Dwf-d4OE.mjs → dist-DJp734Em.mjs} +2 -4
- package/dist/{dist-BUrt6dYo.cjs → dist-FL7p7uq2.cjs} +17 -20
- package/dist/index.d.mts +8 -3
- package/dist/index.mjs +683 -719
- package/dist/jiti-du6HSta6.cjs +4474 -0
- package/dist/{loader-CxlILAbz.mjs → loader-DsXvVy9i.mjs} +4 -19
- package/dist/{multipart-parser-s9tbX9e1.cjs → multipart-parser-DiNB_U8f.cjs} +13 -15
- package/dist/{multipart-parser-D3zGHRx2.mjs → multipart-parser-KkZpcbcp.mjs} +3 -5
- package/dist/{node-B8nS8lcG.cjs → node-3wiZdXIz.cjs} +40 -42
- package/dist/{node-CautW6cw.cjs → node-BM09n__k.cjs} +969 -967
- package/dist/{node-rKyHxxpg.mjs → node-Cd2HRubI.mjs} +930 -928
- package/dist/{node-DvibxqDE.mjs → node-D23LglTq.mjs} +32 -34
- package/dist/{node-loader-BO0uvH6Z.cjs → node-loader-BJV6yUBJ.cjs} +676 -689
- package/dist/{node-loader-DpZIWCu9.mjs → node-loader-ZSa5xzQw.mjs} +440 -453
- package/dist/{prompt-BJqhZQ-_.cjs → prompt-jldWOuck.cjs} +265 -267
- package/dist/server.cjs +14417 -14572
- package/package.json +39 -6
- package/dist/jiti-B459FbZV.cjs +0 -4477
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_server = require(
|
|
2
|
-
const require_dist = require(
|
|
1
|
+
const require_server = require("./server.cjs");
|
|
2
|
+
const require_dist = require("./dist-FL7p7uq2.cjs");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_server.__toESM(node_path);
|
|
5
5
|
let node_process = require("node:process");
|
|
@@ -21,7 +21,6 @@ let node_assert = require("node:assert");
|
|
|
21
21
|
node_assert = require_server.__toESM(node_assert);
|
|
22
22
|
let node_v8 = require("node:v8");
|
|
23
23
|
node_v8 = require_server.__toESM(node_v8);
|
|
24
|
-
|
|
25
24
|
//#region ../../node_modules/.pnpm/@iconify+utils@3.1.0/node_modules/@iconify/utils/lib/loader/warn.js
|
|
26
25
|
const warned = /* @__PURE__ */ new Set();
|
|
27
26
|
function warnOnce(msg) {
|
|
@@ -30,7 +29,6 @@ function warnOnce(msg) {
|
|
|
30
29
|
console.warn((0, node_util.styleText)("yellow", `[@iconify-loader] ${msg}`));
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
//#endregion
|
|
35
33
|
//#region ../../node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/constants.mjs
|
|
36
34
|
const AGENTS = [
|
|
@@ -63,7 +61,6 @@ const INSTALL_METADATA = {
|
|
|
63
61
|
"bun.lock": "bun",
|
|
64
62
|
"bun.lockb": "bun"
|
|
65
63
|
};
|
|
66
|
-
|
|
67
64
|
//#endregion
|
|
68
65
|
//#region ../../node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/detect.mjs
|
|
69
66
|
async function pathExists(path2, type) {
|
|
@@ -134,7 +131,7 @@ async function detect(options = {}) {
|
|
|
134
131
|
return null;
|
|
135
132
|
}
|
|
136
133
|
function getNameAndVer(pkg) {
|
|
137
|
-
const handelVer = (version
|
|
134
|
+
const handelVer = (version) => version?.match(/\d+(\.\d+){0,2}/)?.[0] ?? version;
|
|
138
135
|
if (typeof pkg.packageManager === "string") {
|
|
139
136
|
const [name, ver] = pkg.packageManager.replace(/^\^/, "").split("@");
|
|
140
137
|
return {
|
|
@@ -156,28 +153,28 @@ async function handlePackageManager(filepath, options) {
|
|
|
156
153
|
if (nameAndVer) {
|
|
157
154
|
const name = nameAndVer.name;
|
|
158
155
|
const ver = nameAndVer.ver;
|
|
159
|
-
let version
|
|
156
|
+
let version = ver;
|
|
160
157
|
if (name === "yarn" && ver && Number.parseInt(ver) > 1) {
|
|
161
158
|
agent = "yarn@berry";
|
|
162
|
-
version
|
|
159
|
+
version = "berry";
|
|
163
160
|
return {
|
|
164
161
|
name,
|
|
165
162
|
agent,
|
|
166
|
-
version
|
|
163
|
+
version
|
|
167
164
|
};
|
|
168
165
|
} else if (name === "pnpm" && ver && Number.parseInt(ver) < 7) {
|
|
169
166
|
agent = "pnpm@6";
|
|
170
167
|
return {
|
|
171
168
|
name,
|
|
172
169
|
agent,
|
|
173
|
-
version
|
|
170
|
+
version
|
|
174
171
|
};
|
|
175
172
|
} else if (AGENTS.includes(name)) {
|
|
176
173
|
agent = name;
|
|
177
174
|
return {
|
|
178
175
|
name,
|
|
179
176
|
agent,
|
|
180
|
-
version
|
|
177
|
+
version
|
|
181
178
|
};
|
|
182
179
|
} else return options.onUnknown?.(pkg.packageManager) ?? null;
|
|
183
180
|
}
|
|
@@ -187,7 +184,6 @@ async function handlePackageManager(filepath, options) {
|
|
|
187
184
|
function isMetadataYarnClassic(metadataPath) {
|
|
188
185
|
return metadataPath.endsWith(".yarn_integrity");
|
|
189
186
|
}
|
|
190
|
-
|
|
191
187
|
//#endregion
|
|
192
188
|
//#region ../../node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.js
|
|
193
189
|
var l = Object.create;
|
|
@@ -196,443 +192,443 @@ var d = Object.getOwnPropertyDescriptor;
|
|
|
196
192
|
var f = Object.getOwnPropertyNames;
|
|
197
193
|
var p = Object.getPrototypeOf;
|
|
198
194
|
var m = Object.prototype.hasOwnProperty;
|
|
199
|
-
var h = (e
|
|
200
|
-
var g = (e
|
|
201
|
-
if (t
|
|
202
|
-
s
|
|
203
|
-
if (!m.call(e
|
|
204
|
-
get: ((e
|
|
205
|
-
enumerable: !(r
|
|
195
|
+
var h = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
|
|
196
|
+
var g = (e, t, n, r) => {
|
|
197
|
+
if (t && typeof t === "object" || typeof t === "function") for (var i = f(t), a = 0, o = i.length, s; a < o; a++) {
|
|
198
|
+
s = i[a];
|
|
199
|
+
if (!m.call(e, s) && s !== n) u(e, s, {
|
|
200
|
+
get: ((e) => t[e]).bind(null, s),
|
|
201
|
+
enumerable: !(r = d(t, s)) || r.enumerable
|
|
206
202
|
});
|
|
207
203
|
}
|
|
208
|
-
return e
|
|
204
|
+
return e;
|
|
209
205
|
};
|
|
210
|
-
var _ = (e
|
|
211
|
-
value: e
|
|
206
|
+
var _ = (e, t, n) => (n = e != null ? l(p(e)) : {}, g(t || !e || !e.__esModule ? u(n, "default", {
|
|
207
|
+
value: e,
|
|
212
208
|
enumerable: true
|
|
213
|
-
}) : n
|
|
209
|
+
}) : n, e));
|
|
214
210
|
var v = /* @__PURE__ */ (0, module$1.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
215
211
|
const y = /^path$/i;
|
|
216
212
|
const b = {
|
|
217
213
|
key: "PATH",
|
|
218
214
|
value: ""
|
|
219
215
|
};
|
|
220
|
-
function x(e
|
|
221
|
-
for (const t
|
|
222
|
-
if (!Object.prototype.hasOwnProperty.call(e
|
|
223
|
-
const n
|
|
224
|
-
if (!n
|
|
216
|
+
function x(e) {
|
|
217
|
+
for (const t in e) {
|
|
218
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !y.test(t)) continue;
|
|
219
|
+
const n = e[t];
|
|
220
|
+
if (!n) return b;
|
|
225
221
|
return {
|
|
226
|
-
key: t
|
|
227
|
-
value: n
|
|
222
|
+
key: t,
|
|
223
|
+
value: n
|
|
228
224
|
};
|
|
229
225
|
}
|
|
230
226
|
return b;
|
|
231
227
|
}
|
|
232
|
-
function S(e
|
|
233
|
-
const i
|
|
234
|
-
let o
|
|
235
|
-
let s
|
|
228
|
+
function S(e, t) {
|
|
229
|
+
const i = t.value.split(node_path.delimiter);
|
|
230
|
+
let o = e;
|
|
231
|
+
let s;
|
|
236
232
|
do {
|
|
237
|
-
i
|
|
238
|
-
s
|
|
239
|
-
o
|
|
240
|
-
} while (o
|
|
233
|
+
i.push((0, node_path.resolve)(o, "node_modules", ".bin"));
|
|
234
|
+
s = o;
|
|
235
|
+
o = (0, node_path.dirname)(o);
|
|
236
|
+
} while (o !== s);
|
|
241
237
|
return {
|
|
242
|
-
key: t
|
|
243
|
-
value: i
|
|
238
|
+
key: t.key,
|
|
239
|
+
value: i.join(node_path.delimiter)
|
|
244
240
|
};
|
|
245
241
|
}
|
|
246
|
-
function C(e
|
|
247
|
-
const n
|
|
242
|
+
function C(e, t) {
|
|
243
|
+
const n = {
|
|
248
244
|
...process.env,
|
|
249
|
-
...t
|
|
245
|
+
...t
|
|
250
246
|
};
|
|
251
|
-
const r
|
|
252
|
-
n
|
|
253
|
-
return n
|
|
247
|
+
const r = S(e, x(n));
|
|
248
|
+
n[r.key] = r.value;
|
|
249
|
+
return n;
|
|
254
250
|
}
|
|
255
|
-
const w = (e
|
|
256
|
-
let t
|
|
257
|
-
const n
|
|
258
|
-
const r
|
|
259
|
-
if (--t
|
|
251
|
+
const w = (e) => {
|
|
252
|
+
let t = e.length;
|
|
253
|
+
const n = new node_stream.PassThrough();
|
|
254
|
+
const r = () => {
|
|
255
|
+
if (--t === 0) n.emit("end");
|
|
260
256
|
};
|
|
261
|
-
for (const t
|
|
262
|
-
t
|
|
263
|
-
t
|
|
264
|
-
}
|
|
265
|
-
return n
|
|
266
|
-
};
|
|
267
|
-
var T = h((exports
|
|
268
|
-
t
|
|
269
|
-
a
|
|
270
|
-
var n
|
|
271
|
-
function r
|
|
272
|
-
var n
|
|
273
|
-
if (!n
|
|
274
|
-
n
|
|
275
|
-
if (n
|
|
276
|
-
for (var r
|
|
277
|
-
var i
|
|
278
|
-
if (i
|
|
257
|
+
for (const t of e) {
|
|
258
|
+
t.pipe(n, { end: false });
|
|
259
|
+
t.on("end", r);
|
|
260
|
+
}
|
|
261
|
+
return n;
|
|
262
|
+
};
|
|
263
|
+
var T = h((exports, t) => {
|
|
264
|
+
t.exports = a;
|
|
265
|
+
a.sync = o;
|
|
266
|
+
var n = v("fs");
|
|
267
|
+
function r(e, t) {
|
|
268
|
+
var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
|
|
269
|
+
if (!n) return true;
|
|
270
|
+
n = n.split(";");
|
|
271
|
+
if (n.indexOf("") !== -1) return true;
|
|
272
|
+
for (var r = 0; r < n.length; r++) {
|
|
273
|
+
var i = n[r].toLowerCase();
|
|
274
|
+
if (i && e.substr(-i.length).toLowerCase() === i) return true;
|
|
279
275
|
}
|
|
280
276
|
return false;
|
|
281
277
|
}
|
|
282
|
-
function i
|
|
283
|
-
if (!e
|
|
284
|
-
return r
|
|
278
|
+
function i(e, t, n) {
|
|
279
|
+
if (!e.isSymbolicLink() && !e.isFile()) return false;
|
|
280
|
+
return r(t, n);
|
|
285
281
|
}
|
|
286
|
-
function a
|
|
287
|
-
n
|
|
288
|
-
r
|
|
282
|
+
function a(e, t, r) {
|
|
283
|
+
n.stat(e, function(n, a) {
|
|
284
|
+
r(n, n ? false : i(a, e, t));
|
|
289
285
|
});
|
|
290
286
|
}
|
|
291
|
-
function o
|
|
292
|
-
return i
|
|
287
|
+
function o(e, t) {
|
|
288
|
+
return i(n.statSync(e), e, t);
|
|
293
289
|
}
|
|
294
290
|
});
|
|
295
|
-
var E = h((exports
|
|
296
|
-
t
|
|
297
|
-
r
|
|
298
|
-
var n
|
|
299
|
-
function r
|
|
300
|
-
n
|
|
301
|
-
r
|
|
291
|
+
var E = h((exports, t) => {
|
|
292
|
+
t.exports = r;
|
|
293
|
+
r.sync = i;
|
|
294
|
+
var n = v("fs");
|
|
295
|
+
function r(e, t, r) {
|
|
296
|
+
n.stat(e, function(e, n) {
|
|
297
|
+
r(e, e ? false : a(n, t));
|
|
302
298
|
});
|
|
303
299
|
}
|
|
304
|
-
function i
|
|
305
|
-
return a
|
|
300
|
+
function i(e, t) {
|
|
301
|
+
return a(n.statSync(e), t);
|
|
306
302
|
}
|
|
307
|
-
function a
|
|
308
|
-
return e
|
|
303
|
+
function a(e, t) {
|
|
304
|
+
return e.isFile() && o(e, t);
|
|
309
305
|
}
|
|
310
|
-
function o
|
|
311
|
-
var n
|
|
312
|
-
var r
|
|
313
|
-
var i
|
|
314
|
-
var a
|
|
315
|
-
var o
|
|
316
|
-
var s
|
|
317
|
-
var c
|
|
318
|
-
var l
|
|
319
|
-
var u
|
|
320
|
-
return n
|
|
306
|
+
function o(e, t) {
|
|
307
|
+
var n = e.mode;
|
|
308
|
+
var r = e.uid;
|
|
309
|
+
var i = e.gid;
|
|
310
|
+
var a = t.uid !== void 0 ? t.uid : process.getuid && process.getuid();
|
|
311
|
+
var o = t.gid !== void 0 ? t.gid : process.getgid && process.getgid();
|
|
312
|
+
var s = parseInt("100", 8);
|
|
313
|
+
var c = parseInt("010", 8);
|
|
314
|
+
var l = parseInt("001", 8);
|
|
315
|
+
var u = s | c;
|
|
316
|
+
return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
|
|
321
317
|
}
|
|
322
318
|
});
|
|
323
|
-
var D = h((exports
|
|
319
|
+
var D = h((exports, t) => {
|
|
324
320
|
v("fs");
|
|
325
|
-
var r
|
|
326
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) r
|
|
327
|
-
else r
|
|
328
|
-
t
|
|
329
|
-
i
|
|
330
|
-
function i
|
|
331
|
-
if (typeof t
|
|
332
|
-
n
|
|
333
|
-
t
|
|
321
|
+
var r;
|
|
322
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) r = T();
|
|
323
|
+
else r = E();
|
|
324
|
+
t.exports = i;
|
|
325
|
+
i.sync = a;
|
|
326
|
+
function i(e, t, n) {
|
|
327
|
+
if (typeof t === "function") {
|
|
328
|
+
n = t;
|
|
329
|
+
t = {};
|
|
334
330
|
}
|
|
335
|
-
if (!n
|
|
331
|
+
if (!n) {
|
|
336
332
|
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
337
|
-
return new Promise(function(n
|
|
338
|
-
i
|
|
339
|
-
if (e
|
|
340
|
-
else n
|
|
333
|
+
return new Promise(function(n, r) {
|
|
334
|
+
i(e, t || {}, function(e, t) {
|
|
335
|
+
if (e) r(e);
|
|
336
|
+
else n(t);
|
|
341
337
|
});
|
|
342
338
|
});
|
|
343
339
|
}
|
|
344
|
-
r
|
|
345
|
-
if (e
|
|
346
|
-
if (e
|
|
347
|
-
e
|
|
348
|
-
r
|
|
340
|
+
r(e, t || {}, function(e, r) {
|
|
341
|
+
if (e) {
|
|
342
|
+
if (e.code === "EACCES" || t && t.ignoreErrors) {
|
|
343
|
+
e = null;
|
|
344
|
+
r = false;
|
|
349
345
|
}
|
|
350
346
|
}
|
|
351
|
-
n
|
|
347
|
+
n(e, r);
|
|
352
348
|
});
|
|
353
349
|
}
|
|
354
|
-
function a
|
|
350
|
+
function a(e, t) {
|
|
355
351
|
try {
|
|
356
|
-
return r
|
|
357
|
-
} catch (e
|
|
358
|
-
if (t
|
|
359
|
-
else throw e
|
|
352
|
+
return r.sync(e, t || {});
|
|
353
|
+
} catch (e) {
|
|
354
|
+
if (t && t.ignoreErrors || e.code === "EACCES") return false;
|
|
355
|
+
else throw e;
|
|
360
356
|
}
|
|
361
357
|
}
|
|
362
358
|
});
|
|
363
|
-
var O = h((exports
|
|
364
|
-
const n
|
|
365
|
-
const r
|
|
366
|
-
const i
|
|
367
|
-
const a
|
|
368
|
-
const o
|
|
369
|
-
const s
|
|
370
|
-
const r
|
|
371
|
-
const a
|
|
372
|
-
const o
|
|
373
|
-
const s
|
|
374
|
-
if (n
|
|
375
|
-
if (e
|
|
359
|
+
var O = h((exports, t) => {
|
|
360
|
+
const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
361
|
+
const r = v("path");
|
|
362
|
+
const i = n ? ";" : ":";
|
|
363
|
+
const a = D();
|
|
364
|
+
const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
|
|
365
|
+
const s = (e, t) => {
|
|
366
|
+
const r = t.colon || i;
|
|
367
|
+
const a = e.match(/\//) || n && e.match(/\\/) ? [""] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || "").split(r)];
|
|
368
|
+
const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
369
|
+
const s = n ? o.split(r) : [""];
|
|
370
|
+
if (n) {
|
|
371
|
+
if (e.indexOf(".") !== -1 && s[0] !== "") s.unshift("");
|
|
376
372
|
}
|
|
377
373
|
return {
|
|
378
|
-
pathEnv: a
|
|
379
|
-
pathExt: s
|
|
380
|
-
pathExtExe: o
|
|
374
|
+
pathEnv: a,
|
|
375
|
+
pathExt: s,
|
|
376
|
+
pathExtExe: o
|
|
381
377
|
};
|
|
382
378
|
};
|
|
383
|
-
const c
|
|
384
|
-
if (typeof t
|
|
385
|
-
n
|
|
386
|
-
t
|
|
379
|
+
const c = (e, t, n) => {
|
|
380
|
+
if (typeof t === "function") {
|
|
381
|
+
n = t;
|
|
382
|
+
t = {};
|
|
387
383
|
}
|
|
388
|
-
if (!t
|
|
389
|
-
const { pathEnv: i
|
|
390
|
-
const u
|
|
391
|
-
const d
|
|
392
|
-
if (n
|
|
393
|
-
const c
|
|
394
|
-
const l
|
|
395
|
-
const d
|
|
396
|
-
a
|
|
384
|
+
if (!t) t = {};
|
|
385
|
+
const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
|
|
386
|
+
const u = [];
|
|
387
|
+
const d = (n) => new Promise((a, s) => {
|
|
388
|
+
if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
|
|
389
|
+
const c = i[n];
|
|
390
|
+
const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
|
|
391
|
+
const d = r.join(l, e);
|
|
392
|
+
a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
|
|
397
393
|
});
|
|
398
|
-
const f
|
|
399
|
-
if (r
|
|
400
|
-
const s
|
|
401
|
-
a
|
|
402
|
-
if (!a
|
|
403
|
-
else return i
|
|
404
|
-
return i
|
|
394
|
+
const f = (e, n, r) => new Promise((i, o) => {
|
|
395
|
+
if (r === c.length) return i(d(n + 1));
|
|
396
|
+
const s = c[r];
|
|
397
|
+
a(e + s, { pathExt: l }, (a, o) => {
|
|
398
|
+
if (!a && o) if (t.all) u.push(e + s);
|
|
399
|
+
else return i(e + s);
|
|
400
|
+
return i(f(e, n, r + 1));
|
|
405
401
|
});
|
|
406
402
|
});
|
|
407
|
-
return n
|
|
403
|
+
return n ? d(0).then((e) => n(null, e), n) : d(0);
|
|
408
404
|
};
|
|
409
|
-
const l
|
|
410
|
-
t
|
|
411
|
-
const { pathEnv: n
|
|
412
|
-
const l
|
|
413
|
-
for (let o
|
|
414
|
-
const s
|
|
415
|
-
const u
|
|
416
|
-
const d
|
|
417
|
-
const f
|
|
418
|
-
for (let e
|
|
419
|
-
const n
|
|
405
|
+
const l = (e, t) => {
|
|
406
|
+
t = t || {};
|
|
407
|
+
const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
|
|
408
|
+
const l = [];
|
|
409
|
+
for (let o = 0; o < n.length; o++) {
|
|
410
|
+
const s = n[o];
|
|
411
|
+
const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
|
|
412
|
+
const d = r.join(u, e);
|
|
413
|
+
const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
|
|
414
|
+
for (let e = 0; e < i.length; e++) {
|
|
415
|
+
const n = f + i[e];
|
|
420
416
|
try {
|
|
421
|
-
if (a
|
|
422
|
-
else return n
|
|
423
|
-
} catch (e
|
|
417
|
+
if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
|
|
418
|
+
else return n;
|
|
419
|
+
} catch (e) {}
|
|
424
420
|
}
|
|
425
421
|
}
|
|
426
|
-
if (t
|
|
427
|
-
if (t
|
|
428
|
-
throw o
|
|
422
|
+
if (t.all && l.length) return l;
|
|
423
|
+
if (t.nothrow) return null;
|
|
424
|
+
throw o(e);
|
|
429
425
|
};
|
|
430
|
-
t
|
|
431
|
-
c
|
|
426
|
+
t.exports = c;
|
|
427
|
+
c.sync = l;
|
|
432
428
|
});
|
|
433
|
-
var k = h((exports
|
|
434
|
-
const n
|
|
435
|
-
const t
|
|
436
|
-
if ((e
|
|
437
|
-
return Object.keys(t
|
|
429
|
+
var k = h((exports, t) => {
|
|
430
|
+
const n = (e = {}) => {
|
|
431
|
+
const t = e.env || process.env;
|
|
432
|
+
if ((e.platform || process.platform) !== "win32") return "PATH";
|
|
433
|
+
return Object.keys(t).reverse().find((e) => e.toUpperCase() === "PATH") || "Path";
|
|
438
434
|
};
|
|
439
|
-
t
|
|
440
|
-
t
|
|
435
|
+
t.exports = n;
|
|
436
|
+
t.exports.default = n;
|
|
441
437
|
});
|
|
442
|
-
var A = h((exports
|
|
443
|
-
const n
|
|
444
|
-
const r
|
|
445
|
-
const i
|
|
446
|
-
function a
|
|
447
|
-
const a
|
|
448
|
-
const o
|
|
449
|
-
const s
|
|
450
|
-
const c
|
|
451
|
-
if (c
|
|
452
|
-
process.chdir(e
|
|
453
|
-
} catch (e
|
|
454
|
-
let l
|
|
438
|
+
var A = h((exports, t) => {
|
|
439
|
+
const n = v("path");
|
|
440
|
+
const r = O();
|
|
441
|
+
const i = k();
|
|
442
|
+
function a(e, t) {
|
|
443
|
+
const a = e.options.env || process.env;
|
|
444
|
+
const o = process.cwd();
|
|
445
|
+
const s = e.options.cwd != null;
|
|
446
|
+
const c = s && process.chdir !== void 0 && !process.chdir.disabled;
|
|
447
|
+
if (c) try {
|
|
448
|
+
process.chdir(e.options.cwd);
|
|
449
|
+
} catch (e) {}
|
|
450
|
+
let l;
|
|
455
451
|
try {
|
|
456
|
-
l
|
|
457
|
-
path: a
|
|
458
|
-
pathExt: t
|
|
452
|
+
l = r.sync(e.command, {
|
|
453
|
+
path: a[i({ env: a })],
|
|
454
|
+
pathExt: t ? n.delimiter : void 0
|
|
459
455
|
});
|
|
460
|
-
} catch (e
|
|
461
|
-
if (c
|
|
456
|
+
} catch (e) {} finally {
|
|
457
|
+
if (c) process.chdir(o);
|
|
462
458
|
}
|
|
463
|
-
if (l
|
|
464
|
-
return l
|
|
459
|
+
if (l) l = n.resolve(s ? e.options.cwd : "", l);
|
|
460
|
+
return l;
|
|
465
461
|
}
|
|
466
|
-
function o
|
|
467
|
-
return a
|
|
462
|
+
function o(e) {
|
|
463
|
+
return a(e) || a(e, true);
|
|
468
464
|
}
|
|
469
|
-
t
|
|
465
|
+
t.exports = o;
|
|
470
466
|
});
|
|
471
|
-
var j = h((exports
|
|
472
|
-
const n
|
|
473
|
-
function r
|
|
474
|
-
e
|
|
475
|
-
return e
|
|
476
|
-
}
|
|
477
|
-
function i
|
|
478
|
-
e
|
|
479
|
-
e
|
|
480
|
-
e
|
|
481
|
-
e
|
|
482
|
-
e
|
|
483
|
-
if (t
|
|
484
|
-
return e
|
|
485
|
-
}
|
|
486
|
-
t
|
|
487
|
-
t
|
|
467
|
+
var j = h((exports, t) => {
|
|
468
|
+
const n = /([()\][%!^"`<>&|;, *?])/g;
|
|
469
|
+
function r(e) {
|
|
470
|
+
e = e.replace(n, "^$1");
|
|
471
|
+
return e;
|
|
472
|
+
}
|
|
473
|
+
function i(e, t) {
|
|
474
|
+
e = `${e}`;
|
|
475
|
+
e = e.replace(/(\\*)"/g, "$1$1\\\"");
|
|
476
|
+
e = e.replace(/(\\*)$/, "$1$1");
|
|
477
|
+
e = `"${e}"`;
|
|
478
|
+
e = e.replace(n, "^$1");
|
|
479
|
+
if (t) e = e.replace(n, "^$1");
|
|
480
|
+
return e;
|
|
481
|
+
}
|
|
482
|
+
t.exports.command = r;
|
|
483
|
+
t.exports.argument = i;
|
|
488
484
|
});
|
|
489
|
-
var M = h((exports
|
|
490
|
-
t
|
|
485
|
+
var M = h((exports, t) => {
|
|
486
|
+
t.exports = /^#!(.*)/;
|
|
491
487
|
});
|
|
492
|
-
var N = h((exports
|
|
493
|
-
const n
|
|
494
|
-
t
|
|
495
|
-
const t
|
|
496
|
-
if (!t
|
|
497
|
-
const [r
|
|
498
|
-
const a
|
|
499
|
-
if (a
|
|
500
|
-
return i
|
|
488
|
+
var N = h((exports, t) => {
|
|
489
|
+
const n = M();
|
|
490
|
+
t.exports = (e = "") => {
|
|
491
|
+
const t = e.match(n);
|
|
492
|
+
if (!t) return null;
|
|
493
|
+
const [r, i] = t[0].replace(/#! ?/, "").split(" ");
|
|
494
|
+
const a = r.split("/").pop();
|
|
495
|
+
if (a === "env") return i;
|
|
496
|
+
return i ? `${a} ${i}` : a;
|
|
501
497
|
};
|
|
502
498
|
});
|
|
503
|
-
var P = h((exports
|
|
504
|
-
const n
|
|
505
|
-
const r
|
|
506
|
-
function i
|
|
507
|
-
const t
|
|
508
|
-
const i
|
|
509
|
-
let a
|
|
499
|
+
var P = h((exports, t) => {
|
|
500
|
+
const n = v("fs");
|
|
501
|
+
const r = N();
|
|
502
|
+
function i(e) {
|
|
503
|
+
const t = 150;
|
|
504
|
+
const i = Buffer.alloc(t);
|
|
505
|
+
let a;
|
|
510
506
|
try {
|
|
511
|
-
a
|
|
512
|
-
n
|
|
513
|
-
n
|
|
514
|
-
} catch (e
|
|
515
|
-
return r
|
|
507
|
+
a = n.openSync(e, "r");
|
|
508
|
+
n.readSync(a, i, 0, t, 0);
|
|
509
|
+
n.closeSync(a);
|
|
510
|
+
} catch (e) {}
|
|
511
|
+
return r(i.toString());
|
|
516
512
|
}
|
|
517
|
-
t
|
|
513
|
+
t.exports = i;
|
|
518
514
|
});
|
|
519
|
-
var F = h((exports
|
|
520
|
-
const n
|
|
521
|
-
const r
|
|
522
|
-
const i
|
|
523
|
-
const a
|
|
524
|
-
const o
|
|
525
|
-
const s
|
|
526
|
-
const c
|
|
527
|
-
function l
|
|
528
|
-
e
|
|
529
|
-
const t
|
|
530
|
-
if (t
|
|
531
|
-
e
|
|
532
|
-
e
|
|
533
|
-
return r
|
|
515
|
+
var F = h((exports, t) => {
|
|
516
|
+
const n = v("path");
|
|
517
|
+
const r = A();
|
|
518
|
+
const i = j();
|
|
519
|
+
const a = P();
|
|
520
|
+
const o = process.platform === "win32";
|
|
521
|
+
const s = /\.(?:com|exe)$/i;
|
|
522
|
+
const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
523
|
+
function l(e) {
|
|
524
|
+
e.file = r(e);
|
|
525
|
+
const t = e.file && a(e.file);
|
|
526
|
+
if (t) {
|
|
527
|
+
e.args.unshift(e.file);
|
|
528
|
+
e.command = t;
|
|
529
|
+
return r(e);
|
|
534
530
|
}
|
|
535
|
-
return e
|
|
536
|
-
}
|
|
537
|
-
function u
|
|
538
|
-
if (!o
|
|
539
|
-
const t
|
|
540
|
-
const r
|
|
541
|
-
if (e
|
|
542
|
-
const r
|
|
543
|
-
e
|
|
544
|
-
e
|
|
545
|
-
e
|
|
546
|
-
e
|
|
531
|
+
return e.file;
|
|
532
|
+
}
|
|
533
|
+
function u(e) {
|
|
534
|
+
if (!o) return e;
|
|
535
|
+
const t = l(e);
|
|
536
|
+
const r = !s.test(t);
|
|
537
|
+
if (e.options.forceShell || r) {
|
|
538
|
+
const r = c.test(t);
|
|
539
|
+
e.command = n.normalize(e.command);
|
|
540
|
+
e.command = i.command(e.command);
|
|
541
|
+
e.args = e.args.map((e) => i.argument(e, r));
|
|
542
|
+
e.args = [
|
|
547
543
|
"/d",
|
|
548
544
|
"/s",
|
|
549
545
|
"/c",
|
|
550
|
-
`"${[e
|
|
546
|
+
`"${[e.command].concat(e.args).join(" ")}"`
|
|
551
547
|
];
|
|
552
|
-
e
|
|
553
|
-
e
|
|
548
|
+
e.command = process.env.comspec || "cmd.exe";
|
|
549
|
+
e.options.windowsVerbatimArguments = true;
|
|
554
550
|
}
|
|
555
|
-
return e
|
|
551
|
+
return e;
|
|
556
552
|
}
|
|
557
|
-
function d
|
|
558
|
-
if (t
|
|
559
|
-
n
|
|
560
|
-
t
|
|
553
|
+
function d(e, t, n) {
|
|
554
|
+
if (t && !Array.isArray(t)) {
|
|
555
|
+
n = t;
|
|
556
|
+
t = null;
|
|
561
557
|
}
|
|
562
|
-
t
|
|
563
|
-
n
|
|
564
|
-
const r
|
|
565
|
-
command: e
|
|
566
|
-
args: t
|
|
567
|
-
options: n
|
|
558
|
+
t = t ? t.slice(0) : [];
|
|
559
|
+
n = Object.assign({}, n);
|
|
560
|
+
const r = {
|
|
561
|
+
command: e,
|
|
562
|
+
args: t,
|
|
563
|
+
options: n,
|
|
568
564
|
file: void 0,
|
|
569
565
|
original: {
|
|
570
|
-
command: e
|
|
571
|
-
args: t
|
|
566
|
+
command: e,
|
|
567
|
+
args: t
|
|
572
568
|
}
|
|
573
569
|
};
|
|
574
|
-
return n
|
|
570
|
+
return n.shell ? r : u(r);
|
|
575
571
|
}
|
|
576
|
-
t
|
|
572
|
+
t.exports = d;
|
|
577
573
|
});
|
|
578
|
-
var I = h((exports
|
|
579
|
-
const n
|
|
580
|
-
function r
|
|
581
|
-
return Object.assign(/* @__PURE__ */ new Error(`${t
|
|
574
|
+
var I = h((exports, t) => {
|
|
575
|
+
const n = process.platform === "win32";
|
|
576
|
+
function r(e, t) {
|
|
577
|
+
return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
|
|
582
578
|
code: "ENOENT",
|
|
583
579
|
errno: "ENOENT",
|
|
584
|
-
syscall: `${t
|
|
585
|
-
path: e
|
|
586
|
-
spawnargs: e
|
|
580
|
+
syscall: `${t} ${e.command}`,
|
|
581
|
+
path: e.command,
|
|
582
|
+
spawnargs: e.args
|
|
587
583
|
});
|
|
588
584
|
}
|
|
589
|
-
function i
|
|
590
|
-
if (!n
|
|
591
|
-
const r
|
|
592
|
-
e
|
|
593
|
-
if (n
|
|
594
|
-
const n
|
|
595
|
-
if (n
|
|
585
|
+
function i(e, t) {
|
|
586
|
+
if (!n) return;
|
|
587
|
+
const r = e.emit;
|
|
588
|
+
e.emit = function(n, i) {
|
|
589
|
+
if (n === "exit") {
|
|
590
|
+
const n = a(i, t, "spawn");
|
|
591
|
+
if (n) return r.call(e, "error", n);
|
|
596
592
|
}
|
|
597
|
-
return r
|
|
593
|
+
return r.apply(e, arguments);
|
|
598
594
|
};
|
|
599
595
|
}
|
|
600
|
-
function a
|
|
601
|
-
if (n
|
|
596
|
+
function a(e, t) {
|
|
597
|
+
if (n && e === 1 && !t.file) return r(t.original, "spawn");
|
|
602
598
|
return null;
|
|
603
599
|
}
|
|
604
|
-
function o
|
|
605
|
-
if (n
|
|
600
|
+
function o(e, t) {
|
|
601
|
+
if (n && e === 1 && !t.file) return r(t.original, "spawnSync");
|
|
606
602
|
return null;
|
|
607
603
|
}
|
|
608
|
-
t
|
|
609
|
-
hookChildProcess: i
|
|
610
|
-
verifyENOENT: a
|
|
611
|
-
verifyENOENTSync: o
|
|
612
|
-
notFoundError: r
|
|
604
|
+
t.exports = {
|
|
605
|
+
hookChildProcess: i,
|
|
606
|
+
verifyENOENT: a,
|
|
607
|
+
verifyENOENTSync: o,
|
|
608
|
+
notFoundError: r
|
|
613
609
|
};
|
|
614
610
|
});
|
|
615
|
-
var R = _(h((exports
|
|
616
|
-
const n
|
|
617
|
-
const r
|
|
618
|
-
const i
|
|
619
|
-
function a
|
|
620
|
-
const o
|
|
621
|
-
const s
|
|
622
|
-
i
|
|
623
|
-
return s
|
|
624
|
-
}
|
|
625
|
-
function o
|
|
626
|
-
const o
|
|
627
|
-
const s
|
|
628
|
-
s
|
|
629
|
-
return s
|
|
630
|
-
}
|
|
631
|
-
t
|
|
632
|
-
t
|
|
633
|
-
t
|
|
634
|
-
t
|
|
635
|
-
t
|
|
611
|
+
var R = _(h((exports, t) => {
|
|
612
|
+
const n = v("child_process");
|
|
613
|
+
const r = F();
|
|
614
|
+
const i = I();
|
|
615
|
+
function a(e, t, a) {
|
|
616
|
+
const o = r(e, t, a);
|
|
617
|
+
const s = n.spawn(o.command, o.args, o.options);
|
|
618
|
+
i.hookChildProcess(s, o);
|
|
619
|
+
return s;
|
|
620
|
+
}
|
|
621
|
+
function o(e, t, a) {
|
|
622
|
+
const o = r(e, t, a);
|
|
623
|
+
const s = n.spawnSync(o.command, o.args, o.options);
|
|
624
|
+
s.error = s.error || i.verifyENOENTSync(s.status, o);
|
|
625
|
+
return s;
|
|
626
|
+
}
|
|
627
|
+
t.exports = a;
|
|
628
|
+
t.exports.spawn = a;
|
|
629
|
+
t.exports.sync = o;
|
|
630
|
+
t.exports._parse = r;
|
|
631
|
+
t.exports._enoent = i;
|
|
636
632
|
})(), 1);
|
|
637
633
|
var z = class extends Error {
|
|
638
634
|
result;
|
|
@@ -640,10 +636,10 @@ var z = class extends Error {
|
|
|
640
636
|
get exitCode() {
|
|
641
637
|
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
642
638
|
}
|
|
643
|
-
constructor(e
|
|
644
|
-
super(`Process exited with non-zero status (${e
|
|
645
|
-
this.result = e
|
|
646
|
-
this.output = t
|
|
639
|
+
constructor(e, t) {
|
|
640
|
+
super(`Process exited with non-zero status (${e.exitCode})`);
|
|
641
|
+
this.result = e;
|
|
642
|
+
this.output = t;
|
|
647
643
|
}
|
|
648
644
|
};
|
|
649
645
|
const B = {
|
|
@@ -651,30 +647,30 @@ const B = {
|
|
|
651
647
|
persist: false
|
|
652
648
|
};
|
|
653
649
|
const V = { windowsHide: true };
|
|
654
|
-
function H(e
|
|
650
|
+
function H(e, t) {
|
|
655
651
|
return {
|
|
656
|
-
command: (0, node_path.normalize)(e
|
|
657
|
-
args: t
|
|
652
|
+
command: (0, node_path.normalize)(e),
|
|
653
|
+
args: t ?? []
|
|
658
654
|
};
|
|
659
655
|
}
|
|
660
|
-
function U(e
|
|
661
|
-
const t
|
|
662
|
-
for (const n
|
|
663
|
-
if (n
|
|
664
|
-
t
|
|
665
|
-
return n
|
|
656
|
+
function U(e) {
|
|
657
|
+
const t = new AbortController();
|
|
658
|
+
for (const n of e) {
|
|
659
|
+
if (n.aborted) {
|
|
660
|
+
t.abort();
|
|
661
|
+
return n;
|
|
666
662
|
}
|
|
667
|
-
const e
|
|
668
|
-
t
|
|
663
|
+
const e = () => {
|
|
664
|
+
t.abort(n.reason);
|
|
669
665
|
};
|
|
670
|
-
n
|
|
666
|
+
n.addEventListener("abort", e, { signal: t.signal });
|
|
671
667
|
}
|
|
672
|
-
return t
|
|
668
|
+
return t.signal;
|
|
673
669
|
}
|
|
674
|
-
async function W(e
|
|
675
|
-
let t
|
|
676
|
-
for await (const n
|
|
677
|
-
return t
|
|
670
|
+
async function W(e) {
|
|
671
|
+
let t = "";
|
|
672
|
+
for await (const n of e) t += n.toString();
|
|
673
|
+
return t;
|
|
678
674
|
}
|
|
679
675
|
var G = class {
|
|
680
676
|
_process;
|
|
@@ -694,19 +690,19 @@ var G = class {
|
|
|
694
690
|
get exitCode() {
|
|
695
691
|
if (this._process && this._process.exitCode !== null) return this._process.exitCode;
|
|
696
692
|
}
|
|
697
|
-
constructor(e
|
|
693
|
+
constructor(e, t, n) {
|
|
698
694
|
this._options = {
|
|
699
695
|
...B,
|
|
700
|
-
...n
|
|
696
|
+
...n
|
|
701
697
|
};
|
|
702
|
-
this._command = e
|
|
703
|
-
this._args = t
|
|
704
|
-
this._processClosed = new Promise((e
|
|
705
|
-
this._resolveClose = e
|
|
698
|
+
this._command = e;
|
|
699
|
+
this._args = t ?? [];
|
|
700
|
+
this._processClosed = new Promise((e) => {
|
|
701
|
+
this._resolveClose = e;
|
|
706
702
|
});
|
|
707
703
|
}
|
|
708
|
-
kill(e
|
|
709
|
-
return this._process?.kill(e
|
|
704
|
+
kill(e) {
|
|
705
|
+
return this._process?.kill(e) === true;
|
|
710
706
|
}
|
|
711
707
|
get aborted() {
|
|
712
708
|
return this._aborted;
|
|
@@ -714,99 +710,98 @@ var G = class {
|
|
|
714
710
|
get killed() {
|
|
715
711
|
return this._process?.killed === true;
|
|
716
712
|
}
|
|
717
|
-
pipe(e
|
|
718
|
-
return q(e
|
|
719
|
-
...n
|
|
713
|
+
pipe(e, t, n) {
|
|
714
|
+
return q(e, t, {
|
|
715
|
+
...n,
|
|
720
716
|
stdin: this
|
|
721
717
|
});
|
|
722
718
|
}
|
|
723
719
|
async *[Symbol.asyncIterator]() {
|
|
724
|
-
const e
|
|
725
|
-
if (!e
|
|
726
|
-
const t
|
|
727
|
-
if (this._streamErr) t
|
|
728
|
-
if (this._streamOut) t
|
|
729
|
-
const n
|
|
730
|
-
const r
|
|
731
|
-
for await (const e
|
|
720
|
+
const e = this._process;
|
|
721
|
+
if (!e) return;
|
|
722
|
+
const t = [];
|
|
723
|
+
if (this._streamErr) t.push(this._streamErr);
|
|
724
|
+
if (this._streamOut) t.push(this._streamOut);
|
|
725
|
+
const n = w(t);
|
|
726
|
+
const r = node_readline.default.createInterface({ input: n });
|
|
727
|
+
for await (const e of r) yield e.toString();
|
|
732
728
|
await this._processClosed;
|
|
733
|
-
e
|
|
729
|
+
e.removeAllListeners();
|
|
734
730
|
if (this._thrownError) throw this._thrownError;
|
|
735
731
|
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z(this);
|
|
736
732
|
}
|
|
737
733
|
async _waitForOutput() {
|
|
738
|
-
const e
|
|
739
|
-
if (!e
|
|
740
|
-
const [t
|
|
734
|
+
const e = this._process;
|
|
735
|
+
if (!e) throw new Error("No process was started");
|
|
736
|
+
const [t, n] = await Promise.all([this._streamOut ? W(this._streamOut) : "", this._streamErr ? W(this._streamErr) : ""]);
|
|
741
737
|
await this._processClosed;
|
|
742
738
|
if (this._options?.stdin) await this._options.stdin;
|
|
743
|
-
e
|
|
739
|
+
e.removeAllListeners();
|
|
744
740
|
if (this._thrownError) throw this._thrownError;
|
|
745
|
-
const r
|
|
746
|
-
stderr: n
|
|
747
|
-
stdout: t
|
|
741
|
+
const r = {
|
|
742
|
+
stderr: n,
|
|
743
|
+
stdout: t,
|
|
748
744
|
exitCode: this.exitCode
|
|
749
745
|
};
|
|
750
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z(this, r
|
|
751
|
-
return r
|
|
746
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z(this, r);
|
|
747
|
+
return r;
|
|
752
748
|
}
|
|
753
|
-
then(e
|
|
754
|
-
return this._waitForOutput().then(e
|
|
749
|
+
then(e, t) {
|
|
750
|
+
return this._waitForOutput().then(e, t);
|
|
755
751
|
}
|
|
756
752
|
_streamOut;
|
|
757
753
|
_streamErr;
|
|
758
754
|
spawn() {
|
|
759
|
-
const e
|
|
760
|
-
const n
|
|
761
|
-
const r
|
|
755
|
+
const e = (0, node_process.cwd)();
|
|
756
|
+
const n = this._options;
|
|
757
|
+
const r = {
|
|
762
758
|
...V,
|
|
763
|
-
...n
|
|
759
|
+
...n.nodeOptions
|
|
764
760
|
};
|
|
765
|
-
const i
|
|
761
|
+
const i = [];
|
|
766
762
|
this._resetState();
|
|
767
|
-
if (n
|
|
768
|
-
if (n
|
|
769
|
-
if (n
|
|
770
|
-
if (i
|
|
771
|
-
r
|
|
772
|
-
const { command: a
|
|
773
|
-
const c
|
|
774
|
-
const l
|
|
775
|
-
if (l
|
|
776
|
-
if (l
|
|
777
|
-
this._process = l
|
|
778
|
-
l
|
|
779
|
-
l
|
|
780
|
-
if (n
|
|
781
|
-
const { stdout: e
|
|
782
|
-
if (e
|
|
763
|
+
if (n.timeout !== void 0) i.push(AbortSignal.timeout(n.timeout));
|
|
764
|
+
if (n.signal !== void 0) i.push(n.signal);
|
|
765
|
+
if (n.persist === true) r.detached = true;
|
|
766
|
+
if (i.length > 0) r.signal = U(i);
|
|
767
|
+
r.env = C(e, r.env);
|
|
768
|
+
const { command: a, args: s } = H(this._command, this._args);
|
|
769
|
+
const c = (0, R._parse)(a, s, r);
|
|
770
|
+
const l = (0, node_child_process.spawn)(c.command, c.args, c.options);
|
|
771
|
+
if (l.stderr) this._streamErr = l.stderr;
|
|
772
|
+
if (l.stdout) this._streamOut = l.stdout;
|
|
773
|
+
this._process = l;
|
|
774
|
+
l.once("error", this._onError);
|
|
775
|
+
l.once("close", this._onClose);
|
|
776
|
+
if (n.stdin !== void 0 && l.stdin && n.stdin.process) {
|
|
777
|
+
const { stdout: e } = n.stdin.process;
|
|
778
|
+
if (e) e.pipe(l.stdin);
|
|
783
779
|
}
|
|
784
780
|
}
|
|
785
781
|
_resetState() {
|
|
786
782
|
this._aborted = false;
|
|
787
|
-
this._processClosed = new Promise((e
|
|
788
|
-
this._resolveClose = e
|
|
783
|
+
this._processClosed = new Promise((e) => {
|
|
784
|
+
this._resolveClose = e;
|
|
789
785
|
});
|
|
790
786
|
this._thrownError = void 0;
|
|
791
787
|
}
|
|
792
|
-
_onError = (e
|
|
793
|
-
if (e
|
|
788
|
+
_onError = (e) => {
|
|
789
|
+
if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
|
|
794
790
|
this._aborted = true;
|
|
795
791
|
return;
|
|
796
792
|
}
|
|
797
|
-
this._thrownError = e
|
|
793
|
+
this._thrownError = e;
|
|
798
794
|
};
|
|
799
795
|
_onClose = () => {
|
|
800
796
|
if (this._resolveClose) this._resolveClose();
|
|
801
797
|
};
|
|
802
798
|
};
|
|
803
|
-
const K = (e
|
|
804
|
-
const r
|
|
805
|
-
r
|
|
806
|
-
return r
|
|
799
|
+
const K = (e, t, n) => {
|
|
800
|
+
const r = new G(e, t, n);
|
|
801
|
+
r.spawn();
|
|
802
|
+
return r;
|
|
807
803
|
};
|
|
808
804
|
const q = K;
|
|
809
|
-
|
|
810
805
|
//#endregion
|
|
811
806
|
//#region ../../node_modules/.pnpm/@antfu+install-pkg@1.1.0/node_modules/@antfu/install-pkg/dist/index.js
|
|
812
807
|
async function detectPackageManager(cwd = node_process.default.cwd()) {
|
|
@@ -847,12 +842,11 @@ async function installPackage(names, options = {}) {
|
|
|
847
842
|
throwOnError: true
|
|
848
843
|
});
|
|
849
844
|
}
|
|
850
|
-
|
|
851
845
|
//#endregion
|
|
852
846
|
//#region ../../node_modules/.pnpm/@iconify+utils@3.1.0/node_modules/@iconify/utils/lib/loader/install-pkg.js
|
|
853
847
|
let pending;
|
|
854
848
|
const tasks = {};
|
|
855
|
-
const sleep = (ms) => new Promise((resolve
|
|
849
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
856
850
|
async function tryInstallPkg(name, autoInstall) {
|
|
857
851
|
if (pending) await pending;
|
|
858
852
|
if (!tasks[name]) {
|
|
@@ -863,16 +857,15 @@ async function tryInstallPkg(name, autoInstall) {
|
|
|
863
857
|
else tasks[name] = pending = installPackage(name, {
|
|
864
858
|
dev: true,
|
|
865
859
|
preferOffline: true
|
|
866
|
-
}).then(() => sleep(300)).catch((e
|
|
860
|
+
}).then(() => sleep(300)).catch((e) => {
|
|
867
861
|
warnOnce(`Failed to install ${name}`);
|
|
868
|
-
console.error(e
|
|
862
|
+
console.error(e);
|
|
869
863
|
}).finally(() => {
|
|
870
864
|
pending = void 0;
|
|
871
865
|
});
|
|
872
866
|
}
|
|
873
867
|
return tasks[name];
|
|
874
868
|
}
|
|
875
|
-
|
|
876
869
|
//#endregion
|
|
877
870
|
//#region ../../node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs
|
|
878
871
|
var astralIdentifierCodes = [
|
|
@@ -1811,14 +1804,14 @@ var keywords$1 = {
|
|
|
1811
1804
|
6: ecma5AndLessKeywords + " const class extends export import super"
|
|
1812
1805
|
};
|
|
1813
1806
|
var keywordRelationalOperator = /^in(stanceof)?$/;
|
|
1814
|
-
var nonASCIIidentifierStart =
|
|
1815
|
-
var nonASCIIidentifier =
|
|
1807
|
+
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
1808
|
+
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
1816
1809
|
function isInAstralSet(code, set) {
|
|
1817
1810
|
var pos = 65536;
|
|
1818
|
-
for (var i
|
|
1819
|
-
pos += set[i
|
|
1811
|
+
for (var i = 0; i < set.length; i += 2) {
|
|
1812
|
+
pos += set[i];
|
|
1820
1813
|
if (pos > code) return false;
|
|
1821
|
-
pos += set[i
|
|
1814
|
+
pos += set[i + 1];
|
|
1822
1815
|
if (pos >= code) return true;
|
|
1823
1816
|
}
|
|
1824
1817
|
return false;
|
|
@@ -1843,7 +1836,7 @@ function isIdentifierChar(code, astral) {
|
|
|
1843
1836
|
if (astral === false) return false;
|
|
1844
1837
|
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
|
1845
1838
|
}
|
|
1846
|
-
var TokenType = function TokenType
|
|
1839
|
+
var TokenType = function TokenType(label, conf) {
|
|
1847
1840
|
if (conf === void 0) conf = {};
|
|
1848
1841
|
this.label = label;
|
|
1849
1842
|
this.keyword = conf.keyword;
|
|
@@ -2010,9 +2003,9 @@ function isNewLine(code) {
|
|
|
2010
2003
|
}
|
|
2011
2004
|
function nextLineBreak(code, from, end) {
|
|
2012
2005
|
if (end === void 0) end = code.length;
|
|
2013
|
-
for (var i
|
|
2014
|
-
var next = code.charCodeAt(i
|
|
2015
|
-
if (isNewLine(next)) return i
|
|
2006
|
+
for (var i = from; i < end; i++) {
|
|
2007
|
+
var next = code.charCodeAt(i);
|
|
2008
|
+
if (isNewLine(next)) return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1;
|
|
2016
2009
|
}
|
|
2017
2010
|
return -1;
|
|
2018
2011
|
}
|
|
@@ -2029,7 +2022,7 @@ var isArray = Array.isArray || (function(obj) {
|
|
|
2029
2022
|
});
|
|
2030
2023
|
var regexpCache = Object.create(null);
|
|
2031
2024
|
function wordsRegexp(words) {
|
|
2032
|
-
return regexpCache[words] || (regexpCache[words] =
|
|
2025
|
+
return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"));
|
|
2033
2026
|
}
|
|
2034
2027
|
function codePointToString(code) {
|
|
2035
2028
|
if (code <= 65535) return String.fromCharCode(code);
|
|
@@ -2037,17 +2030,17 @@ function codePointToString(code) {
|
|
|
2037
2030
|
return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
|
|
2038
2031
|
}
|
|
2039
2032
|
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
2040
|
-
var Position = function Position
|
|
2033
|
+
var Position = function Position(line, col) {
|
|
2041
2034
|
this.line = line;
|
|
2042
2035
|
this.column = col;
|
|
2043
2036
|
};
|
|
2044
|
-
Position.prototype.offset = function offset(n
|
|
2045
|
-
return new Position(this.line, this.column + n
|
|
2037
|
+
Position.prototype.offset = function offset(n) {
|
|
2038
|
+
return new Position(this.line, this.column + n);
|
|
2046
2039
|
};
|
|
2047
|
-
var SourceLocation = function SourceLocation
|
|
2040
|
+
var SourceLocation = function SourceLocation(p, start, end) {
|
|
2048
2041
|
this.start = start;
|
|
2049
2042
|
this.end = end;
|
|
2050
|
-
if (p
|
|
2043
|
+
if (p.sourceFile !== null) this.source = p.sourceFile;
|
|
2051
2044
|
};
|
|
2052
2045
|
function getLineInfo(input, offset) {
|
|
2053
2046
|
for (var line = 1, cur = 0;;) {
|
|
@@ -2119,7 +2112,7 @@ function functionFlags(async, generator) {
|
|
|
2119
2112
|
return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
|
|
2120
2113
|
}
|
|
2121
2114
|
var BIND_NONE = 0, BIND_VAR = 1, BIND_LEXICAL = 2, BIND_FUNCTION = 3, BIND_SIMPLE_CATCH = 4, BIND_OUTSIDE = 5;
|
|
2122
|
-
var Parser = function Parser
|
|
2115
|
+
var Parser = function Parser(options, input, startPos) {
|
|
2123
2116
|
this.options = options = getOptions(options);
|
|
2124
2117
|
this.sourceFile = options.sourceFile;
|
|
2125
2118
|
this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
|
|
@@ -2189,8 +2182,8 @@ prototypeAccessors.inAsync.get = function() {
|
|
|
2189
2182
|
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0;
|
|
2190
2183
|
};
|
|
2191
2184
|
prototypeAccessors.canAwait.get = function() {
|
|
2192
|
-
for (var i
|
|
2193
|
-
var flags = this.scopeStack[i
|
|
2185
|
+
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
2186
|
+
var flags = this.scopeStack[i].flags;
|
|
2194
2187
|
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) return false;
|
|
2195
2188
|
if (flags & SCOPE_FUNCTION) return (flags & SCOPE_ASYNC) > 0;
|
|
2196
2189
|
}
|
|
@@ -2206,8 +2199,8 @@ prototypeAccessors.treatFunctionsAsVar.get = function() {
|
|
|
2206
2199
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
2207
2200
|
};
|
|
2208
2201
|
prototypeAccessors.allowNewDotTarget.get = function() {
|
|
2209
|
-
for (var i
|
|
2210
|
-
var flags = this.scopeStack[i
|
|
2202
|
+
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
2203
|
+
var flags = this.scopeStack[i].flags;
|
|
2211
2204
|
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) || flags & SCOPE_FUNCTION && !(flags & SCOPE_ARROW)) return true;
|
|
2212
2205
|
}
|
|
2213
2206
|
return false;
|
|
@@ -2219,7 +2212,7 @@ Parser.extend = function extend() {
|
|
|
2219
2212
|
var plugins = [], len = arguments.length;
|
|
2220
2213
|
while (len--) plugins[len] = arguments[len];
|
|
2221
2214
|
var cls = this;
|
|
2222
|
-
for (var i
|
|
2215
|
+
for (var i = 0; i < plugins.length; i++) cls = plugins[i](cls);
|
|
2223
2216
|
return cls;
|
|
2224
2217
|
};
|
|
2225
2218
|
Parser.parse = function parse(input, options) {
|
|
@@ -2297,7 +2290,7 @@ pp$9.expect = function(type) {
|
|
|
2297
2290
|
pp$9.unexpected = function(pos) {
|
|
2298
2291
|
this.raise(pos != null ? pos : this.start, "Unexpected token");
|
|
2299
2292
|
};
|
|
2300
|
-
var DestructuringErrors = function DestructuringErrors
|
|
2293
|
+
var DestructuringErrors = function DestructuringErrors() {
|
|
2301
2294
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
2302
2295
|
};
|
|
2303
2296
|
pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
|
|
@@ -2324,14 +2317,14 @@ pp$9.isSimpleAssignTarget = function(expr) {
|
|
|
2324
2317
|
};
|
|
2325
2318
|
var pp$8 = Parser.prototype;
|
|
2326
2319
|
pp$8.parseTopLevel = function(node) {
|
|
2327
|
-
var exports
|
|
2320
|
+
var exports = Object.create(null);
|
|
2328
2321
|
if (!node.body) node.body = [];
|
|
2329
2322
|
while (this.type !== types$1.eof) {
|
|
2330
|
-
var stmt = this.parseStatement(null, true, exports
|
|
2323
|
+
var stmt = this.parseStatement(null, true, exports);
|
|
2331
2324
|
node.body.push(stmt);
|
|
2332
2325
|
}
|
|
2333
|
-
if (this.inModule) for (var i
|
|
2334
|
-
var name = list
|
|
2326
|
+
if (this.inModule) for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {
|
|
2327
|
+
var name = list[i];
|
|
2335
2328
|
this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined");
|
|
2336
2329
|
}
|
|
2337
2330
|
this.adaptDirectivePrologue(node.body);
|
|
@@ -2392,7 +2385,7 @@ pp$8.isAwaitUsing = function(isFor) {
|
|
|
2392
2385
|
pp$8.isUsing = function(isFor) {
|
|
2393
2386
|
return this.isUsingKeyword(false, isFor);
|
|
2394
2387
|
};
|
|
2395
|
-
pp$8.parseStatement = function(context, topLevel, exports
|
|
2388
|
+
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
2396
2389
|
var starttype = this.type, node = this.startNode(), kind;
|
|
2397
2390
|
if (this.isLet(context)) {
|
|
2398
2391
|
starttype = types$1._var;
|
|
@@ -2436,7 +2429,7 @@ pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
|
2436
2429
|
if (!topLevel) this.raise(this.start, "'import' and 'export' may only appear at the top level");
|
|
2437
2430
|
if (!this.inModule) this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
|
2438
2431
|
}
|
|
2439
|
-
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports
|
|
2432
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
|
|
2440
2433
|
default:
|
|
2441
2434
|
if (this.isAsyncFunction()) {
|
|
2442
2435
|
if (context) this.unexpected();
|
|
@@ -2469,15 +2462,15 @@ pp$8.parseBreakContinueStatement = function(node, keyword) {
|
|
|
2469
2462
|
node.label = this.parseIdent();
|
|
2470
2463
|
this.semicolon();
|
|
2471
2464
|
}
|
|
2472
|
-
var i
|
|
2473
|
-
for (; i
|
|
2474
|
-
var lab = this.labels[i
|
|
2465
|
+
var i = 0;
|
|
2466
|
+
for (; i < this.labels.length; ++i) {
|
|
2467
|
+
var lab = this.labels[i];
|
|
2475
2468
|
if (node.label == null || lab.name === node.label.name) {
|
|
2476
2469
|
if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
|
|
2477
2470
|
if (node.label && isBreak) break;
|
|
2478
2471
|
}
|
|
2479
2472
|
}
|
|
2480
|
-
if (i
|
|
2473
|
+
if (i === this.labels.length) this.raise(node.start, "Unsyntactic " + keyword);
|
|
2481
2474
|
return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
|
|
2482
2475
|
};
|
|
2483
2476
|
pp$8.parseDebuggerStatement = function(node) {
|
|
@@ -2669,10 +2662,10 @@ pp$8.parseEmptyStatement = function(node) {
|
|
|
2669
2662
|
return this.finishNode(node, "EmptyStatement");
|
|
2670
2663
|
};
|
|
2671
2664
|
pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
|
|
2672
|
-
for (var i$1
|
|
2665
|
+
for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) if (list[i$1].name === maybeName) this.raise(expr.start, "Label '" + maybeName + "' is already declared");
|
|
2673
2666
|
var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
|
|
2674
|
-
for (var i
|
|
2675
|
-
var label$1 = this.labels[i
|
|
2667
|
+
for (var i = this.labels.length - 1; i >= 0; i--) {
|
|
2668
|
+
var label$1 = this.labels[i];
|
|
2676
2669
|
if (label$1.statementStart === node.start) {
|
|
2677
2670
|
label$1.statementStart = this.start;
|
|
2678
2671
|
label$1.kind = kind;
|
|
@@ -2811,7 +2804,7 @@ pp$8.parseClass = function(node, isStatement) {
|
|
|
2811
2804
|
};
|
|
2812
2805
|
pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
2813
2806
|
if (this.eat(types$1.semi)) return null;
|
|
2814
|
-
var ecmaVersion
|
|
2807
|
+
var ecmaVersion = this.options.ecmaVersion;
|
|
2815
2808
|
var node = this.startNode();
|
|
2816
2809
|
var keyName = "";
|
|
2817
2810
|
var isGenerator = false;
|
|
@@ -2819,7 +2812,7 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
|
2819
2812
|
var kind = "method";
|
|
2820
2813
|
var isStatic = false;
|
|
2821
2814
|
if (this.eatContextual("static")) {
|
|
2822
|
-
if (ecmaVersion
|
|
2815
|
+
if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
|
|
2823
2816
|
this.parseClassStaticBlock(node);
|
|
2824
2817
|
return node;
|
|
2825
2818
|
}
|
|
@@ -2827,9 +2820,9 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
|
2827
2820
|
else keyName = "static";
|
|
2828
2821
|
}
|
|
2829
2822
|
node.static = isStatic;
|
|
2830
|
-
if (!keyName && ecmaVersion
|
|
2823
|
+
if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) isAsync = true;
|
|
2831
2824
|
else keyName = "async";
|
|
2832
|
-
if (!keyName && (ecmaVersion
|
|
2825
|
+
if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) isGenerator = true;
|
|
2833
2826
|
if (!keyName && !isAsync && !isGenerator) {
|
|
2834
2827
|
var lastValue = this.value;
|
|
2835
2828
|
if (this.eatContextual("get") || this.eatContextual("set")) if (this.isClassElementNameStart()) kind = lastValue;
|
|
@@ -2841,7 +2834,7 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
|
2841
2834
|
node.key.name = keyName;
|
|
2842
2835
|
this.finishNode(node.key, "Identifier");
|
|
2843
2836
|
} else this.parseClassElementName(node);
|
|
2844
|
-
if (ecmaVersion
|
|
2837
|
+
if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
|
|
2845
2838
|
var isConstructor = !node.static && checkKeyName(node, "constructor");
|
|
2846
2839
|
var allowsDirectSuper = isConstructor && constructorAllowsSuper;
|
|
2847
2840
|
if (isConstructor && kind !== "method") this.raise(node.key.start, "Constructor can't have get/set modifier");
|
|
@@ -2918,14 +2911,14 @@ pp$8.enterClassBody = function() {
|
|
|
2918
2911
|
return element.declared;
|
|
2919
2912
|
};
|
|
2920
2913
|
pp$8.exitClassBody = function() {
|
|
2921
|
-
var ref
|
|
2922
|
-
var declared = ref
|
|
2923
|
-
var used = ref
|
|
2914
|
+
var ref = this.privateNameStack.pop();
|
|
2915
|
+
var declared = ref.declared;
|
|
2916
|
+
var used = ref.used;
|
|
2924
2917
|
if (!this.options.checkPrivateFields) return;
|
|
2925
2918
|
var len = this.privateNameStack.length;
|
|
2926
2919
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
2927
|
-
for (var i
|
|
2928
|
-
var id = used[i
|
|
2920
|
+
for (var i = 0; i < used.length; ++i) {
|
|
2921
|
+
var id = used[i];
|
|
2929
2922
|
if (!hasOwn(declared, id.name)) if (parent) parent.used.push(id);
|
|
2930
2923
|
else this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class");
|
|
2931
2924
|
}
|
|
@@ -2948,10 +2941,10 @@ function checkKeyName(node, name) {
|
|
|
2948
2941
|
var key = node.key;
|
|
2949
2942
|
return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
|
|
2950
2943
|
}
|
|
2951
|
-
pp$8.parseExportAllDeclaration = function(node, exports
|
|
2944
|
+
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
2952
2945
|
if (this.options.ecmaVersion >= 11) if (this.eatContextual("as")) {
|
|
2953
2946
|
node.exported = this.parseModuleExportName();
|
|
2954
|
-
this.checkExport(exports
|
|
2947
|
+
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
2955
2948
|
} else node.exported = null;
|
|
2956
2949
|
this.expectContextual("from");
|
|
2957
2950
|
if (this.type !== types$1.string) this.unexpected();
|
|
@@ -2960,31 +2953,31 @@ pp$8.parseExportAllDeclaration = function(node, exports$1) {
|
|
|
2960
2953
|
this.semicolon();
|
|
2961
2954
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
2962
2955
|
};
|
|
2963
|
-
pp$8.parseExport = function(node, exports
|
|
2956
|
+
pp$8.parseExport = function(node, exports) {
|
|
2964
2957
|
this.next();
|
|
2965
|
-
if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports
|
|
2958
|
+
if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports);
|
|
2966
2959
|
if (this.eat(types$1._default)) {
|
|
2967
|
-
this.checkExport(exports
|
|
2960
|
+
this.checkExport(exports, "default", this.lastTokStart);
|
|
2968
2961
|
node.declaration = this.parseExportDefaultDeclaration();
|
|
2969
2962
|
return this.finishNode(node, "ExportDefaultDeclaration");
|
|
2970
2963
|
}
|
|
2971
2964
|
if (this.shouldParseExportStatement()) {
|
|
2972
2965
|
node.declaration = this.parseExportDeclaration(node);
|
|
2973
|
-
if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports
|
|
2974
|
-
else this.checkExport(exports
|
|
2966
|
+
if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports, node.declaration.declarations);
|
|
2967
|
+
else this.checkExport(exports, node.declaration.id, node.declaration.id.start);
|
|
2975
2968
|
node.specifiers = [];
|
|
2976
2969
|
node.source = null;
|
|
2977
2970
|
if (this.options.ecmaVersion >= 16) node.attributes = [];
|
|
2978
2971
|
} else {
|
|
2979
2972
|
node.declaration = null;
|
|
2980
|
-
node.specifiers = this.parseExportSpecifiers(exports
|
|
2973
|
+
node.specifiers = this.parseExportSpecifiers(exports);
|
|
2981
2974
|
if (this.eatContextual("from")) {
|
|
2982
2975
|
if (this.type !== types$1.string) this.unexpected();
|
|
2983
2976
|
node.source = this.parseExprAtom();
|
|
2984
2977
|
if (this.options.ecmaVersion >= 16) node.attributes = this.parseWithClause();
|
|
2985
2978
|
} else {
|
|
2986
|
-
for (var i
|
|
2987
|
-
var spec = list
|
|
2979
|
+
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
|
|
2980
|
+
var spec = list[i];
|
|
2988
2981
|
this.checkUnreserved(spec.local);
|
|
2989
2982
|
this.checkLocalExport(spec.local);
|
|
2990
2983
|
if (spec.local.type === "Literal") this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
@@ -3015,45 +3008,45 @@ pp$8.parseExportDefaultDeclaration = function() {
|
|
|
3015
3008
|
return declaration;
|
|
3016
3009
|
}
|
|
3017
3010
|
};
|
|
3018
|
-
pp$8.checkExport = function(exports
|
|
3019
|
-
if (!exports
|
|
3011
|
+
pp$8.checkExport = function(exports, name, pos) {
|
|
3012
|
+
if (!exports) return;
|
|
3020
3013
|
if (typeof name !== "string") name = name.type === "Identifier" ? name.name : name.value;
|
|
3021
|
-
if (hasOwn(exports
|
|
3022
|
-
exports
|
|
3014
|
+
if (hasOwn(exports, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
|
|
3015
|
+
exports[name] = true;
|
|
3023
3016
|
};
|
|
3024
|
-
pp$8.checkPatternExport = function(exports
|
|
3017
|
+
pp$8.checkPatternExport = function(exports, pat) {
|
|
3025
3018
|
var type = pat.type;
|
|
3026
|
-
if (type === "Identifier") this.checkExport(exports
|
|
3027
|
-
else if (type === "ObjectPattern") for (var i
|
|
3028
|
-
var prop = list
|
|
3029
|
-
this.checkPatternExport(exports
|
|
3019
|
+
if (type === "Identifier") this.checkExport(exports, pat, pat.start);
|
|
3020
|
+
else if (type === "ObjectPattern") for (var i = 0, list = pat.properties; i < list.length; i += 1) {
|
|
3021
|
+
var prop = list[i];
|
|
3022
|
+
this.checkPatternExport(exports, prop);
|
|
3030
3023
|
}
|
|
3031
|
-
else if (type === "ArrayPattern") for (var i$1
|
|
3032
|
-
var elt = list$1
|
|
3033
|
-
if (elt) this.checkPatternExport(exports
|
|
3024
|
+
else if (type === "ArrayPattern") for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
|
|
3025
|
+
var elt = list$1[i$1];
|
|
3026
|
+
if (elt) this.checkPatternExport(exports, elt);
|
|
3034
3027
|
}
|
|
3035
|
-
else if (type === "Property") this.checkPatternExport(exports
|
|
3036
|
-
else if (type === "AssignmentPattern") this.checkPatternExport(exports
|
|
3037
|
-
else if (type === "RestElement") this.checkPatternExport(exports
|
|
3028
|
+
else if (type === "Property") this.checkPatternExport(exports, pat.value);
|
|
3029
|
+
else if (type === "AssignmentPattern") this.checkPatternExport(exports, pat.left);
|
|
3030
|
+
else if (type === "RestElement") this.checkPatternExport(exports, pat.argument);
|
|
3038
3031
|
};
|
|
3039
|
-
pp$8.checkVariableExport = function(exports
|
|
3040
|
-
if (!exports
|
|
3041
|
-
for (var i
|
|
3042
|
-
var decl = list
|
|
3043
|
-
this.checkPatternExport(exports
|
|
3032
|
+
pp$8.checkVariableExport = function(exports, decls) {
|
|
3033
|
+
if (!exports) return;
|
|
3034
|
+
for (var i = 0, list = decls; i < list.length; i += 1) {
|
|
3035
|
+
var decl = list[i];
|
|
3036
|
+
this.checkPatternExport(exports, decl.id);
|
|
3044
3037
|
}
|
|
3045
3038
|
};
|
|
3046
3039
|
pp$8.shouldParseExportStatement = function() {
|
|
3047
3040
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
3048
3041
|
};
|
|
3049
|
-
pp$8.parseExportSpecifier = function(exports
|
|
3042
|
+
pp$8.parseExportSpecifier = function(exports) {
|
|
3050
3043
|
var node = this.startNode();
|
|
3051
3044
|
node.local = this.parseModuleExportName();
|
|
3052
3045
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
3053
|
-
this.checkExport(exports
|
|
3046
|
+
this.checkExport(exports, node.exported, node.exported.start);
|
|
3054
3047
|
return this.finishNode(node, "ExportSpecifier");
|
|
3055
3048
|
};
|
|
3056
|
-
pp$8.parseExportSpecifiers = function(exports
|
|
3049
|
+
pp$8.parseExportSpecifiers = function(exports) {
|
|
3057
3050
|
var nodes = [], first = true;
|
|
3058
3051
|
this.expect(types$1.braceL);
|
|
3059
3052
|
while (!this.eat(types$1.braceR)) {
|
|
@@ -3061,7 +3054,7 @@ pp$8.parseExportSpecifiers = function(exports$1) {
|
|
|
3061
3054
|
this.expect(types$1.comma);
|
|
3062
3055
|
if (this.afterTrailingComma(types$1.braceR)) break;
|
|
3063
3056
|
} else first = false;
|
|
3064
|
-
nodes.push(this.parseExportSpecifier(exports
|
|
3057
|
+
nodes.push(this.parseExportSpecifier(exports));
|
|
3065
3058
|
}
|
|
3066
3059
|
return nodes;
|
|
3067
3060
|
};
|
|
@@ -3160,7 +3153,7 @@ pp$8.parseModuleExportName = function() {
|
|
|
3160
3153
|
return this.parseIdent(true);
|
|
3161
3154
|
};
|
|
3162
3155
|
pp$8.adaptDirectivePrologue = function(statements) {
|
|
3163
|
-
for (var i
|
|
3156
|
+
for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) statements[i].directive = statements[i].expression.raw.slice(1, -1);
|
|
3164
3157
|
};
|
|
3165
3158
|
pp$8.isDirectiveCandidate = function(statement) {
|
|
3166
3159
|
return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && (this.input[statement.start] === "\"" || this.input[statement.start] === "'");
|
|
@@ -3178,8 +3171,8 @@ pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
|
|
|
3178
3171
|
case "ObjectExpression":
|
|
3179
3172
|
node.type = "ObjectPattern";
|
|
3180
3173
|
if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true);
|
|
3181
|
-
for (var i
|
|
3182
|
-
var prop = list
|
|
3174
|
+
for (var i = 0, list = node.properties; i < list.length; i += 1) {
|
|
3175
|
+
var prop = list[i];
|
|
3183
3176
|
this.toAssignable(prop, isBinding);
|
|
3184
3177
|
if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) this.raise(prop.argument.start, "Unexpected token");
|
|
3185
3178
|
}
|
|
@@ -3218,8 +3211,8 @@ pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
|
|
|
3218
3211
|
};
|
|
3219
3212
|
pp$7.toAssignableList = function(exprList, isBinding) {
|
|
3220
3213
|
var end = exprList.length;
|
|
3221
|
-
for (var i
|
|
3222
|
-
var elt = exprList[i
|
|
3214
|
+
for (var i = 0; i < end; i++) {
|
|
3215
|
+
var elt = exprList[i];
|
|
3223
3216
|
if (elt) this.toAssignable(elt, isBinding);
|
|
3224
3217
|
}
|
|
3225
3218
|
if (end) {
|
|
@@ -3317,14 +3310,14 @@ pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
|
|
|
3317
3310
|
if (bindingType === void 0) bindingType = BIND_NONE;
|
|
3318
3311
|
switch (expr.type) {
|
|
3319
3312
|
case "ObjectPattern":
|
|
3320
|
-
for (var i
|
|
3321
|
-
var prop = list
|
|
3313
|
+
for (var i = 0, list = expr.properties; i < list.length; i += 1) {
|
|
3314
|
+
var prop = list[i];
|
|
3322
3315
|
this.checkLValInnerPattern(prop, bindingType, checkClashes);
|
|
3323
3316
|
}
|
|
3324
3317
|
break;
|
|
3325
3318
|
case "ArrayPattern":
|
|
3326
|
-
for (var i$1
|
|
3327
|
-
var elem = list$1
|
|
3319
|
+
for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
|
|
3320
|
+
var elem = list$1[i$1];
|
|
3328
3321
|
if (elem) this.checkLValInnerPattern(elem, bindingType, checkClashes);
|
|
3329
3322
|
}
|
|
3330
3323
|
break;
|
|
@@ -3346,7 +3339,7 @@ pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
|
|
|
3346
3339
|
default: this.checkLValPattern(expr, bindingType, checkClashes);
|
|
3347
3340
|
}
|
|
3348
3341
|
};
|
|
3349
|
-
var TokContext = function TokContext
|
|
3342
|
+
var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
|
|
3350
3343
|
this.token = token;
|
|
3351
3344
|
this.isExpr = !!isExpr;
|
|
3352
3345
|
this.preserveSpace = !!preserveSpace;
|
|
@@ -3359,8 +3352,8 @@ var types = {
|
|
|
3359
3352
|
b_tmpl: new TokContext("${", false),
|
|
3360
3353
|
p_stat: new TokContext("(", false),
|
|
3361
3354
|
p_expr: new TokContext("(", true),
|
|
3362
|
-
q_tmpl: new TokContext("`", true, true, function(p
|
|
3363
|
-
return p
|
|
3355
|
+
q_tmpl: new TokContext("`", true, true, function(p) {
|
|
3356
|
+
return p.tryReadTemplateToken();
|
|
3364
3357
|
}),
|
|
3365
3358
|
f_stat: new TokContext("function", false),
|
|
3366
3359
|
f_expr: new TokContext("function", true),
|
|
@@ -3385,8 +3378,8 @@ pp$6.braceIsBlock = function(prevType) {
|
|
|
3385
3378
|
return !this.exprAllowed;
|
|
3386
3379
|
};
|
|
3387
3380
|
pp$6.inGeneratorContext = function() {
|
|
3388
|
-
for (var i
|
|
3389
|
-
var context = this.context[i
|
|
3381
|
+
for (var i = this.context.length - 1; i >= 1; i--) {
|
|
3382
|
+
var context = this.context[i];
|
|
3390
3383
|
if (context.token === "function") return context.generator;
|
|
3391
3384
|
}
|
|
3392
3385
|
return false;
|
|
@@ -3927,8 +3920,8 @@ pp$5.parseNew = function() {
|
|
|
3927
3920
|
else node.arguments = empty;
|
|
3928
3921
|
return this.finishNode(node, "NewExpression");
|
|
3929
3922
|
};
|
|
3930
|
-
pp$5.parseTemplateElement = function(ref
|
|
3931
|
-
var isTagged = ref
|
|
3923
|
+
pp$5.parseTemplateElement = function(ref) {
|
|
3924
|
+
var isTagged = ref.isTagged;
|
|
3932
3925
|
var elem = this.startNode();
|
|
3933
3926
|
if (this.type === types$1.invalidTemplate) {
|
|
3934
3927
|
if (!isTagged) this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
@@ -3944,9 +3937,9 @@ pp$5.parseTemplateElement = function(ref$1) {
|
|
|
3944
3937
|
elem.tail = this.type === types$1.backQuote;
|
|
3945
3938
|
return this.finishNode(elem, "TemplateElement");
|
|
3946
3939
|
};
|
|
3947
|
-
pp$5.parseTemplate = function(ref
|
|
3948
|
-
if (ref
|
|
3949
|
-
var isTagged = ref
|
|
3940
|
+
pp$5.parseTemplate = function(ref) {
|
|
3941
|
+
if (ref === void 0) ref = {};
|
|
3942
|
+
var isTagged = ref.isTagged;
|
|
3950
3943
|
if (isTagged === void 0) isTagged = false;
|
|
3951
3944
|
var node = this.startNode();
|
|
3952
3945
|
this.next();
|
|
@@ -4123,13 +4116,13 @@ pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
|
|
|
4123
4116
|
this.exitScope();
|
|
4124
4117
|
};
|
|
4125
4118
|
pp$5.isSimpleParamList = function(params) {
|
|
4126
|
-
for (var i
|
|
4119
|
+
for (var i = 0, list = params; i < list.length; i += 1) if (list[i].type !== "Identifier") return false;
|
|
4127
4120
|
return true;
|
|
4128
4121
|
};
|
|
4129
4122
|
pp$5.checkParams = function(node, allowDuplicates) {
|
|
4130
4123
|
var nameHash = Object.create(null);
|
|
4131
|
-
for (var i
|
|
4132
|
-
var param = list
|
|
4124
|
+
for (var i = 0, list = node.params; i < list.length; i += 1) {
|
|
4125
|
+
var param = list[i];
|
|
4133
4126
|
this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
|
|
4134
4127
|
}
|
|
4135
4128
|
};
|
|
@@ -4150,10 +4143,10 @@ pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestruct
|
|
|
4150
4143
|
}
|
|
4151
4144
|
return elts;
|
|
4152
4145
|
};
|
|
4153
|
-
pp$5.checkUnreserved = function(ref
|
|
4154
|
-
var start = ref
|
|
4155
|
-
var end = ref
|
|
4156
|
-
var name = ref
|
|
4146
|
+
pp$5.checkUnreserved = function(ref) {
|
|
4147
|
+
var start = ref.start;
|
|
4148
|
+
var end = ref.end;
|
|
4149
|
+
var name = ref.name;
|
|
4157
4150
|
if (this.inGenerator && name === "yield") this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator");
|
|
4158
4151
|
if (this.inAsync && name === "await") this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function");
|
|
4159
4152
|
if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments") this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer");
|
|
@@ -4231,7 +4224,7 @@ pp$4.curPosition = function() {
|
|
|
4231
4224
|
if (this.options.locations) return new Position(this.curLine, this.pos - this.lineStart);
|
|
4232
4225
|
};
|
|
4233
4226
|
var pp$3 = Parser.prototype;
|
|
4234
|
-
var Scope = function Scope
|
|
4227
|
+
var Scope = function Scope(flags) {
|
|
4235
4228
|
this.flags = flags;
|
|
4236
4229
|
this.var = [];
|
|
4237
4230
|
this.lexical = [];
|
|
@@ -4259,8 +4252,8 @@ pp$3.declareName = function(name, bindingType, pos) {
|
|
|
4259
4252
|
if (this.treatFunctionsAsVar) redeclared = scope$2.lexical.indexOf(name) > -1;
|
|
4260
4253
|
else redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1;
|
|
4261
4254
|
scope$2.functions.push(name);
|
|
4262
|
-
} else for (var i
|
|
4263
|
-
var scope$3 = this.scopeStack[i
|
|
4255
|
+
} else for (var i = this.scopeStack.length - 1; i >= 0; --i) {
|
|
4256
|
+
var scope$3 = this.scopeStack[i];
|
|
4264
4257
|
if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
|
|
4265
4258
|
redeclared = true;
|
|
4266
4259
|
break;
|
|
@@ -4278,18 +4271,18 @@ pp$3.currentScope = function() {
|
|
|
4278
4271
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
4279
4272
|
};
|
|
4280
4273
|
pp$3.currentVarScope = function() {
|
|
4281
|
-
for (var i
|
|
4282
|
-
var scope = this.scopeStack[i
|
|
4274
|
+
for (var i = this.scopeStack.length - 1;; i--) {
|
|
4275
|
+
var scope = this.scopeStack[i];
|
|
4283
4276
|
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) return scope;
|
|
4284
4277
|
}
|
|
4285
4278
|
};
|
|
4286
4279
|
pp$3.currentThisScope = function() {
|
|
4287
|
-
for (var i
|
|
4288
|
-
var scope = this.scopeStack[i
|
|
4280
|
+
for (var i = this.scopeStack.length - 1;; i--) {
|
|
4281
|
+
var scope = this.scopeStack[i];
|
|
4289
4282
|
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) && !(scope.flags & SCOPE_ARROW)) return scope;
|
|
4290
4283
|
}
|
|
4291
4284
|
};
|
|
4292
|
-
var Node = function Node
|
|
4285
|
+
var Node = function Node(parser, pos, loc) {
|
|
4293
4286
|
this.type = "";
|
|
4294
4287
|
this.start = pos;
|
|
4295
4288
|
this.end = 0;
|
|
@@ -4362,19 +4355,19 @@ var unicodeScriptValues = {
|
|
|
4362
4355
|
14: ecma14ScriptValues
|
|
4363
4356
|
};
|
|
4364
4357
|
var data = {};
|
|
4365
|
-
function buildUnicodeData(ecmaVersion
|
|
4366
|
-
var d
|
|
4367
|
-
binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion
|
|
4368
|
-
binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion
|
|
4358
|
+
function buildUnicodeData(ecmaVersion) {
|
|
4359
|
+
var d = data[ecmaVersion] = {
|
|
4360
|
+
binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
|
|
4361
|
+
binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
|
|
4369
4362
|
nonBinary: {
|
|
4370
4363
|
General_Category: wordsRegexp(unicodeGeneralCategoryValues),
|
|
4371
|
-
Script: wordsRegexp(unicodeScriptValues[ecmaVersion
|
|
4364
|
+
Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
|
|
4372
4365
|
}
|
|
4373
4366
|
};
|
|
4374
|
-
d
|
|
4375
|
-
d
|
|
4376
|
-
d
|
|
4377
|
-
d
|
|
4367
|
+
d.nonBinary.Script_Extensions = d.nonBinary.Script;
|
|
4368
|
+
d.nonBinary.gc = d.nonBinary.General_Category;
|
|
4369
|
+
d.nonBinary.sc = d.nonBinary.Script;
|
|
4370
|
+
d.nonBinary.scx = d.nonBinary.Script_Extensions;
|
|
4378
4371
|
}
|
|
4379
4372
|
for (var i = 0, list = [
|
|
4380
4373
|
9,
|
|
@@ -4388,7 +4381,7 @@ for (var i = 0, list = [
|
|
|
4388
4381
|
buildUnicodeData(ecmaVersion);
|
|
4389
4382
|
}
|
|
4390
4383
|
var pp$1 = Parser.prototype;
|
|
4391
|
-
var BranchID = function BranchID
|
|
4384
|
+
var BranchID = function BranchID(parent, base) {
|
|
4392
4385
|
this.parent = parent;
|
|
4393
4386
|
this.base = base || this;
|
|
4394
4387
|
};
|
|
@@ -4399,7 +4392,7 @@ BranchID.prototype.separatedFrom = function separatedFrom(alt) {
|
|
|
4399
4392
|
BranchID.prototype.sibling = function sibling() {
|
|
4400
4393
|
return new BranchID(this.parent, this.base);
|
|
4401
4394
|
};
|
|
4402
|
-
var RegExpValidationState = function RegExpValidationState
|
|
4395
|
+
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
4403
4396
|
this.parser = parser;
|
|
4404
4397
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
|
|
4405
4398
|
this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
|
|
@@ -4438,24 +4431,24 @@ RegExpValidationState.prototype.reset = function reset(start, pattern, flags) {
|
|
|
4438
4431
|
RegExpValidationState.prototype.raise = function raise(message) {
|
|
4439
4432
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message);
|
|
4440
4433
|
};
|
|
4441
|
-
RegExpValidationState.prototype.at = function at(i
|
|
4434
|
+
RegExpValidationState.prototype.at = function at(i, forceU) {
|
|
4442
4435
|
if (forceU === void 0) forceU = false;
|
|
4443
|
-
var s
|
|
4444
|
-
var l
|
|
4445
|
-
if (i
|
|
4446
|
-
var c
|
|
4447
|
-
if (!(forceU || this.switchU) || c
|
|
4448
|
-
var next = s
|
|
4449
|
-
return next >= 56320 && next <= 57343 ? (c
|
|
4450
|
-
};
|
|
4451
|
-
RegExpValidationState.prototype.nextIndex = function nextIndex(i
|
|
4436
|
+
var s = this.source;
|
|
4437
|
+
var l = s.length;
|
|
4438
|
+
if (i >= l) return -1;
|
|
4439
|
+
var c = s.charCodeAt(i);
|
|
4440
|
+
if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l) return c;
|
|
4441
|
+
var next = s.charCodeAt(i + 1);
|
|
4442
|
+
return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c;
|
|
4443
|
+
};
|
|
4444
|
+
RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) {
|
|
4452
4445
|
if (forceU === void 0) forceU = false;
|
|
4453
|
-
var s
|
|
4454
|
-
var l
|
|
4455
|
-
if (i
|
|
4456
|
-
var c
|
|
4457
|
-
if (!(forceU || this.switchU) || c
|
|
4458
|
-
return i
|
|
4446
|
+
var s = this.source;
|
|
4447
|
+
var l = s.length;
|
|
4448
|
+
if (i >= l) return l;
|
|
4449
|
+
var c = s.charCodeAt(i), next;
|
|
4450
|
+
if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 56320 || next > 57343) return i + 1;
|
|
4451
|
+
return i + 2;
|
|
4459
4452
|
};
|
|
4460
4453
|
RegExpValidationState.prototype.current = function current(forceU) {
|
|
4461
4454
|
if (forceU === void 0) forceU = false;
|
|
@@ -4480,8 +4473,8 @@ RegExpValidationState.prototype.eat = function eat(ch, forceU) {
|
|
|
4480
4473
|
RegExpValidationState.prototype.eatChars = function eatChars(chs, forceU) {
|
|
4481
4474
|
if (forceU === void 0) forceU = false;
|
|
4482
4475
|
var pos = this.pos;
|
|
4483
|
-
for (var i
|
|
4484
|
-
var ch = list
|
|
4476
|
+
for (var i = 0, list = chs; i < list.length; i += 1) {
|
|
4477
|
+
var ch = list[i];
|
|
4485
4478
|
var current = this.at(pos, forceU);
|
|
4486
4479
|
if (current === -1 || current !== ch) return false;
|
|
4487
4480
|
pos = this.nextIndex(pos, forceU);
|
|
@@ -4498,19 +4491,19 @@ RegExpValidationState.prototype.eatChars = function eatChars(chs, forceU) {
|
|
|
4498
4491
|
pp$1.validateRegExpFlags = function(state) {
|
|
4499
4492
|
var validFlags = state.validFlags;
|
|
4500
4493
|
var flags = state.flags;
|
|
4501
|
-
var u
|
|
4502
|
-
var v
|
|
4503
|
-
for (var i
|
|
4504
|
-
var flag = flags.charAt(i
|
|
4494
|
+
var u = false;
|
|
4495
|
+
var v = false;
|
|
4496
|
+
for (var i = 0; i < flags.length; i++) {
|
|
4497
|
+
var flag = flags.charAt(i);
|
|
4505
4498
|
if (validFlags.indexOf(flag) === -1) this.raise(state.start, "Invalid regular expression flag");
|
|
4506
|
-
if (flags.indexOf(flag, i
|
|
4507
|
-
if (flag === "u") u
|
|
4508
|
-
if (flag === "v") v
|
|
4499
|
+
if (flags.indexOf(flag, i + 1) > -1) this.raise(state.start, "Duplicate regular expression flag");
|
|
4500
|
+
if (flag === "u") u = true;
|
|
4501
|
+
if (flag === "v") v = true;
|
|
4509
4502
|
}
|
|
4510
|
-
if (this.options.ecmaVersion >= 15 && u
|
|
4503
|
+
if (this.options.ecmaVersion >= 15 && u && v) this.raise(state.start, "Invalid regular expression flag");
|
|
4511
4504
|
};
|
|
4512
4505
|
function hasProp(obj) {
|
|
4513
|
-
for (var _
|
|
4506
|
+
for (var _ in obj) return true;
|
|
4514
4507
|
return false;
|
|
4515
4508
|
}
|
|
4516
4509
|
/**
|
|
@@ -4542,8 +4535,8 @@ pp$1.regexp_pattern = function(state) {
|
|
|
4542
4535
|
if (state.eat(93) || state.eat(125)) state.raise("Lone quantifier brackets");
|
|
4543
4536
|
}
|
|
4544
4537
|
if (state.maxBackReference > state.numCapturingParens) state.raise("Invalid escape");
|
|
4545
|
-
for (var i
|
|
4546
|
-
var name = list
|
|
4538
|
+
for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
|
|
4539
|
+
var name = list[i];
|
|
4547
4540
|
if (!state.groupNames[name]) state.raise("Invalid named capture referenced");
|
|
4548
4541
|
}
|
|
4549
4542
|
};
|
|
@@ -4643,16 +4636,16 @@ pp$1.regexp_eatUncapturingGroup = function(state) {
|
|
|
4643
4636
|
var addModifiers = this.regexp_eatModifiers(state);
|
|
4644
4637
|
var hasHyphen = state.eat(45);
|
|
4645
4638
|
if (addModifiers || hasHyphen) {
|
|
4646
|
-
for (var i
|
|
4647
|
-
var modifier = addModifiers.charAt(i
|
|
4648
|
-
if (addModifiers.indexOf(modifier, i
|
|
4639
|
+
for (var i = 0; i < addModifiers.length; i++) {
|
|
4640
|
+
var modifier = addModifiers.charAt(i);
|
|
4641
|
+
if (addModifiers.indexOf(modifier, i + 1) > -1) state.raise("Duplicate regular expression modifiers");
|
|
4649
4642
|
}
|
|
4650
4643
|
if (hasHyphen) {
|
|
4651
4644
|
var removeModifiers = this.regexp_eatModifiers(state);
|
|
4652
4645
|
if (!addModifiers && !removeModifiers && state.current() === 58) state.raise("Invalid regular expression modifiers");
|
|
4653
|
-
for (var i$1
|
|
4654
|
-
var modifier$1 = removeModifiers.charAt(i$1
|
|
4655
|
-
if (removeModifiers.indexOf(modifier$1, i$1
|
|
4646
|
+
for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
|
|
4647
|
+
var modifier$1 = removeModifiers.charAt(i$1);
|
|
4648
|
+
if (removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 || addModifiers.indexOf(modifier$1) > -1) state.raise("Duplicate regular expression modifiers");
|
|
4656
4649
|
}
|
|
4657
4650
|
}
|
|
4658
4651
|
}
|
|
@@ -4731,7 +4724,7 @@ pp$1.regexp_groupSpecifier = function(state) {
|
|
|
4731
4724
|
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
4732
4725
|
var known = state.groupNames[state.lastStringValue];
|
|
4733
4726
|
if (known) if (trackDisjunction) {
|
|
4734
|
-
for (var i
|
|
4727
|
+
for (var i = 0, list = known; i < list.length; i += 1) if (!list[i].separatedFrom(state.branchID)) state.raise("Duplicate capture group name");
|
|
4735
4728
|
} else state.raise("Duplicate capture group name");
|
|
4736
4729
|
if (trackDisjunction) (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
|
|
4737
4730
|
else state.groupNames[state.lastStringValue] = true;
|
|
@@ -4797,12 +4790,12 @@ pp$1.regexp_eatAtomEscape = function(state) {
|
|
|
4797
4790
|
pp$1.regexp_eatBackReference = function(state) {
|
|
4798
4791
|
var start = state.pos;
|
|
4799
4792
|
if (this.regexp_eatDecimalEscape(state)) {
|
|
4800
|
-
var n
|
|
4793
|
+
var n = state.lastIntValue;
|
|
4801
4794
|
if (state.switchU) {
|
|
4802
|
-
if (n
|
|
4795
|
+
if (n > state.maxBackReference) state.maxBackReference = n;
|
|
4803
4796
|
return true;
|
|
4804
4797
|
}
|
|
4805
|
-
if (n
|
|
4798
|
+
if (n <= state.numCapturingParens) return true;
|
|
4806
4799
|
state.pos = start;
|
|
4807
4800
|
}
|
|
4808
4801
|
return false;
|
|
@@ -5272,7 +5265,7 @@ function isOctalDigit(ch) {
|
|
|
5272
5265
|
pp$1.regexp_eatFixedHexDigits = function(state, length) {
|
|
5273
5266
|
var start = state.pos;
|
|
5274
5267
|
state.lastIntValue = 0;
|
|
5275
|
-
for (var i
|
|
5268
|
+
for (var i = 0; i < length; ++i) {
|
|
5276
5269
|
var ch = state.current();
|
|
5277
5270
|
if (!isHexDigit(ch)) {
|
|
5278
5271
|
state.pos = start;
|
|
@@ -5283,13 +5276,13 @@ pp$1.regexp_eatFixedHexDigits = function(state, length) {
|
|
|
5283
5276
|
}
|
|
5284
5277
|
return true;
|
|
5285
5278
|
};
|
|
5286
|
-
var Token = function Token
|
|
5287
|
-
this.type = p
|
|
5288
|
-
this.value = p
|
|
5289
|
-
this.start = p
|
|
5290
|
-
this.end = p
|
|
5291
|
-
if (p
|
|
5292
|
-
if (p
|
|
5279
|
+
var Token = function Token(p) {
|
|
5280
|
+
this.type = p.type;
|
|
5281
|
+
this.value = p.value;
|
|
5282
|
+
this.start = p.start;
|
|
5283
|
+
this.end = p.end;
|
|
5284
|
+
if (p.options.locations) this.loc = new SourceLocation(p, p.startLoc, p.endLoc);
|
|
5285
|
+
if (p.options.ranges) this.range = [p.start, p.end];
|
|
5293
5286
|
};
|
|
5294
5287
|
var pp = Parser.prototype;
|
|
5295
5288
|
pp.next = function(ignoreEscapeSequenceInKeyword) {
|
|
@@ -5481,15 +5474,15 @@ pp.readToken_eq_excl = function(code) {
|
|
|
5481
5474
|
return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1);
|
|
5482
5475
|
};
|
|
5483
5476
|
pp.readToken_question = function() {
|
|
5484
|
-
var ecmaVersion
|
|
5485
|
-
if (ecmaVersion
|
|
5477
|
+
var ecmaVersion = this.options.ecmaVersion;
|
|
5478
|
+
if (ecmaVersion >= 11) {
|
|
5486
5479
|
var next = this.input.charCodeAt(this.pos + 1);
|
|
5487
5480
|
if (next === 46) {
|
|
5488
5481
|
var next2 = this.input.charCodeAt(this.pos + 2);
|
|
5489
5482
|
if (next2 < 48 || next2 > 57) return this.finishOp(types$1.questionDot, 2);
|
|
5490
5483
|
}
|
|
5491
5484
|
if (next === 63) {
|
|
5492
|
-
if (ecmaVersion
|
|
5485
|
+
if (ecmaVersion >= 12) {
|
|
5493
5486
|
if (this.input.charCodeAt(this.pos + 2) === 61) return this.finishOp(types$1.assign, 3);
|
|
5494
5487
|
}
|
|
5495
5488
|
return this.finishOp(types$1.coalesce, 2);
|
|
@@ -5498,9 +5491,9 @@ pp.readToken_question = function() {
|
|
|
5498
5491
|
return this.finishOp(types$1.question, 1);
|
|
5499
5492
|
};
|
|
5500
5493
|
pp.readToken_numberSign = function() {
|
|
5501
|
-
var ecmaVersion
|
|
5494
|
+
var ecmaVersion = this.options.ecmaVersion;
|
|
5502
5495
|
var code = 35;
|
|
5503
|
-
if (ecmaVersion
|
|
5496
|
+
if (ecmaVersion >= 13) {
|
|
5504
5497
|
++this.pos;
|
|
5505
5498
|
code = this.fullCharCodeAtPos();
|
|
5506
5499
|
if (isIdentifierStart(code, true) || code === 92) return this.finishToken(types$1.privateId, this.readWord1());
|
|
@@ -5608,7 +5601,7 @@ pp.readRegexp = function() {
|
|
|
5608
5601
|
var value = null;
|
|
5609
5602
|
try {
|
|
5610
5603
|
value = new RegExp(pattern, flags);
|
|
5611
|
-
} catch (e
|
|
5604
|
+
} catch (e) {}
|
|
5612
5605
|
return this.finishToken(types$1.regexp, {
|
|
5613
5606
|
pattern,
|
|
5614
5607
|
flags,
|
|
@@ -5619,12 +5612,12 @@ pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
|
|
|
5619
5612
|
var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0;
|
|
5620
5613
|
var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
|
|
5621
5614
|
var start = this.pos, total = 0, lastCode = 0;
|
|
5622
|
-
for (var i
|
|
5615
|
+
for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
|
|
5623
5616
|
var code = this.input.charCodeAt(this.pos), val = void 0;
|
|
5624
5617
|
if (allowSeparators && code === 95) {
|
|
5625
5618
|
if (isLegacyOctalNumericLiteral) this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals");
|
|
5626
5619
|
if (lastCode === 95) this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore");
|
|
5627
|
-
if (i
|
|
5620
|
+
if (i === 0) this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits");
|
|
5628
5621
|
lastCode = code;
|
|
5629
5622
|
continue;
|
|
5630
5623
|
}
|
|
@@ -5845,9 +5838,9 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
5845
5838
|
};
|
|
5846
5839
|
pp.readHexChar = function(len) {
|
|
5847
5840
|
var codePos = this.pos;
|
|
5848
|
-
var n
|
|
5849
|
-
if (n
|
|
5850
|
-
return n
|
|
5841
|
+
var n = this.readInt(16, len);
|
|
5842
|
+
if (n === null) this.invalidStringToken(codePos, "Bad character escape sequence");
|
|
5843
|
+
return n;
|
|
5851
5844
|
};
|
|
5852
5845
|
pp.readWord1 = function() {
|
|
5853
5846
|
this.containsEsc = false;
|
|
@@ -5877,10 +5870,9 @@ pp.readWord = function() {
|
|
|
5877
5870
|
if (this.keywords.test(word)) type = keywords[word];
|
|
5878
5871
|
return this.finishToken(type, word);
|
|
5879
5872
|
};
|
|
5880
|
-
var version = "8.15.0";
|
|
5881
5873
|
Parser.acorn = {
|
|
5882
5874
|
Parser,
|
|
5883
|
-
version,
|
|
5875
|
+
version: "8.15.0",
|
|
5884
5876
|
defaultOptions,
|
|
5885
5877
|
Position,
|
|
5886
5878
|
SourceLocation,
|
|
@@ -5899,12 +5891,11 @@ Parser.acorn = {
|
|
|
5899
5891
|
lineBreakG,
|
|
5900
5892
|
nonASCIIwhitespace
|
|
5901
5893
|
};
|
|
5902
|
-
|
|
5903
5894
|
//#endregion
|
|
5904
5895
|
//#region ../../node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs
|
|
5905
5896
|
const BUILTIN_MODULES = new Set(node_module.builtinModules);
|
|
5906
|
-
function normalizeSlash(path
|
|
5907
|
-
return path
|
|
5897
|
+
function normalizeSlash(path) {
|
|
5898
|
+
return path.replace(/\\/g, "/");
|
|
5908
5899
|
}
|
|
5909
5900
|
/**
|
|
5910
5901
|
* @typedef ErrnoExceptionFields
|
|
@@ -5967,28 +5958,28 @@ codes.ERR_INVALID_ARG_TYPE = createError(
|
|
|
5967
5958
|
}
|
|
5968
5959
|
message += "must be ";
|
|
5969
5960
|
/** @type {Array<string>} */
|
|
5970
|
-
const types
|
|
5961
|
+
const types = [];
|
|
5971
5962
|
/** @type {Array<string>} */
|
|
5972
5963
|
const instances = [];
|
|
5973
5964
|
/** @type {Array<string>} */
|
|
5974
5965
|
const other = [];
|
|
5975
5966
|
for (const value of expected) {
|
|
5976
5967
|
(0, node_assert.default)(typeof value === "string", "All expected entries have to be of type string");
|
|
5977
|
-
if (kTypes.has(value)) types
|
|
5968
|
+
if (kTypes.has(value)) types.push(value.toLowerCase());
|
|
5978
5969
|
else if (classRegExp.exec(value) === null) {
|
|
5979
5970
|
(0, node_assert.default)(value !== "object", "The value \"object\" should be written as \"Object\"");
|
|
5980
5971
|
other.push(value);
|
|
5981
5972
|
} else instances.push(value);
|
|
5982
5973
|
}
|
|
5983
5974
|
if (instances.length > 0) {
|
|
5984
|
-
const pos = types
|
|
5975
|
+
const pos = types.indexOf("object");
|
|
5985
5976
|
if (pos !== -1) {
|
|
5986
|
-
types
|
|
5977
|
+
types.slice(pos, 1);
|
|
5987
5978
|
instances.push("Object");
|
|
5988
5979
|
}
|
|
5989
5980
|
}
|
|
5990
|
-
if (types
|
|
5991
|
-
message += `${types
|
|
5981
|
+
if (types.length > 0) {
|
|
5982
|
+
message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`;
|
|
5992
5983
|
if (instances.length > 0 || other.length > 0) message += " or ";
|
|
5993
5984
|
}
|
|
5994
5985
|
if (instances.length > 0) {
|
|
@@ -6024,8 +6015,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
6024
6015
|
* @param {string} [base]
|
|
6025
6016
|
* @param {string} [message]
|
|
6026
6017
|
*/
|
|
6027
|
-
(path
|
|
6028
|
-
return `Invalid package config ${path
|
|
6018
|
+
(path, base, message) => {
|
|
6019
|
+
return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
6029
6020
|
},
|
|
6030
6021
|
Error
|
|
6031
6022
|
);
|
|
@@ -6055,8 +6046,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
|
6055
6046
|
* @param {string} base
|
|
6056
6047
|
* @param {boolean} [exactUrl]
|
|
6057
6048
|
*/
|
|
6058
|
-
(path
|
|
6059
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path
|
|
6049
|
+
(path, base, exactUrl = false) => {
|
|
6050
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path}' imported from ${base}`;
|
|
6060
6051
|
},
|
|
6061
6052
|
Error
|
|
6062
6053
|
);
|
|
@@ -6094,8 +6085,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
6094
6085
|
* @param {string} extension
|
|
6095
6086
|
* @param {string} path
|
|
6096
6087
|
*/
|
|
6097
|
-
(extension, path
|
|
6098
|
-
return `Unknown file extension "${extension}" for ${path
|
|
6088
|
+
(extension, path) => {
|
|
6089
|
+
return `Unknown file extension "${extension}" for ${path}`;
|
|
6099
6090
|
},
|
|
6100
6091
|
TypeError
|
|
6101
6092
|
);
|
|
@@ -6401,8 +6392,8 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
|
6401
6392
|
if (packageType === "none" || packageType === "commonjs") return "commonjs";
|
|
6402
6393
|
return "module";
|
|
6403
6394
|
}
|
|
6404
|
-
const format
|
|
6405
|
-
if (format
|
|
6395
|
+
const format = extensionFormatMap[value];
|
|
6396
|
+
if (format) return format;
|
|
6406
6397
|
if (ignoreErrors) return;
|
|
6407
6398
|
throw new ERR_UNKNOWN_FILE_EXTENSION(value, (0, node_url.fileURLToPath)(url));
|
|
6408
6399
|
}
|
|
@@ -6464,9 +6455,9 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
6464
6455
|
* @param {string} path
|
|
6465
6456
|
* @returns {Stats | undefined}
|
|
6466
6457
|
*/
|
|
6467
|
-
function tryStatSync(path
|
|
6458
|
+
function tryStatSync(path) {
|
|
6468
6459
|
try {
|
|
6469
|
-
return (0, node_fs.statSync)(path
|
|
6460
|
+
return (0, node_fs.statSync)(path);
|
|
6470
6461
|
} catch {}
|
|
6471
6462
|
}
|
|
6472
6463
|
/**
|
|
@@ -6497,7 +6488,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
6497
6488
|
if (packageConfig.main !== void 0) {
|
|
6498
6489
|
guess = new node_url.URL(packageConfig.main, packageJsonUrl);
|
|
6499
6490
|
if (fileExists(guess)) return guess;
|
|
6500
|
-
const tries
|
|
6491
|
+
const tries = [
|
|
6501
6492
|
`./${packageConfig.main}.js`,
|
|
6502
6493
|
`./${packageConfig.main}.json`,
|
|
6503
6494
|
`./${packageConfig.main}.node`,
|
|
@@ -6505,9 +6496,9 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
6505
6496
|
`./${packageConfig.main}/index.json`,
|
|
6506
6497
|
`./${packageConfig.main}/index.node`
|
|
6507
6498
|
];
|
|
6508
|
-
let i
|
|
6509
|
-
while (++i
|
|
6510
|
-
guess = new node_url.URL(tries
|
|
6499
|
+
let i = -1;
|
|
6500
|
+
while (++i < tries.length) {
|
|
6501
|
+
guess = new node_url.URL(tries[i], packageJsonUrl);
|
|
6511
6502
|
if (fileExists(guess)) break;
|
|
6512
6503
|
guess = void 0;
|
|
6513
6504
|
}
|
|
@@ -6521,9 +6512,9 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
6521
6512
|
"./index.json",
|
|
6522
6513
|
"./index.node"
|
|
6523
6514
|
];
|
|
6524
|
-
let i
|
|
6525
|
-
while (++i
|
|
6526
|
-
guess = new node_url.URL(tries[i
|
|
6515
|
+
let i = -1;
|
|
6516
|
+
while (++i < tries.length) {
|
|
6517
|
+
guess = new node_url.URL(tries[i], packageJsonUrl);
|
|
6527
6518
|
if (fileExists(guess)) break;
|
|
6528
6519
|
guess = void 0;
|
|
6529
6520
|
}
|
|
@@ -6686,9 +6677,9 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
6686
6677
|
if (targetList.length === 0) return null;
|
|
6687
6678
|
/** @type {ErrnoException | null | undefined} */
|
|
6688
6679
|
let lastException;
|
|
6689
|
-
let i
|
|
6690
|
-
while (++i
|
|
6691
|
-
const targetItem = targetList[i
|
|
6680
|
+
let i = -1;
|
|
6681
|
+
while (++i < targetList.length) {
|
|
6682
|
+
const targetItem = targetList[i];
|
|
6692
6683
|
/** @type {URL | null} */
|
|
6693
6684
|
let resolveResult;
|
|
6694
6685
|
try {
|
|
@@ -6711,14 +6702,14 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
6711
6702
|
}
|
|
6712
6703
|
if (typeof target === "object" && target !== null) {
|
|
6713
6704
|
const keys = Object.getOwnPropertyNames(target);
|
|
6714
|
-
let i
|
|
6715
|
-
while (++i
|
|
6716
|
-
const key = keys[i
|
|
6705
|
+
let i = -1;
|
|
6706
|
+
while (++i < keys.length) {
|
|
6707
|
+
const key = keys[i];
|
|
6717
6708
|
if (isArrayIndex(key)) throw new ERR_INVALID_PACKAGE_CONFIG((0, node_url.fileURLToPath)(packageJsonUrl), base, "\"exports\" cannot contain numeric property keys.");
|
|
6718
6709
|
}
|
|
6719
|
-
i
|
|
6720
|
-
while (++i
|
|
6721
|
-
const key = keys[i
|
|
6710
|
+
i = -1;
|
|
6711
|
+
while (++i < keys.length) {
|
|
6712
|
+
const key = keys[i];
|
|
6722
6713
|
if (key === "default" || conditions && conditions.has(key)) {
|
|
6723
6714
|
const conditionalTarget = target[key];
|
|
6724
6715
|
const resolveResult = resolvePackageTarget(packageJsonUrl, conditionalTarget, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions);
|
|
@@ -6737,17 +6728,17 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
6737
6728
|
* @param {URL} base
|
|
6738
6729
|
* @returns {boolean}
|
|
6739
6730
|
*/
|
|
6740
|
-
function isConditionalExportsMainSugar(exports
|
|
6741
|
-
if (typeof exports
|
|
6742
|
-
if (typeof exports
|
|
6743
|
-
const keys = Object.getOwnPropertyNames(exports
|
|
6731
|
+
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
6732
|
+
if (typeof exports === "string" || Array.isArray(exports)) return true;
|
|
6733
|
+
if (typeof exports !== "object" || exports === null) return false;
|
|
6734
|
+
const keys = Object.getOwnPropertyNames(exports);
|
|
6744
6735
|
let isConditionalSugar = false;
|
|
6745
|
-
let i
|
|
6736
|
+
let i = 0;
|
|
6746
6737
|
let keyIndex = -1;
|
|
6747
6738
|
while (++keyIndex < keys.length) {
|
|
6748
6739
|
const key = keys[keyIndex];
|
|
6749
6740
|
const currentIsConditionalSugar = key === "" || key[0] !== ".";
|
|
6750
|
-
if (i
|
|
6741
|
+
if (i++ === 0) isConditionalSugar = currentIsConditionalSugar;
|
|
6751
6742
|
else if (isConditionalSugar !== currentIsConditionalSugar) throw new ERR_INVALID_PACKAGE_CONFIG((0, node_url.fileURLToPath)(packageJsonUrl), base, "\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.");
|
|
6752
6743
|
}
|
|
6753
6744
|
return isConditionalSugar;
|
|
@@ -6773,20 +6764,20 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
|
|
6773
6764
|
* @returns {URL}
|
|
6774
6765
|
*/
|
|
6775
6766
|
function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
|
|
6776
|
-
let exports
|
|
6777
|
-
if (isConditionalExportsMainSugar(exports
|
|
6778
|
-
if (own.call(exports
|
|
6779
|
-
const target = exports
|
|
6767
|
+
let exports = packageConfig.exports;
|
|
6768
|
+
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) exports = { ".": exports };
|
|
6769
|
+
if (own.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
|
|
6770
|
+
const target = exports[packageSubpath];
|
|
6780
6771
|
const resolveResult = resolvePackageTarget(packageJsonUrl, target, "", packageSubpath, base, false, false, false, conditions);
|
|
6781
6772
|
if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
6782
6773
|
return resolveResult;
|
|
6783
6774
|
}
|
|
6784
6775
|
let bestMatch = "";
|
|
6785
6776
|
let bestMatchSubpath = "";
|
|
6786
|
-
const keys = Object.getOwnPropertyNames(exports
|
|
6787
|
-
let i
|
|
6788
|
-
while (++i
|
|
6789
|
-
const key = keys[i
|
|
6777
|
+
const keys = Object.getOwnPropertyNames(exports);
|
|
6778
|
+
let i = -1;
|
|
6779
|
+
while (++i < keys.length) {
|
|
6780
|
+
const key = keys[i];
|
|
6790
6781
|
const patternIndex = key.indexOf("*");
|
|
6791
6782
|
if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) {
|
|
6792
6783
|
if (packageSubpath.endsWith("/")) emitTrailingSlashPatternDeprecation(packageSubpath, packageJsonUrl, base);
|
|
@@ -6798,7 +6789,7 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
|
|
|
6798
6789
|
}
|
|
6799
6790
|
}
|
|
6800
6791
|
if (bestMatch) {
|
|
6801
|
-
const target = exports
|
|
6792
|
+
const target = exports[bestMatch];
|
|
6802
6793
|
const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"), conditions);
|
|
6803
6794
|
if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
6804
6795
|
return resolveResult;
|
|
@@ -6809,17 +6800,17 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
|
|
|
6809
6800
|
* @param {string} a
|
|
6810
6801
|
* @param {string} b
|
|
6811
6802
|
*/
|
|
6812
|
-
function patternKeyCompare(a
|
|
6813
|
-
const aPatternIndex = a
|
|
6814
|
-
const bPatternIndex = b
|
|
6815
|
-
const baseLengthA = aPatternIndex === -1 ? a
|
|
6816
|
-
const baseLengthB = bPatternIndex === -1 ? b
|
|
6803
|
+
function patternKeyCompare(a, b) {
|
|
6804
|
+
const aPatternIndex = a.indexOf("*");
|
|
6805
|
+
const bPatternIndex = b.indexOf("*");
|
|
6806
|
+
const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
|
|
6807
|
+
const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
|
|
6817
6808
|
if (baseLengthA > baseLengthB) return -1;
|
|
6818
6809
|
if (baseLengthB > baseLengthA) return 1;
|
|
6819
6810
|
if (aPatternIndex === -1) return 1;
|
|
6820
6811
|
if (bPatternIndex === -1) return -1;
|
|
6821
|
-
if (a
|
|
6822
|
-
if (b
|
|
6812
|
+
if (a.length > b.length) return -1;
|
|
6813
|
+
if (b.length > a.length) return 1;
|
|
6823
6814
|
return 0;
|
|
6824
6815
|
}
|
|
6825
6816
|
/**
|
|
@@ -6843,9 +6834,9 @@ function packageImportsResolve(name, base, conditions) {
|
|
|
6843
6834
|
let bestMatch = "";
|
|
6844
6835
|
let bestMatchSubpath = "";
|
|
6845
6836
|
const keys = Object.getOwnPropertyNames(imports);
|
|
6846
|
-
let i
|
|
6847
|
-
while (++i
|
|
6848
|
-
const key = keys[i
|
|
6837
|
+
let i = -1;
|
|
6838
|
+
while (++i < keys.length) {
|
|
6839
|
+
const key = keys[i];
|
|
6849
6840
|
const patternIndex = key.indexOf("*");
|
|
6850
6841
|
if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {
|
|
6851
6842
|
const patternTrailer = key.slice(patternIndex + 1);
|
|
@@ -6898,8 +6889,8 @@ function packageResolve(specifier, base, conditions) {
|
|
|
6898
6889
|
const packageConfig = getPackageScopeConfig(base);
|
|
6899
6890
|
/* c8 ignore next 16 */
|
|
6900
6891
|
if (packageConfig.exists) {
|
|
6901
|
-
const packageJsonUrl
|
|
6902
|
-
if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(packageJsonUrl
|
|
6892
|
+
const packageJsonUrl = (0, node_url.pathToFileURL)(packageConfig.pjsonPath);
|
|
6893
|
+
if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions);
|
|
6903
6894
|
}
|
|
6904
6895
|
let packageJsonUrl = new node_url.URL("./node_modules/" + packageName + "/package.json", base);
|
|
6905
6896
|
let packageJsonPath = (0, node_url.fileURLToPath)(packageJsonUrl);
|
|
@@ -6913,12 +6904,12 @@ function packageResolve(specifier, base, conditions) {
|
|
|
6913
6904
|
packageJsonPath = (0, node_url.fileURLToPath)(packageJsonUrl);
|
|
6914
6905
|
continue;
|
|
6915
6906
|
}
|
|
6916
|
-
const packageConfig
|
|
6907
|
+
const packageConfig = read(packageJsonPath, {
|
|
6917
6908
|
base,
|
|
6918
6909
|
specifier
|
|
6919
6910
|
});
|
|
6920
|
-
if (packageConfig
|
|
6921
|
-
if (packageSubpath === ".") return legacyMainResolve(packageJsonUrl, packageConfig
|
|
6911
|
+
if (packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions);
|
|
6912
|
+
if (packageSubpath === ".") return legacyMainResolve(packageJsonUrl, packageConfig, base);
|
|
6922
6913
|
return new node_url.URL(packageSubpath, packageJsonUrl);
|
|
6923
6914
|
} while (packageJsonPath.length !== lastPath.length);
|
|
6924
6915
|
throw new ERR_MODULE_NOT_FOUND(packageName, (0, node_url.fileURLToPath)(base), false);
|
|
@@ -7067,7 +7058,6 @@ function resolvePath(id, options) {
|
|
|
7067
7058
|
return Promise.reject(error);
|
|
7068
7059
|
}
|
|
7069
7060
|
}
|
|
7070
|
-
|
|
7071
7061
|
//#endregion
|
|
7072
7062
|
//#region ../../node_modules/.pnpm/@iconify+utils@3.1.0/node_modules/@iconify/utils/lib/loader/resolve.js
|
|
7073
7063
|
/**
|
|
@@ -7078,7 +7068,6 @@ async function resolvePathAsync(packageName, cwd) {
|
|
|
7078
7068
|
return await resolvePath(packageName, { url: cwd });
|
|
7079
7069
|
} catch {}
|
|
7080
7070
|
}
|
|
7081
|
-
|
|
7082
7071
|
//#endregion
|
|
7083
7072
|
//#region ../../node_modules/.pnpm/@iconify+utils@3.1.0/node_modules/@iconify/utils/lib/loader/fs.js
|
|
7084
7073
|
const _collections = Object.create(null);
|
|
@@ -7094,9 +7083,9 @@ const isLegacyExists = Object.create(null);
|
|
|
7094
7083
|
* @return {Promise<IconifyJSON | undefined>} the loaded IconifyJSON or undefined
|
|
7095
7084
|
*/
|
|
7096
7085
|
async function loadCollectionFromFS(name, autoInstall = false, scope = "@iconify-json", cwd = process.cwd()) {
|
|
7097
|
-
const cache
|
|
7098
|
-
if (!await cache
|
|
7099
|
-
return cache
|
|
7086
|
+
const cache = _collections[cwd] || (_collections[cwd] = Object.create(null));
|
|
7087
|
+
if (!await cache[name]) cache[name] = task();
|
|
7088
|
+
return cache[name];
|
|
7100
7089
|
async function task() {
|
|
7101
7090
|
const packageName = scope.length === 0 ? name : `${scope}/${name}`;
|
|
7102
7091
|
let jsonPath = await resolvePathAsync(`${packageName}/icons.json`, cwd);
|
|
@@ -7130,15 +7119,14 @@ async function loadCollectionFromFS(name, autoInstall = false, scope = "@iconify
|
|
|
7130
7119
|
else return;
|
|
7131
7120
|
}
|
|
7132
7121
|
}
|
|
7133
|
-
|
|
7134
7122
|
//#endregion
|
|
7135
7123
|
//#region ../../node_modules/.pnpm/@iconify+utils@3.1.0/node_modules/@iconify/utils/lib/loader/node-loader.js
|
|
7136
7124
|
const loadNodeIcon = async (collection, icon, options) => {
|
|
7137
7125
|
let result = await require_server.loadIcon(collection, icon, options);
|
|
7138
7126
|
if (result) return result;
|
|
7139
7127
|
const cwds = Array.isArray(options?.cwd) ? options.cwd : [options?.cwd];
|
|
7140
|
-
for (let i
|
|
7141
|
-
const iconSet = await loadCollectionFromFS(collection, i
|
|
7128
|
+
for (let i = 0; i < cwds.length; i++) {
|
|
7129
|
+
const iconSet = await loadCollectionFromFS(collection, i === cwds.length - 1 ? options?.autoInstall : false, void 0, cwds[i]);
|
|
7142
7130
|
if (iconSet) {
|
|
7143
7131
|
result = await require_server.searchForIcon(iconSet, collection, require_server.getPossibleIconNames(icon), options);
|
|
7144
7132
|
if (result) return result;
|
|
@@ -7146,6 +7134,5 @@ const loadNodeIcon = async (collection, icon, options) => {
|
|
|
7146
7134
|
}
|
|
7147
7135
|
if (options?.warn) warnOnce(`failed to load ${options.warn} icon`);
|
|
7148
7136
|
};
|
|
7149
|
-
|
|
7150
7137
|
//#endregion
|
|
7151
|
-
exports.loadNodeIcon = loadNodeIcon;
|
|
7138
|
+
exports.loadNodeIcon = loadNodeIcon;
|