@datapos/datapos-development 0.3.346 → 0.3.348
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { promises as
|
|
1
|
+
import { promises as ae } from "node:fs";
|
|
2
2
|
import { nanoid as Vs } from "nanoid";
|
|
3
|
-
import
|
|
3
|
+
import Dt from "node:path";
|
|
4
4
|
import { fileURLToPath as Pr, URL as zs } from "node:url";
|
|
5
5
|
import { promisify as js } from "node:util";
|
|
6
6
|
import { exec as Fs, spawn as $s } from "node:child_process";
|
|
@@ -10,14 +10,14 @@ function k(e, t, i) {
|
|
|
10
10
|
if (d._zod || Object.defineProperty(d, "_zod", {
|
|
11
11
|
value: {
|
|
12
12
|
def: y,
|
|
13
|
-
constr:
|
|
13
|
+
constr: h,
|
|
14
14
|
traits: /* @__PURE__ */ new Set()
|
|
15
15
|
},
|
|
16
16
|
enumerable: !1
|
|
17
17
|
}), d._zod.traits.has(e))
|
|
18
18
|
return;
|
|
19
19
|
d._zod.traits.add(e), t(d, y);
|
|
20
|
-
const o =
|
|
20
|
+
const o = h.prototype, w = Object.keys(o);
|
|
21
21
|
for (let S = 0; S < w.length; S++) {
|
|
22
22
|
const A = w[S];
|
|
23
23
|
A in d || (d[A] = o[A].bind(d));
|
|
@@ -27,7 +27,7 @@ function k(e, t, i) {
|
|
|
27
27
|
class u extends n {
|
|
28
28
|
}
|
|
29
29
|
Object.defineProperty(u, "name", { value: e });
|
|
30
|
-
function
|
|
30
|
+
function h(d) {
|
|
31
31
|
var y;
|
|
32
32
|
const o = i?.Parent ? new u() : this;
|
|
33
33
|
r(o, d), (y = o._zod).deferred ?? (y.deferred = []);
|
|
@@ -35,9 +35,9 @@ function k(e, t, i) {
|
|
|
35
35
|
w();
|
|
36
36
|
return o;
|
|
37
37
|
}
|
|
38
|
-
return Object.defineProperty(
|
|
38
|
+
return Object.defineProperty(h, "init", { value: r }), Object.defineProperty(h, Symbol.hasInstance, {
|
|
39
39
|
value: (d) => i?.Parent && d instanceof i.Parent ? !0 : d?._zod?.traits?.has(e)
|
|
40
|
-
}), Object.defineProperty(
|
|
40
|
+
}), Object.defineProperty(h, "name", { value: e }), h;
|
|
41
41
|
}
|
|
42
42
|
class rt extends Error {
|
|
43
43
|
constructor() {
|
|
@@ -84,8 +84,8 @@ function qs(e, t) {
|
|
|
84
84
|
const y = r.match(/\d?e-(\d?)/);
|
|
85
85
|
y?.[1] && (n = Number.parseInt(y[1]));
|
|
86
86
|
}
|
|
87
|
-
const u = i > n ? i : n,
|
|
88
|
-
return
|
|
87
|
+
const u = i > n ? i : n, h = Number.parseInt(e.toFixed(u).replace(".", "")), d = Number.parseInt(t.toFixed(u).replace(".", ""));
|
|
88
|
+
return h % d / 10 ** u;
|
|
89
89
|
}
|
|
90
90
|
const Fi = Symbol("evaluating");
|
|
91
91
|
function U(e, t, i) {
|
|
@@ -261,20 +261,20 @@ function rn(e, t, i) {
|
|
|
261
261
|
get shape() {
|
|
262
262
|
const n = t._zod.def.shape, u = { ...n };
|
|
263
263
|
if (i)
|
|
264
|
-
for (const
|
|
265
|
-
if (!(
|
|
266
|
-
throw new Error(`Unrecognized key: "${
|
|
267
|
-
i[
|
|
264
|
+
for (const h in i) {
|
|
265
|
+
if (!(h in n))
|
|
266
|
+
throw new Error(`Unrecognized key: "${h}"`);
|
|
267
|
+
i[h] && (u[h] = e ? new e({
|
|
268
268
|
type: "optional",
|
|
269
|
-
innerType: n[
|
|
270
|
-
}) : n[
|
|
269
|
+
innerType: n[h]
|
|
270
|
+
}) : n[h]);
|
|
271
271
|
}
|
|
272
272
|
else
|
|
273
|
-
for (const
|
|
274
|
-
u[
|
|
273
|
+
for (const h in n)
|
|
274
|
+
u[h] = e ? new e({
|
|
275
275
|
type: "optional",
|
|
276
|
-
innerType: n[
|
|
277
|
-
}) : n[
|
|
276
|
+
innerType: n[h]
|
|
277
|
+
}) : n[h];
|
|
278
278
|
return Xe(this, "shape", u), u;
|
|
279
279
|
},
|
|
280
280
|
checks: []
|
|
@@ -286,19 +286,19 @@ function sn(e, t, i) {
|
|
|
286
286
|
get shape() {
|
|
287
287
|
const n = t._zod.def.shape, u = { ...n };
|
|
288
288
|
if (i)
|
|
289
|
-
for (const
|
|
290
|
-
if (!(
|
|
291
|
-
throw new Error(`Unrecognized key: "${
|
|
292
|
-
i[
|
|
289
|
+
for (const h in i) {
|
|
290
|
+
if (!(h in u))
|
|
291
|
+
throw new Error(`Unrecognized key: "${h}"`);
|
|
292
|
+
i[h] && (u[h] = new e({
|
|
293
293
|
type: "nonoptional",
|
|
294
|
-
innerType: n[
|
|
294
|
+
innerType: n[h]
|
|
295
295
|
}));
|
|
296
296
|
}
|
|
297
297
|
else
|
|
298
|
-
for (const
|
|
299
|
-
u[
|
|
298
|
+
for (const h in n)
|
|
299
|
+
u[h] = new e({
|
|
300
300
|
type: "nonoptional",
|
|
301
|
-
innerType: n[
|
|
301
|
+
innerType: n[h]
|
|
302
302
|
});
|
|
303
303
|
return Xe(this, "shape", u), u;
|
|
304
304
|
},
|
|
@@ -320,13 +320,13 @@ function it(e, t) {
|
|
|
320
320
|
return (r = i).path ?? (r.path = []), i.path.unshift(e), i;
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function It(e) {
|
|
324
324
|
return typeof e == "string" ? e : e?.message;
|
|
325
325
|
}
|
|
326
326
|
function qe(e, t, i) {
|
|
327
327
|
const r = { ...e, path: e.path ?? [] };
|
|
328
328
|
if (!e.message) {
|
|
329
|
-
const n =
|
|
329
|
+
const n = It(e.inst?._zod.def?.error?.(e)) ?? It(t?.error?.(e)) ?? It(i.customError?.(e)) ?? It(i.localeError?.(e)) ?? "Invalid input";
|
|
330
330
|
r.message = n;
|
|
331
331
|
}
|
|
332
332
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
@@ -334,7 +334,7 @@ function qe(e, t, i) {
|
|
|
334
334
|
function _i(e) {
|
|
335
335
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function bt(...e) {
|
|
338
338
|
const [t, i, r] = e;
|
|
339
339
|
return typeof t == "string" ? {
|
|
340
340
|
message: t,
|
|
@@ -365,7 +365,7 @@ function an(e, t = (i) => i.message) {
|
|
|
365
365
|
const i = { _errors: [] }, r = (n) => {
|
|
366
366
|
for (const u of n.issues)
|
|
367
367
|
if (u.code === "invalid_union" && u.errors.length)
|
|
368
|
-
u.errors.map((
|
|
368
|
+
u.errors.map((h) => r({ issues: h }));
|
|
369
369
|
else if (u.code === "invalid_key")
|
|
370
370
|
r({ issues: u.issues });
|
|
371
371
|
else if (u.code === "invalid_element")
|
|
@@ -373,46 +373,46 @@ function an(e, t = (i) => i.message) {
|
|
|
373
373
|
else if (u.path.length === 0)
|
|
374
374
|
i._errors.push(t(u));
|
|
375
375
|
else {
|
|
376
|
-
let
|
|
376
|
+
let h = i, d = 0;
|
|
377
377
|
for (; d < u.path.length; ) {
|
|
378
378
|
const y = u.path[d];
|
|
379
|
-
d === u.path.length - 1 ? (
|
|
379
|
+
d === u.path.length - 1 ? (h[y] = h[y] || { _errors: [] }, h[y]._errors.push(t(u))) : h[y] = h[y] || { _errors: [] }, h = h[y], d++;
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
return r(e), i;
|
|
384
384
|
}
|
|
385
385
|
const ki = (e) => (t, i, r, n) => {
|
|
386
|
-
const u = r ? Object.assign(r, { async: !1 }) : { async: !1 },
|
|
387
|
-
if (
|
|
386
|
+
const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, h = t._zod.run({ value: i, issues: [] }, u);
|
|
387
|
+
if (h instanceof Promise)
|
|
388
388
|
throw new rt();
|
|
389
|
-
if (
|
|
390
|
-
const d = new (n?.Err ?? e)(
|
|
389
|
+
if (h.issues.length) {
|
|
390
|
+
const d = new (n?.Err ?? e)(h.issues.map((y) => qe(y, u, Ue())));
|
|
391
391
|
throw Er(d, n?.callee), d;
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return h.value;
|
|
394
394
|
}, wi = (e) => async (t, i, r, n) => {
|
|
395
395
|
const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
396
|
-
let
|
|
397
|
-
if (
|
|
398
|
-
const d = new (n?.Err ?? e)(
|
|
396
|
+
let h = t._zod.run({ value: i, issues: [] }, u);
|
|
397
|
+
if (h instanceof Promise && (h = await h), h.issues.length) {
|
|
398
|
+
const d = new (n?.Err ?? e)(h.issues.map((y) => qe(y, u, Ue())));
|
|
399
399
|
throw Er(d, n?.callee), d;
|
|
400
400
|
}
|
|
401
|
-
return
|
|
401
|
+
return h.value;
|
|
402
402
|
}, qt = (e) => (t, i, r) => {
|
|
403
403
|
const n = r ? { ...r, async: !1 } : { async: !1 }, u = t._zod.run({ value: i, issues: [] }, n);
|
|
404
404
|
if (u instanceof Promise)
|
|
405
405
|
throw new rt();
|
|
406
406
|
return u.issues.length ? {
|
|
407
407
|
success: !1,
|
|
408
|
-
error: new (e ?? Lr)(u.issues.map((
|
|
408
|
+
error: new (e ?? Lr)(u.issues.map((h) => qe(h, n, Ue())))
|
|
409
409
|
} : { success: !0, data: u.value };
|
|
410
410
|
}, on = /* @__PURE__ */ qt(Or), Ht = (e) => async (t, i, r) => {
|
|
411
411
|
const n = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
412
412
|
let u = t._zod.run({ value: i, issues: [] }, n);
|
|
413
413
|
return u instanceof Promise && (u = await u), u.issues.length ? {
|
|
414
414
|
success: !1,
|
|
415
|
-
error: new e(u.issues.map((
|
|
415
|
+
error: new e(u.issues.map((h) => qe(h, n, Ue())))
|
|
416
416
|
} : { success: !0, data: u.value };
|
|
417
417
|
}, un = /* @__PURE__ */ Ht(Or), cn = (e) => (t, i, r) => {
|
|
418
418
|
const n = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
@@ -507,14 +507,14 @@ const Vn = (e) => {
|
|
|
507
507
|
}), Un = /* @__PURE__ */ k("$ZodCheckNumberFormat", (e, t) => {
|
|
508
508
|
ye.init(e, t), t.format = t.format || "float64";
|
|
509
509
|
const i = t.format?.includes("int"), r = i ? "int" : "number", [n, u] = Xs[t.format];
|
|
510
|
-
e._zod.onattach.push((
|
|
511
|
-
const d =
|
|
510
|
+
e._zod.onattach.push((h) => {
|
|
511
|
+
const d = h._zod.bag;
|
|
512
512
|
d.format = t.format, d.minimum = n, d.maximum = u, i && (d.pattern = zn);
|
|
513
|
-
}), e._zod.check = (
|
|
514
|
-
const d =
|
|
513
|
+
}), e._zod.check = (h) => {
|
|
514
|
+
const d = h.value;
|
|
515
515
|
if (i) {
|
|
516
516
|
if (!Number.isInteger(d)) {
|
|
517
|
-
|
|
517
|
+
h.issues.push({
|
|
518
518
|
expected: r,
|
|
519
519
|
format: t.format,
|
|
520
520
|
code: "invalid_type",
|
|
@@ -525,7 +525,7 @@ const Vn = (e) => {
|
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
527
|
if (!Number.isSafeInteger(d)) {
|
|
528
|
-
d > 0 ?
|
|
528
|
+
d > 0 ? h.issues.push({
|
|
529
529
|
input: d,
|
|
530
530
|
code: "too_big",
|
|
531
531
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
@@ -533,7 +533,7 @@ const Vn = (e) => {
|
|
|
533
533
|
inst: e,
|
|
534
534
|
origin: r,
|
|
535
535
|
continue: !t.abort
|
|
536
|
-
}) :
|
|
536
|
+
}) : h.issues.push({
|
|
537
537
|
input: d,
|
|
538
538
|
code: "too_small",
|
|
539
539
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
@@ -545,7 +545,7 @@ const Vn = (e) => {
|
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
d < n &&
|
|
548
|
+
d < n && h.issues.push({
|
|
549
549
|
origin: "number",
|
|
550
550
|
input: d,
|
|
551
551
|
code: "too_small",
|
|
@@ -553,7 +553,7 @@ const Vn = (e) => {
|
|
|
553
553
|
inclusive: !0,
|
|
554
554
|
inst: e,
|
|
555
555
|
continue: !t.abort
|
|
556
|
-
}), d > u &&
|
|
556
|
+
}), d > u && h.issues.push({
|
|
557
557
|
origin: "number",
|
|
558
558
|
input: d,
|
|
559
559
|
code: "too_big",
|
|
@@ -573,9 +573,9 @@ const Vn = (e) => {
|
|
|
573
573
|
const n = r.value;
|
|
574
574
|
if (n.length <= t.maximum)
|
|
575
575
|
return;
|
|
576
|
-
const
|
|
576
|
+
const h = _i(n);
|
|
577
577
|
r.issues.push({
|
|
578
|
-
origin:
|
|
578
|
+
origin: h,
|
|
579
579
|
code: "too_big",
|
|
580
580
|
maximum: t.maximum,
|
|
581
581
|
inclusive: !0,
|
|
@@ -596,9 +596,9 @@ const Vn = (e) => {
|
|
|
596
596
|
const n = r.value;
|
|
597
597
|
if (n.length >= t.minimum)
|
|
598
598
|
return;
|
|
599
|
-
const
|
|
599
|
+
const h = _i(n);
|
|
600
600
|
r.issues.push({
|
|
601
|
-
origin:
|
|
601
|
+
origin: h,
|
|
602
602
|
code: "too_small",
|
|
603
603
|
minimum: t.minimum,
|
|
604
604
|
inclusive: !0,
|
|
@@ -619,9 +619,9 @@ const Vn = (e) => {
|
|
|
619
619
|
const n = r.value, u = n.length;
|
|
620
620
|
if (u === t.length)
|
|
621
621
|
return;
|
|
622
|
-
const
|
|
622
|
+
const h = _i(n), d = u > t.length;
|
|
623
623
|
r.issues.push({
|
|
624
|
-
origin:
|
|
624
|
+
origin: h,
|
|
625
625
|
...d ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
626
626
|
inclusive: !0,
|
|
627
627
|
exact: !0,
|
|
@@ -732,9 +732,9 @@ class ta {
|
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
734
|
const r = t.split(`
|
|
735
|
-
`).filter((
|
|
736
|
-
for (const
|
|
737
|
-
this.content.push(
|
|
735
|
+
`).filter((h) => h), n = Math.min(...r.map((h) => h.length - h.trimStart().length)), u = r.map((h) => h.slice(n)).map((h) => " ".repeat(this.indent * 2) + h);
|
|
736
|
+
for (const h of u)
|
|
737
|
+
this.content.push(h);
|
|
738
738
|
}
|
|
739
739
|
compile() {
|
|
740
740
|
const t = Function, i = this?.args, n = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
|
|
@@ -759,31 +759,31 @@ const ia = {
|
|
|
759
759
|
e._zod.run = e._zod.parse;
|
|
760
760
|
});
|
|
761
761
|
else {
|
|
762
|
-
const n = (
|
|
763
|
-
let o = tt(
|
|
762
|
+
const n = (h, d, y) => {
|
|
763
|
+
let o = tt(h), w;
|
|
764
764
|
for (const S of d) {
|
|
765
765
|
if (S._zod.def.when) {
|
|
766
|
-
if (!S._zod.def.when(
|
|
766
|
+
if (!S._zod.def.when(h))
|
|
767
767
|
continue;
|
|
768
768
|
} else if (o)
|
|
769
769
|
continue;
|
|
770
|
-
const A =
|
|
770
|
+
const A = h.issues.length, F = S._zod.check(h);
|
|
771
771
|
if (F instanceof Promise && y?.async === !1)
|
|
772
772
|
throw new rt();
|
|
773
773
|
if (w || F instanceof Promise)
|
|
774
774
|
w = (w ?? Promise.resolve()).then(async () => {
|
|
775
|
-
await F,
|
|
775
|
+
await F, h.issues.length !== A && (o || (o = tt(h, A)));
|
|
776
776
|
});
|
|
777
777
|
else {
|
|
778
|
-
if (
|
|
778
|
+
if (h.issues.length === A)
|
|
779
779
|
continue;
|
|
780
|
-
o || (o = tt(
|
|
780
|
+
o || (o = tt(h, A));
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
|
-
return w ? w.then(() =>
|
|
784
|
-
}, u = (
|
|
785
|
-
if (tt(
|
|
786
|
-
return
|
|
783
|
+
return w ? w.then(() => h) : h;
|
|
784
|
+
}, u = (h, d, y) => {
|
|
785
|
+
if (tt(h))
|
|
786
|
+
return h.aborted = !0, h;
|
|
787
787
|
const o = n(d, r, y);
|
|
788
788
|
if (o instanceof Promise) {
|
|
789
789
|
if (y.async === !1)
|
|
@@ -792,14 +792,14 @@ const ia = {
|
|
|
792
792
|
}
|
|
793
793
|
return e._zod.parse(o, y);
|
|
794
794
|
};
|
|
795
|
-
e._zod.run = (
|
|
795
|
+
e._zod.run = (h, d) => {
|
|
796
796
|
if (d.skipChecks)
|
|
797
|
-
return e._zod.parse(
|
|
797
|
+
return e._zod.parse(h, d);
|
|
798
798
|
if (d.direction === "backward") {
|
|
799
|
-
const o = e._zod.parse({ value:
|
|
800
|
-
return o instanceof Promise ? o.then((w) => u(w,
|
|
799
|
+
const o = e._zod.parse({ value: h.value, issues: [] }, { ...d, skipChecks: !0 });
|
|
800
|
+
return o instanceof Promise ? o.then((w) => u(w, h, d)) : u(o, h, d);
|
|
801
801
|
}
|
|
802
|
-
const y = e._zod.parse(
|
|
802
|
+
const y = e._zod.parse(h, d);
|
|
803
803
|
if (y instanceof Promise) {
|
|
804
804
|
if (d.async === !1)
|
|
805
805
|
throw new rt();
|
|
@@ -814,7 +814,7 @@ const ia = {
|
|
|
814
814
|
const u = on(e, n);
|
|
815
815
|
return u.success ? { value: u.data } : { issues: u.error?.issues };
|
|
816
816
|
} catch {
|
|
817
|
-
return un(e, n).then((
|
|
817
|
+
return un(e, n).then((h) => h.success ? { value: h.data } : { issues: h.error?.issues });
|
|
818
818
|
}
|
|
819
819
|
},
|
|
820
820
|
vendor: "zod",
|
|
@@ -939,10 +939,10 @@ const ia = {
|
|
|
939
939
|
const [n, u] = r;
|
|
940
940
|
if (!u)
|
|
941
941
|
throw new Error();
|
|
942
|
-
const
|
|
943
|
-
if (`${
|
|
942
|
+
const h = Number(u);
|
|
943
|
+
if (`${h}` !== u)
|
|
944
944
|
throw new Error();
|
|
945
|
-
if (
|
|
945
|
+
if (h < 0 || h > 128)
|
|
946
946
|
throw new Error();
|
|
947
947
|
new URL(`http://[${n}]`);
|
|
948
948
|
} catch {
|
|
@@ -1082,12 +1082,12 @@ const La = /* @__PURE__ */ k("$ZodArray", (e, t) => {
|
|
|
1082
1082
|
}), i;
|
|
1083
1083
|
i.value = Array(n.length);
|
|
1084
1084
|
const u = [];
|
|
1085
|
-
for (let
|
|
1086
|
-
const d = n[
|
|
1085
|
+
for (let h = 0; h < n.length; h++) {
|
|
1086
|
+
const d = n[h], y = t.element._zod.run({
|
|
1087
1087
|
value: d,
|
|
1088
1088
|
issues: []
|
|
1089
1089
|
}, r);
|
|
1090
|
-
y instanceof Promise ? u.push(y.then((o) => Zi(o, i,
|
|
1090
|
+
y instanceof Promise ? u.push(y.then((o) => Zi(o, i, h))) : Zi(y, i, h);
|
|
1091
1091
|
}
|
|
1092
1092
|
return u.length ? Promise.all(u).then(() => i) : i;
|
|
1093
1093
|
};
|
|
@@ -1110,20 +1110,20 @@ function Br(e) {
|
|
|
1110
1110
|
};
|
|
1111
1111
|
}
|
|
1112
1112
|
function Zr(e, t, i, r, n, u) {
|
|
1113
|
-
const
|
|
1113
|
+
const h = [], d = n.keySet, y = n.catchall._zod, o = y.def.type;
|
|
1114
1114
|
for (const w in t) {
|
|
1115
1115
|
if (d.has(w))
|
|
1116
1116
|
continue;
|
|
1117
1117
|
if (o === "never") {
|
|
1118
|
-
|
|
1118
|
+
h.push(w);
|
|
1119
1119
|
continue;
|
|
1120
1120
|
}
|
|
1121
1121
|
const S = y.run({ value: t[w], issues: [] }, r);
|
|
1122
1122
|
S instanceof Promise ? e.push(S.then((A) => Vt(A, i, w, t))) : Vt(S, i, w, t);
|
|
1123
1123
|
}
|
|
1124
|
-
return
|
|
1124
|
+
return h.length && i.issues.push({
|
|
1125
1125
|
code: "unrecognized_keys",
|
|
1126
|
-
keys:
|
|
1126
|
+
keys: h,
|
|
1127
1127
|
input: t,
|
|
1128
1128
|
inst: u
|
|
1129
1129
|
}), e.length ? Promise.all(e).then(() => i) : i;
|
|
@@ -1154,9 +1154,9 @@ const Oa = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1154
1154
|
return y;
|
|
1155
1155
|
});
|
|
1156
1156
|
const n = Mt, u = t.catchall;
|
|
1157
|
-
let
|
|
1157
|
+
let h;
|
|
1158
1158
|
e._zod.parse = (d, y) => {
|
|
1159
|
-
|
|
1159
|
+
h ?? (h = r.value);
|
|
1160
1160
|
const o = d.value;
|
|
1161
1161
|
if (!n(o))
|
|
1162
1162
|
return d.issues.push({
|
|
@@ -1166,8 +1166,8 @@ const Oa = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1166
1166
|
inst: e
|
|
1167
1167
|
}), d;
|
|
1168
1168
|
d.value = {};
|
|
1169
|
-
const w = [], S =
|
|
1170
|
-
for (const A of
|
|
1169
|
+
const w = [], S = h.shape;
|
|
1170
|
+
for (const A of h.keys) {
|
|
1171
1171
|
const Z = S[A]._zod.run({ value: o[A], issues: [] }, y);
|
|
1172
1172
|
Z instanceof Promise ? w.push(Z.then((pe) => Vt(pe, d, A, o))) : Vt(Z, d, A, o);
|
|
1173
1173
|
}
|
|
@@ -1182,9 +1182,9 @@ const Oa = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1182
1182
|
};
|
|
1183
1183
|
F.write("const input = payload.value;");
|
|
1184
1184
|
const D = /* @__PURE__ */ Object.create(null);
|
|
1185
|
-
let
|
|
1185
|
+
let se = 0;
|
|
1186
1186
|
for (const Ae of Z.keys)
|
|
1187
|
-
D[Ae] = `key_${
|
|
1187
|
+
D[Ae] = `key_${se++}`;
|
|
1188
1188
|
F.write("const newResult = {};");
|
|
1189
1189
|
for (const Ae of Z.keys) {
|
|
1190
1190
|
const _e = D[Ae], Ke = $i(Ae);
|
|
@@ -1212,12 +1212,12 @@ const Oa = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1212
1212
|
return (Ae, _e) => ft(A, Ae, _e);
|
|
1213
1213
|
};
|
|
1214
1214
|
let u;
|
|
1215
|
-
const
|
|
1215
|
+
const h = Mt, d = !Ar.jitless, o = d && Gs.value, w = t.catchall;
|
|
1216
1216
|
let S;
|
|
1217
1217
|
e._zod.parse = (A, F) => {
|
|
1218
1218
|
S ?? (S = r.value);
|
|
1219
1219
|
const Z = A.value;
|
|
1220
|
-
return
|
|
1220
|
+
return h(Z) ? d && o && F?.async === !1 && F.jitless !== !0 ? (u || (u = n(t.shape)), A = u(A, F), w ? Zr([], Z, A, F, S, e) : A) : i(A, F) : (A.issues.push({
|
|
1221
1221
|
expected: "object",
|
|
1222
1222
|
code: "invalid_type",
|
|
1223
1223
|
input: Z,
|
|
@@ -1234,7 +1234,7 @@ function Ui(e, t, i, r) {
|
|
|
1234
1234
|
code: "invalid_union",
|
|
1235
1235
|
input: t.value,
|
|
1236
1236
|
inst: i,
|
|
1237
|
-
errors: e.map((u) => u.issues.map((
|
|
1237
|
+
errors: e.map((u) => u.issues.map((h) => qe(h, r, Ue())))
|
|
1238
1238
|
}), t);
|
|
1239
1239
|
}
|
|
1240
1240
|
const Da = /* @__PURE__ */ k("$ZodUnion", (e, t) => {
|
|
@@ -1251,7 +1251,7 @@ const Da = /* @__PURE__ */ k("$ZodUnion", (e, t) => {
|
|
|
1251
1251
|
e._zod.parse = (n, u) => {
|
|
1252
1252
|
if (i)
|
|
1253
1253
|
return r(n, u);
|
|
1254
|
-
let
|
|
1254
|
+
let h = !1;
|
|
1255
1255
|
const d = [];
|
|
1256
1256
|
for (const y of t.options) {
|
|
1257
1257
|
const o = y._zod.run({
|
|
@@ -1259,19 +1259,19 @@ const Da = /* @__PURE__ */ k("$ZodUnion", (e, t) => {
|
|
|
1259
1259
|
issues: []
|
|
1260
1260
|
}, u);
|
|
1261
1261
|
if (o instanceof Promise)
|
|
1262
|
-
d.push(o),
|
|
1262
|
+
d.push(o), h = !0;
|
|
1263
1263
|
else {
|
|
1264
1264
|
if (o.issues.length === 0)
|
|
1265
1265
|
return o;
|
|
1266
1266
|
d.push(o);
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
|
-
return
|
|
1269
|
+
return h ? Promise.all(d).then((y) => Ui(y, n, e, u)) : Ui(d, n, e, u);
|
|
1270
1270
|
};
|
|
1271
1271
|
}), Ma = /* @__PURE__ */ k("$ZodIntersection", (e, t) => {
|
|
1272
1272
|
Y.init(e, t), e._zod.parse = (i, r) => {
|
|
1273
|
-
const n = i.value, u = t.left._zod.run({ value: n, issues: [] }, r),
|
|
1274
|
-
return u instanceof Promise ||
|
|
1273
|
+
const n = i.value, u = t.left._zod.run({ value: n, issues: [] }, r), h = t.right._zod.run({ value: n, issues: [] }, r);
|
|
1274
|
+
return u instanceof Promise || h instanceof Promise ? Promise.all([u, h]).then(([y, o]) => qi(i, y, o)) : qi(i, u, h);
|
|
1275
1275
|
};
|
|
1276
1276
|
});
|
|
1277
1277
|
function li(e, t) {
|
|
@@ -1282,13 +1282,13 @@ function li(e, t) {
|
|
|
1282
1282
|
if (st(e) && st(t)) {
|
|
1283
1283
|
const i = Object.keys(t), r = Object.keys(e).filter((u) => i.indexOf(u) !== -1), n = { ...e, ...t };
|
|
1284
1284
|
for (const u of r) {
|
|
1285
|
-
const
|
|
1286
|
-
if (!
|
|
1285
|
+
const h = li(e[u], t[u]);
|
|
1286
|
+
if (!h.valid)
|
|
1287
1287
|
return {
|
|
1288
1288
|
valid: !1,
|
|
1289
|
-
mergeErrorPath: [u, ...
|
|
1289
|
+
mergeErrorPath: [u, ...h.mergeErrorPath]
|
|
1290
1290
|
};
|
|
1291
|
-
n[u] =
|
|
1291
|
+
n[u] = h.data;
|
|
1292
1292
|
}
|
|
1293
1293
|
return { valid: !0, data: n };
|
|
1294
1294
|
}
|
|
@@ -1297,13 +1297,13 @@ function li(e, t) {
|
|
|
1297
1297
|
return { valid: !1, mergeErrorPath: [] };
|
|
1298
1298
|
const i = [];
|
|
1299
1299
|
for (let r = 0; r < e.length; r++) {
|
|
1300
|
-
const n = e[r], u = t[r],
|
|
1301
|
-
if (!
|
|
1300
|
+
const n = e[r], u = t[r], h = li(n, u);
|
|
1301
|
+
if (!h.valid)
|
|
1302
1302
|
return {
|
|
1303
1303
|
valid: !1,
|
|
1304
|
-
mergeErrorPath: [r, ...
|
|
1304
|
+
mergeErrorPath: [r, ...h.mergeErrorPath]
|
|
1305
1305
|
};
|
|
1306
|
-
i.push(
|
|
1306
|
+
i.push(h.data);
|
|
1307
1307
|
}
|
|
1308
1308
|
return { valid: !0, data: i };
|
|
1309
1309
|
}
|
|
@@ -1327,11 +1327,11 @@ const Va = /* @__PURE__ */ k("$ZodRecord", (e, t) => {
|
|
|
1327
1327
|
input: n,
|
|
1328
1328
|
inst: e
|
|
1329
1329
|
}), i;
|
|
1330
|
-
const u = [],
|
|
1331
|
-
if (
|
|
1330
|
+
const u = [], h = t.keyType._zod.values;
|
|
1331
|
+
if (h) {
|
|
1332
1332
|
i.value = {};
|
|
1333
1333
|
const d = /* @__PURE__ */ new Set();
|
|
1334
|
-
for (const o of
|
|
1334
|
+
for (const o of h)
|
|
1335
1335
|
if (typeof o == "string" || typeof o == "number" || typeof o == "symbol") {
|
|
1336
1336
|
d.add(typeof o == "number" ? o.toString() : o);
|
|
1337
1337
|
const w = t.valueType._zod.run({ value: n[o], issues: [] }, r);
|
|
@@ -1379,11 +1379,11 @@ const Va = /* @__PURE__ */ k("$ZodRecord", (e, t) => {
|
|
|
1379
1379
|
Y.init(e, t);
|
|
1380
1380
|
const i = Us(t.entries), r = new Set(i);
|
|
1381
1381
|
e._zod.values = r, e._zod.pattern = new RegExp(`^(${i.filter((n) => Ws.has(typeof n)).map((n) => typeof n == "string" ? nt(n) : n.toString()).join("|")})$`), e._zod.parse = (n, u) => {
|
|
1382
|
-
const
|
|
1383
|
-
return r.has(
|
|
1382
|
+
const h = n.value;
|
|
1383
|
+
return r.has(h) || n.issues.push({
|
|
1384
1384
|
code: "invalid_value",
|
|
1385
1385
|
values: i,
|
|
1386
|
-
input:
|
|
1386
|
+
input: h,
|
|
1387
1387
|
inst: e
|
|
1388
1388
|
}), n;
|
|
1389
1389
|
};
|
|
@@ -1406,7 +1406,7 @@ const Va = /* @__PURE__ */ k("$ZodRecord", (e, t) => {
|
|
|
1406
1406
|
throw new Cr(e.constructor.name);
|
|
1407
1407
|
const n = t.transform(i.value, i);
|
|
1408
1408
|
if (r.async)
|
|
1409
|
-
return (n instanceof Promise ? n : Promise.resolve(n)).then((
|
|
1409
|
+
return (n instanceof Promise ? n : Promise.resolve(n)).then((h) => (i.value = h, i));
|
|
1410
1410
|
if (n instanceof Promise)
|
|
1411
1411
|
throw new rt();
|
|
1412
1412
|
return i.value = n, i;
|
|
@@ -1471,7 +1471,7 @@ const Ha = /* @__PURE__ */ k("$ZodCatch", (e, t) => {
|
|
|
1471
1471
|
return n instanceof Promise ? n.then((u) => (i.value = u.value, u.issues.length && (i.value = t.catchValue({
|
|
1472
1472
|
...i,
|
|
1473
1473
|
error: {
|
|
1474
|
-
issues: u.issues.map((
|
|
1474
|
+
issues: u.issues.map((h) => qe(h, r, Ue()))
|
|
1475
1475
|
},
|
|
1476
1476
|
input: i.value
|
|
1477
1477
|
}), i.issues = []), i)) : (i.value = n.value, n.issues.length && (i.value = t.catchValue({
|
|
@@ -1486,13 +1486,13 @@ const Ha = /* @__PURE__ */ k("$ZodCatch", (e, t) => {
|
|
|
1486
1486
|
Y.init(e, t), U(e._zod, "values", () => t.in._zod.values), U(e._zod, "optin", () => t.in._zod.optin), U(e._zod, "optout", () => t.out._zod.optout), U(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (i, r) => {
|
|
1487
1487
|
if (r.direction === "backward") {
|
|
1488
1488
|
const u = t.out._zod.run(i, r);
|
|
1489
|
-
return u instanceof Promise ? u.then((
|
|
1489
|
+
return u instanceof Promise ? u.then((h) => Nt(h, t.in, r)) : Nt(u, t.in, r);
|
|
1490
1490
|
}
|
|
1491
1491
|
const n = t.in._zod.run(i, r);
|
|
1492
|
-
return n instanceof Promise ? n.then((u) =>
|
|
1492
|
+
return n instanceof Promise ? n.then((u) => Nt(u, t.out, r)) : Nt(n, t.out, r);
|
|
1493
1493
|
};
|
|
1494
1494
|
});
|
|
1495
|
-
function
|
|
1495
|
+
function Nt(e, t, i) {
|
|
1496
1496
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, i);
|
|
1497
1497
|
}
|
|
1498
1498
|
const Wa = /* @__PURE__ */ k("$ZodReadonly", (e, t) => {
|
|
@@ -1526,7 +1526,7 @@ function Xi(e, t, i, r) {
|
|
|
1526
1526
|
continue: !r._zod.def.abort
|
|
1527
1527
|
// params: inst._zod.def.params,
|
|
1528
1528
|
};
|
|
1529
|
-
r._zod.def.params && (n.params = r._zod.def.params), t.issues.push(
|
|
1529
|
+
r._zod.def.params && (n.params = r._zod.def.params), t.issues.push(bt(n));
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
var Ji;
|
|
@@ -1568,7 +1568,7 @@ function Ja() {
|
|
|
1568
1568
|
return new Xa();
|
|
1569
1569
|
}
|
|
1570
1570
|
(Ji = globalThis).__zod_globalRegistry ?? (Ji.__zod_globalRegistry = Ja());
|
|
1571
|
-
const
|
|
1571
|
+
const Lt = globalThis.__zod_globalRegistry;
|
|
1572
1572
|
function Ya(e, t) {
|
|
1573
1573
|
return new e({
|
|
1574
1574
|
type: "string",
|
|
@@ -1993,10 +1993,10 @@ function Bo(e, t, i) {
|
|
|
1993
1993
|
function Zo(e) {
|
|
1994
1994
|
const t = Uo((i) => (i.addIssue = (r) => {
|
|
1995
1995
|
if (typeof r == "string")
|
|
1996
|
-
i.issues.push(
|
|
1996
|
+
i.issues.push(bt(r, i.value, t._zod.def));
|
|
1997
1997
|
else {
|
|
1998
1998
|
const n = r;
|
|
1999
|
-
n.fatal && (n.continue = !1), n.code ?? (n.code = "custom"), n.input ?? (n.input = i.value), n.inst ?? (n.inst = t), n.continue ?? (n.continue = !t._zod.def.abort), i.issues.push(
|
|
1999
|
+
n.fatal && (n.continue = !1), n.code ?? (n.code = "custom"), n.input ?? (n.input = i.value), n.inst ?? (n.inst = t), n.continue ?? (n.continue = !t._zod.def.abort), i.issues.push(bt(n));
|
|
2000
2000
|
}
|
|
2001
2001
|
}, e(i.value, i)));
|
|
2002
2002
|
return t;
|
|
@@ -2070,23 +2070,23 @@ const Qo = (e, t) => {
|
|
|
2070
2070
|
]
|
|
2071
2071
|
})), e.clone = (i, r) => Ge(e, i, r), e.brand = () => e, e.register = ((i, r) => (i.add(e, r), e)), e.parse = (i, r) => eu(e, i, r, { callee: e.parse }), e.safeParse = (i, r) => iu(e, i, r), e.parseAsync = async (i, r) => tu(e, i, r, { callee: e.parseAsync }), e.safeParseAsync = async (i, r) => ru(e, i, r), e.spa = e.safeParseAsync, e.encode = (i, r) => su(e, i, r), e.decode = (i, r) => nu(e, i, r), e.encodeAsync = async (i, r) => au(e, i, r), e.decodeAsync = async (i, r) => ou(e, i, r), e.safeEncode = (i, r) => uu(e, i, r), e.safeDecode = (i, r) => cu(e, i, r), e.safeEncodeAsync = async (i, r) => hu(e, i, r), e.safeDecodeAsync = async (i, r) => lu(e, i, r), e.refine = (i, r) => e.check(rc(i, r)), e.superRefine = (i) => e.check(sc(i)), e.overwrite = (i) => e.check(ct(i)), e.optional = () => nr(e), e.nullable = () => ar(e), e.nullish = () => nr(ar(e)), e.nonoptional = (i) => Xu(e, i), e.array = () => He(e), e.or = (i) => oe([e, i]), e.and = (i) => Fu(e, i), e.transform = (i) => or(e, Uu(i)), e.default = (i) => Gu(e, i), e.prefault = (i) => Ku(e, i), e.catch = (i) => Yu(e, i), e.pipe = (i) => or(e, i), e.readonly = () => tc(e), e.describe = (i) => {
|
|
2072
2072
|
const r = e.clone();
|
|
2073
|
-
return
|
|
2073
|
+
return Lt.add(r, { description: i }), r;
|
|
2074
2074
|
}, Object.defineProperty(e, "description", {
|
|
2075
2075
|
get() {
|
|
2076
|
-
return
|
|
2076
|
+
return Lt.get(e)?.description;
|
|
2077
2077
|
},
|
|
2078
2078
|
configurable: !0
|
|
2079
2079
|
}), e.meta = (...i) => {
|
|
2080
2080
|
if (i.length === 0)
|
|
2081
|
-
return
|
|
2081
|
+
return Lt.get(e);
|
|
2082
2082
|
const r = e.clone();
|
|
2083
|
-
return
|
|
2083
|
+
return Lt.add(r, i[0]), r;
|
|
2084
2084
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Hr = /* @__PURE__ */ k("_ZodString", (e, t) => {
|
|
2085
2085
|
Si.init(e, t), ee.init(e, t);
|
|
2086
2086
|
const i = e._zod.bag;
|
|
2087
2087
|
e.format = i.format ?? null, e.minLength = i.minimum ?? null, e.maxLength = i.maximum ?? null, e.regex = (...r) => e.check(Io(...r)), e.includes = (...r) => e.check(Oo(...r)), e.startsWith = (...r) => e.check(Ro(...r)), e.endsWith = (...r) => e.check(Do(...r)), e.min = (...r) => e.check(zt(...r)), e.max = (...r) => e.check(Ur(...r)), e.length = (...r) => e.check(qr(...r)), e.nonempty = (...r) => e.check(zt(1, ...r)), e.lowercase = (r) => e.check(No(r)), e.uppercase = (r) => e.check(Lo(r)), e.trim = () => e.check(Vo()), e.normalize = (...r) => e.check(Mo(...r)), e.toLowerCase = () => e.check(zo()), e.toUpperCase = () => e.check(jo()), e.slugify = () => e.check(Fo());
|
|
2088
2088
|
}), pu = /* @__PURE__ */ k("ZodString", (e, t) => {
|
|
2089
|
-
Si.init(e, t), Hr.init(e, t), e.email = (i) => e.check(Qa(fu, i)), e.url = (i) => e.check(so(du, i)), e.jwt = (i) => e.check(bo(Eu, i)), e.emoji = (i) => e.check(no(mu, i)), e.guid = (i) => e.check(Yi(ir, i)), e.uuid = (i) => e.check(eo(
|
|
2089
|
+
Si.init(e, t), Hr.init(e, t), e.email = (i) => e.check(Qa(fu, i)), e.url = (i) => e.check(so(du, i)), e.jwt = (i) => e.check(bo(Eu, i)), e.emoji = (i) => e.check(no(mu, i)), e.guid = (i) => e.check(Yi(ir, i)), e.uuid = (i) => e.check(eo(Ot, i)), e.uuidv4 = (i) => e.check(to(Ot, i)), e.uuidv6 = (i) => e.check(io(Ot, i)), e.uuidv7 = (i) => e.check(ro(Ot, i)), e.nanoid = (i) => e.check(ao(yu, i)), e.guid = (i) => e.check(Yi(ir, i)), e.cuid = (i) => e.check(oo(vu, i)), e.cuid2 = (i) => e.check(uo(xu, i)), e.ulid = (i) => e.check(co(gu, i)), e.base64 = (i) => e.check(vo(Pu, i)), e.base64url = (i) => e.check(xo(Cu, i)), e.xid = (i) => e.check(ho(bu, i)), e.ksuid = (i) => e.check(lo(_u, i)), e.ipv4 = (i) => e.check(po(ku, i)), e.ipv6 = (i) => e.check(fo(wu, i)), e.cidrv4 = (i) => e.check(mo(Su, i)), e.cidrv6 = (i) => e.check(yo(Tu, i)), e.e164 = (i) => e.check(go(Au, i)), e.datetime = (i) => e.check(Ho(i)), e.date = (i) => e.check(Wo(i)), e.time = (i) => e.check(Xo(i)), e.duration = (i) => e.check(Yo(i));
|
|
2090
2090
|
});
|
|
2091
2091
|
function O(e) {
|
|
2092
2092
|
return Ya(pu, e);
|
|
@@ -2097,7 +2097,7 @@ const Q = /* @__PURE__ */ k("ZodStringFormat", (e, t) => {
|
|
|
2097
2097
|
na.init(e, t), Q.init(e, t);
|
|
2098
2098
|
}), ir = /* @__PURE__ */ k("ZodGUID", (e, t) => {
|
|
2099
2099
|
ra.init(e, t), Q.init(e, t);
|
|
2100
|
-
}),
|
|
2100
|
+
}), Ot = /* @__PURE__ */ k("ZodUUID", (e, t) => {
|
|
2101
2101
|
sa.init(e, t), Q.init(e, t);
|
|
2102
2102
|
}), du = /* @__PURE__ */ k("ZodURL", (e, t) => {
|
|
2103
2103
|
aa.init(e, t), Q.init(e, t);
|
|
@@ -2216,11 +2216,11 @@ const pi = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
2216
2216
|
const i = new Set(Object.keys(t.entries));
|
|
2217
2217
|
e.extract = (r, n) => {
|
|
2218
2218
|
const u = {};
|
|
2219
|
-
for (const
|
|
2220
|
-
if (i.has(
|
|
2221
|
-
u[
|
|
2219
|
+
for (const h of r)
|
|
2220
|
+
if (i.has(h))
|
|
2221
|
+
u[h] = t.entries[h];
|
|
2222
2222
|
else
|
|
2223
|
-
throw new Error(`Key ${
|
|
2223
|
+
throw new Error(`Key ${h} not found in enum`);
|
|
2224
2224
|
return new pi({
|
|
2225
2225
|
...t,
|
|
2226
2226
|
checks: [],
|
|
@@ -2229,11 +2229,11 @@ const pi = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
2229
2229
|
});
|
|
2230
2230
|
}, e.exclude = (r, n) => {
|
|
2231
2231
|
const u = { ...t.entries };
|
|
2232
|
-
for (const
|
|
2233
|
-
if (i.has(
|
|
2234
|
-
delete u[
|
|
2232
|
+
for (const h of r)
|
|
2233
|
+
if (i.has(h))
|
|
2234
|
+
delete u[h];
|
|
2235
2235
|
else
|
|
2236
|
-
throw new Error(`Key ${
|
|
2236
|
+
throw new Error(`Key ${h} not found in enum`);
|
|
2237
2237
|
return new pi({
|
|
2238
2238
|
...t,
|
|
2239
2239
|
checks: [],
|
|
@@ -2272,10 +2272,10 @@ const Zu = /* @__PURE__ */ k("ZodTransform", (e, t) => {
|
|
|
2272
2272
|
throw new Cr(e.constructor.name);
|
|
2273
2273
|
i.addIssue = (u) => {
|
|
2274
2274
|
if (typeof u == "string")
|
|
2275
|
-
i.issues.push(
|
|
2275
|
+
i.issues.push(bt(u, i.value, t));
|
|
2276
2276
|
else {
|
|
2277
|
-
const
|
|
2278
|
-
|
|
2277
|
+
const h = u;
|
|
2278
|
+
h.fatal && (h.continue = !1), h.code ?? (h.code = "custom"), h.input ?? (h.input = i.value), h.inst ?? (h.inst = e), i.issues.push(bt(h));
|
|
2279
2279
|
}
|
|
2280
2280
|
};
|
|
2281
2281
|
const n = t.transform(i.value, i);
|
|
@@ -2729,7 +2729,7 @@ function es(e, t, i) {
|
|
|
2729
2729
|
}
|
|
2730
2730
|
return -1;
|
|
2731
2731
|
}
|
|
2732
|
-
var Ti = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,
|
|
2732
|
+
var Ti = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, ne = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ts = Object.prototype, Kc = ts.hasOwnProperty, Xc = ts.toString, ht = Object.hasOwn || (function(e, t) {
|
|
2733
2733
|
return Kc.call(e, t);
|
|
2734
2734
|
}), hr = Array.isArray || (function(e) {
|
|
2735
2735
|
return Xc.call(e) === "[object Array]";
|
|
@@ -2746,7 +2746,7 @@ var Jc = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\u
|
|
|
2746
2746
|
ot.prototype.offset = function(t) {
|
|
2747
2747
|
return new ot(this.line, this.column + t);
|
|
2748
2748
|
};
|
|
2749
|
-
var
|
|
2749
|
+
var kt = function(t, i, r) {
|
|
2750
2750
|
this.start = i, this.end = r, t.sourceFile !== null && (this.source = t.sourceFile);
|
|
2751
2751
|
};
|
|
2752
2752
|
function Pi(e, t) {
|
|
@@ -2868,17 +2868,17 @@ Defaulting to 2020, but this will stop working in the future.`)), t.ecmaVersion
|
|
|
2868
2868
|
return hr(t.onComment) && (t.onComment = Qc(t, t.onComment)), t;
|
|
2869
2869
|
}
|
|
2870
2870
|
function Qc(e, t) {
|
|
2871
|
-
return function(i, r, n, u,
|
|
2871
|
+
return function(i, r, n, u, h, d) {
|
|
2872
2872
|
var y = {
|
|
2873
2873
|
type: i ? "Block" : "Line",
|
|
2874
2874
|
value: r,
|
|
2875
2875
|
start: n,
|
|
2876
2876
|
end: u
|
|
2877
2877
|
};
|
|
2878
|
-
e.locations && (y.loc = new
|
|
2878
|
+
e.locations && (y.loc = new kt(this, h, d)), e.ranges && (y.range = [n, u]), t.push(y);
|
|
2879
2879
|
};
|
|
2880
2880
|
}
|
|
2881
|
-
var
|
|
2881
|
+
var _t = 1, lt = 2, Ci = 4, is = 8, Ai = 16, rs = 32, Kt = 64, ss = 128, Qe = 256, wt = 512, Xt = _t | lt | Qe;
|
|
2882
2882
|
function Ei(e, t) {
|
|
2883
2883
|
return lt | (e ? Ci : 0) | (t ? is : 0);
|
|
2884
2884
|
}
|
|
@@ -2888,7 +2888,7 @@ var Ft = 0, Ii = 1, Fe = 2, ns = 3, as = 4, os = 5, J = function(t, i, r) {
|
|
|
2888
2888
|
t.allowReserved !== !0 && (n = ni[t.ecmaVersion >= 6 ? 6 : t.ecmaVersion === 5 ? 5 : 3], t.sourceType === "module" && (n += " await")), this.reservedWords = Ze(n);
|
|
2889
2889
|
var u = (n ? n + " " : "") + ni.strict;
|
|
2890
2890
|
this.reservedWordsStrict = Ze(u), this.reservedWordsStrictBind = Ze(u + " " + ni.strictBind), this.input = String(i), this.containsEsc = !1, r ? (this.pos = r, this.lineStart = this.input.lastIndexOf(`
|
|
2891
|
-
`, r - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(he).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = l.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = t.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && t.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(
|
|
2891
|
+
`, r - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(he).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = l.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = t.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && t.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(_t), this.regexpState = null, this.privateNameStack = [];
|
|
2892
2892
|
}, Re = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
|
|
2893
2893
|
J.prototype.parse = function() {
|
|
2894
2894
|
var t = this.options.program || this.startNode();
|
|
@@ -2906,7 +2906,7 @@ Re.inAsync.get = function() {
|
|
|
2906
2906
|
Re.canAwait.get = function() {
|
|
2907
2907
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
2908
2908
|
var t = this.scopeStack[e], i = t.flags;
|
|
2909
|
-
if (i & (Qe |
|
|
2909
|
+
if (i & (Qe | wt))
|
|
2910
2910
|
return !1;
|
|
2911
2911
|
if (i & lt)
|
|
2912
2912
|
return (i & Ci) > 0;
|
|
@@ -2926,7 +2926,7 @@ Re.treatFunctionsAsVar.get = function() {
|
|
|
2926
2926
|
Re.allowNewDotTarget.get = function() {
|
|
2927
2927
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
2928
2928
|
var t = this.scopeStack[e], i = t.flags;
|
|
2929
|
-
if (i & (Qe |
|
|
2929
|
+
if (i & (Qe | wt) || i & lt && !(i & Ai))
|
|
2930
2930
|
return !0;
|
|
2931
2931
|
}
|
|
2932
2932
|
return !1;
|
|
@@ -2956,16 +2956,16 @@ le.strictDirective = function(e) {
|
|
|
2956
2956
|
if (this.options.ecmaVersion < 5)
|
|
2957
2957
|
return !1;
|
|
2958
2958
|
for (; ; ) {
|
|
2959
|
-
|
|
2959
|
+
ne.lastIndex = e, e += ne.exec(this.input)[0].length;
|
|
2960
2960
|
var t = eh.exec(this.input.slice(e));
|
|
2961
2961
|
if (!t)
|
|
2962
2962
|
return !1;
|
|
2963
2963
|
if ((t[1] || t[2]) === "use strict") {
|
|
2964
|
-
|
|
2965
|
-
var i =
|
|
2964
|
+
ne.lastIndex = e + t[0].length;
|
|
2965
|
+
var i = ne.exec(this.input), r = i.index + i[0].length, n = this.input.charAt(r);
|
|
2966
2966
|
return n === ";" || n === "}" || he.test(i[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(n) || n === "!" && this.input.charAt(r + 1) === "=");
|
|
2967
2967
|
}
|
|
2968
|
-
e += t[0].length,
|
|
2968
|
+
e += t[0].length, ne.lastIndex = e, e += ne.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
2969
2969
|
}
|
|
2970
2970
|
};
|
|
2971
2971
|
le.eat = function(e) {
|
|
@@ -3042,8 +3042,8 @@ var Ni = { kind: "loop" }, th = { kind: "switch" };
|
|
|
3042
3042
|
I.isLet = function(e) {
|
|
3043
3043
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
|
|
3044
3044
|
return !1;
|
|
3045
|
-
|
|
3046
|
-
var t =
|
|
3045
|
+
ne.lastIndex = this.pos;
|
|
3046
|
+
var t = ne.exec(this.input), i = this.pos + t[0].length, r = this.input.charCodeAt(i);
|
|
3047
3047
|
if (r === 91 || r === 92)
|
|
3048
3048
|
return !0;
|
|
3049
3049
|
if (e)
|
|
@@ -3064,24 +3064,24 @@ I.isLet = function(e) {
|
|
|
3064
3064
|
I.isAsyncFunction = function() {
|
|
3065
3065
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
|
|
3066
3066
|
return !1;
|
|
3067
|
-
|
|
3068
|
-
var e =
|
|
3067
|
+
ne.lastIndex = this.pos;
|
|
3068
|
+
var e = ne.exec(this.input), t = this.pos + e[0].length, i;
|
|
3069
3069
|
return !he.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(Ve(i = this.input.charCodeAt(t + 8)) || i > 55295 && i < 56320));
|
|
3070
3070
|
};
|
|
3071
3071
|
I.isUsingKeyword = function(e, t) {
|
|
3072
3072
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using"))
|
|
3073
3073
|
return !1;
|
|
3074
|
-
|
|
3075
|
-
var i =
|
|
3074
|
+
ne.lastIndex = this.pos;
|
|
3075
|
+
var i = ne.exec(this.input), r = this.pos + i[0].length;
|
|
3076
3076
|
if (he.test(this.input.slice(this.pos, r)))
|
|
3077
3077
|
return !1;
|
|
3078
3078
|
if (e) {
|
|
3079
3079
|
var n = r + 5, u;
|
|
3080
3080
|
if (this.input.slice(r, n) !== "using" || n === this.input.length || Ve(u = this.input.charCodeAt(n)) || u > 55295 && u < 56320)
|
|
3081
3081
|
return !1;
|
|
3082
|
-
|
|
3083
|
-
var
|
|
3084
|
-
if (
|
|
3082
|
+
ne.lastIndex = n;
|
|
3083
|
+
var h = ne.exec(this.input);
|
|
3084
|
+
if (h && he.test(this.input.slice(n, n + h[0].length)))
|
|
3085
3085
|
return !1;
|
|
3086
3086
|
}
|
|
3087
3087
|
if (t) {
|
|
@@ -3138,8 +3138,8 @@ I.parseStatement = function(e, t, i) {
|
|
|
3138
3138
|
case l._export:
|
|
3139
3139
|
case l._import:
|
|
3140
3140
|
if (this.options.ecmaVersion > 10 && r === l._import) {
|
|
3141
|
-
|
|
3142
|
-
var
|
|
3141
|
+
ne.lastIndex = this.pos;
|
|
3142
|
+
var h = ne.exec(this.input), d = this.pos + h[0].length, y = this.input.charCodeAt(d);
|
|
3143
3143
|
if (y === 40 || y === 46)
|
|
3144
3144
|
return this.parseExpressionStatement(n, this.parseExpression());
|
|
3145
3145
|
}
|
|
@@ -3185,19 +3185,19 @@ I.parseForStatement = function(e) {
|
|
|
3185
3185
|
var r = this.startNode(), n = i ? "let" : this.value;
|
|
3186
3186
|
return this.next(), this.parseVar(r, !0, n), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
3187
3187
|
}
|
|
3188
|
-
var u = this.isContextual("let"),
|
|
3188
|
+
var u = this.isContextual("let"), h = !1, d = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
3189
3189
|
if (d) {
|
|
3190
3190
|
var y = this.startNode();
|
|
3191
3191
|
return this.next(), d === "await using" && this.next(), this.parseVar(y, !0, d), this.finishNode(y, "VariableDeclaration"), this.parseForAfterInit(e, y, t);
|
|
3192
3192
|
}
|
|
3193
3193
|
var o = this.containsEsc, w = new Jt(), S = this.start, A = t > -1 ? this.parseExprSubscripts(w, "await") : this.parseExpression(!0, w);
|
|
3194
|
-
return this.type === l._in || (
|
|
3194
|
+
return this.type === l._in || (h = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === l._in && this.unexpected(t), e.await = !0) : h && this.options.ecmaVersion >= 8 && (A.start === S && !o && A.type === "Identifier" && A.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), u && h && this.raise(A.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(A, !1, w), this.checkLValPattern(A), this.parseForIn(e, A)) : (this.checkExpressionErrors(w, !0), t > -1 && this.unexpected(t), this.parseFor(e, A));
|
|
3195
3195
|
};
|
|
3196
3196
|
I.parseForAfterInit = function(e, t, i) {
|
|
3197
3197
|
return (this.type === l._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === l._in ? i > -1 && this.unexpected(i) : e.await = i > -1), this.parseForIn(e, t)) : (i > -1 && this.unexpected(i), this.parseFor(e, t));
|
|
3198
3198
|
};
|
|
3199
3199
|
I.parseFunctionStatement = function(e, t, i) {
|
|
3200
|
-
return this.next(), this.parseFunction(e,
|
|
3200
|
+
return this.next(), this.parseFunction(e, xt | (i ? 0 : di), !1, t);
|
|
3201
3201
|
};
|
|
3202
3202
|
I.parseIfStatement = function(e) {
|
|
3203
3203
|
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(l._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
@@ -3244,8 +3244,8 @@ I.parseEmptyStatement = function(e) {
|
|
|
3244
3244
|
};
|
|
3245
3245
|
I.parseLabeledStatement = function(e, t, i, r) {
|
|
3246
3246
|
for (var n = 0, u = this.labels; n < u.length; n += 1) {
|
|
3247
|
-
var
|
|
3248
|
-
|
|
3247
|
+
var h = u[n];
|
|
3248
|
+
h.name === t && this.raise(i.start, "Label '" + t + "' is already declared");
|
|
3249
3249
|
}
|
|
3250
3250
|
for (var d = this.type.isLoop ? "loop" : this.type === l._switch ? "switch" : null, y = this.labels.length - 1; y >= 0; y--) {
|
|
3251
3251
|
var o = this.labels[y];
|
|
@@ -3287,11 +3287,11 @@ I.parseVar = function(e, t, i, r) {
|
|
|
3287
3287
|
I.parseVarId = function(e, t) {
|
|
3288
3288
|
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Ii : Fe, !1);
|
|
3289
3289
|
};
|
|
3290
|
-
var
|
|
3290
|
+
var xt = 1, di = 2, us = 4;
|
|
3291
3291
|
I.parseFunction = function(e, t, i, r, n) {
|
|
3292
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === l.star && t & di && this.unexpected(), e.generator = this.eat(l.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t &
|
|
3293
|
-
var u = this.yieldPos,
|
|
3294
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ei(e.async, e.generator)), t &
|
|
3292
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === l.star && t & di && this.unexpected(), e.generator = this.eat(l.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & xt && (e.id = t & us && this.type !== l.name ? null : this.parseIdent(), e.id && !(t & di) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Ii : Fe : ns));
|
|
3293
|
+
var u = this.yieldPos, h = this.awaitPos, d = this.awaitIdentPos;
|
|
3294
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ei(e.async, e.generator)), t & xt || (e.id = this.type === l.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, i, !1, n), this.yieldPos = u, this.awaitPos = h, this.awaitIdentPos = d, this.finishNode(e, t & xt ? "FunctionDeclaration" : "FunctionExpression");
|
|
3295
3295
|
};
|
|
3296
3296
|
I.parseFunctionParams = function(e) {
|
|
3297
3297
|
this.expect(l.parenL), e.params = this.parseBindingList(l.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
@@ -3302,15 +3302,15 @@ I.parseClass = function(e, t) {
|
|
|
3302
3302
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
3303
3303
|
var r = this.enterClassBody(), n = this.startNode(), u = !1;
|
|
3304
3304
|
for (n.body = [], this.expect(l.braceL); this.type !== l.braceR; ) {
|
|
3305
|
-
var
|
|
3306
|
-
|
|
3305
|
+
var h = this.parseClassElement(e.superClass !== null);
|
|
3306
|
+
h && (n.body.push(h), h.type === "MethodDefinition" && h.kind === "constructor" ? (u && this.raiseRecoverable(h.start, "Duplicate constructor in the same class"), u = !0) : h.key && h.key.type === "PrivateIdentifier" && rh(r, h) && this.raiseRecoverable(h.key.start, "Identifier '#" + h.key.name + "' has already been declared"));
|
|
3307
3307
|
}
|
|
3308
3308
|
return this.strict = i, this.next(), e.body = this.finishNode(n, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
3309
3309
|
};
|
|
3310
3310
|
I.parseClassElement = function(e) {
|
|
3311
3311
|
if (this.eat(l.semi))
|
|
3312
3312
|
return null;
|
|
3313
|
-
var t = this.options.ecmaVersion, i = this.startNode(), r = "", n = !1, u = !1,
|
|
3313
|
+
var t = this.options.ecmaVersion, i = this.startNode(), r = "", n = !1, u = !1, h = "method", d = !1;
|
|
3314
3314
|
if (this.eatContextual("static")) {
|
|
3315
3315
|
if (t >= 13 && this.eat(l.braceL))
|
|
3316
3316
|
return this.parseClassStaticBlock(i), i;
|
|
@@ -3318,11 +3318,11 @@ I.parseClassElement = function(e) {
|
|
|
3318
3318
|
}
|
|
3319
3319
|
if (i.static = d, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === l.star) && !this.canInsertSemicolon() ? u = !0 : r = "async"), !r && (t >= 9 || !u) && this.eat(l.star) && (n = !0), !r && !u && !n) {
|
|
3320
3320
|
var y = this.value;
|
|
3321
|
-
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ?
|
|
3321
|
+
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? h = y : r = y);
|
|
3322
3322
|
}
|
|
3323
|
-
if (r ? (i.computed = !1, i.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i.key.name = r, this.finishNode(i.key, "Identifier")) : this.parseClassElementName(i), t < 13 || this.type === l.parenL ||
|
|
3323
|
+
if (r ? (i.computed = !1, i.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i.key.name = r, this.finishNode(i.key, "Identifier")) : this.parseClassElementName(i), t < 13 || this.type === l.parenL || h !== "method" || n || u) {
|
|
3324
3324
|
var o = !i.static && $t(i, "constructor"), w = o && e;
|
|
3325
|
-
o &&
|
|
3325
|
+
o && h !== "method" && this.raise(i.key.start, "Constructor can't have get/set modifier"), i.kind = o ? "constructor" : h, this.parseClassMethod(i, n, u, w);
|
|
3326
3326
|
} else
|
|
3327
3327
|
this.parseClassField(i);
|
|
3328
3328
|
return i;
|
|
@@ -3340,7 +3340,7 @@ I.parseClassMethod = function(e, t, i, r) {
|
|
|
3340
3340
|
return e.kind === "get" && u.params.length !== 0 && this.raiseRecoverable(u.start, "getter should have no params"), e.kind === "set" && u.params.length !== 1 && this.raiseRecoverable(u.start, "setter should have exactly one param"), e.kind === "set" && u.params[0].type === "RestElement" && this.raiseRecoverable(u.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
3341
3341
|
};
|
|
3342
3342
|
I.parseClassField = function(e) {
|
|
3343
|
-
return $t(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && $t(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(l.eq) ? (this.enterScope(
|
|
3343
|
+
return $t(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && $t(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(l.eq) ? (this.enterScope(wt | Kt), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
3344
3344
|
};
|
|
3345
3345
|
I.parseClassStaticBlock = function(e) {
|
|
3346
3346
|
e.body = [];
|
|
@@ -3365,8 +3365,8 @@ I.exitClassBody = function() {
|
|
|
3365
3365
|
var e = this.privateNameStack.pop(), t = e.declared, i = e.used;
|
|
3366
3366
|
if (this.options.checkPrivateFields)
|
|
3367
3367
|
for (var r = this.privateNameStack.length, n = r === 0 ? null : this.privateNameStack[r - 1], u = 0; u < i.length; ++u) {
|
|
3368
|
-
var
|
|
3369
|
-
ht(t,
|
|
3368
|
+
var h = i[u];
|
|
3369
|
+
ht(t, h.name) || (n ? n.used.push(h) : this.raiseRecoverable(h.start, "Private field '#" + h.name + "' must be declared in an enclosing class"));
|
|
3370
3370
|
}
|
|
3371
3371
|
};
|
|
3372
3372
|
function rh(e, t) {
|
|
@@ -3408,7 +3408,7 @@ I.parseExportDefaultDeclaration = function() {
|
|
|
3408
3408
|
var e;
|
|
3409
3409
|
if (this.type === l._function || (e = this.isAsyncFunction())) {
|
|
3410
3410
|
var t = this.startNode();
|
|
3411
|
-
return this.next(), e && this.next(), this.parseFunction(t,
|
|
3411
|
+
return this.next(), e && this.next(), this.parseFunction(t, xt | us, !1, e);
|
|
3412
3412
|
} else if (this.type === l._class) {
|
|
3413
3413
|
var i = this.startNode();
|
|
3414
3414
|
return this.parseClass(i, "nullableID");
|
|
@@ -3430,8 +3430,8 @@ I.checkPatternExport = function(e, t) {
|
|
|
3430
3430
|
this.checkPatternExport(e, u);
|
|
3431
3431
|
}
|
|
3432
3432
|
else if (i === "ArrayPattern")
|
|
3433
|
-
for (var
|
|
3434
|
-
var y = d[
|
|
3433
|
+
for (var h = 0, d = t.elements; h < d.length; h += 1) {
|
|
3434
|
+
var y = d[h];
|
|
3435
3435
|
y && this.checkPatternExport(e, y);
|
|
3436
3436
|
}
|
|
3437
3437
|
else i === "Property" ? this.checkPatternExport(e, t.value) : i === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : i === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
@@ -3613,8 +3613,8 @@ Ce.parseBindingList = function(e, t, i, r) {
|
|
|
3613
3613
|
if (i && this.afterTrailingComma(e))
|
|
3614
3614
|
break;
|
|
3615
3615
|
if (this.type === l.ellipsis) {
|
|
3616
|
-
var
|
|
3617
|
-
this.parseBindingListItem(
|
|
3616
|
+
var h = this.parseRestBinding();
|
|
3617
|
+
this.parseBindingListItem(h), n.push(h), this.type === l.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
3618
3618
|
break;
|
|
3619
3619
|
} else
|
|
3620
3620
|
n.push(this.parseAssignableListItem(r));
|
|
@@ -3662,8 +3662,8 @@ Ce.checkLValPattern = function(e, t, i) {
|
|
|
3662
3662
|
}
|
|
3663
3663
|
break;
|
|
3664
3664
|
case "ArrayPattern":
|
|
3665
|
-
for (var
|
|
3666
|
-
var y = d[
|
|
3665
|
+
for (var h = 0, d = e.elements; h < d.length; h += 1) {
|
|
3666
|
+
var y = d[h];
|
|
3667
3667
|
y && this.checkLValInnerPattern(y, t, i);
|
|
3668
3668
|
}
|
|
3669
3669
|
break;
|
|
@@ -3787,17 +3787,17 @@ M.checkPropClash = function(e, t, i) {
|
|
|
3787
3787
|
return;
|
|
3788
3788
|
}
|
|
3789
3789
|
n = "$" + n;
|
|
3790
|
-
var
|
|
3791
|
-
if (
|
|
3790
|
+
var h = t[n];
|
|
3791
|
+
if (h) {
|
|
3792
3792
|
var d;
|
|
3793
|
-
u === "init" ? d = this.strict &&
|
|
3793
|
+
u === "init" ? d = this.strict && h.init || h.get || h.set : d = h.init || h[u], d && this.raiseRecoverable(r.start, "Redefinition of property");
|
|
3794
3794
|
} else
|
|
3795
|
-
|
|
3795
|
+
h = t[n] = {
|
|
3796
3796
|
init: !1,
|
|
3797
3797
|
get: !1,
|
|
3798
3798
|
set: !1
|
|
3799
3799
|
};
|
|
3800
|
-
|
|
3800
|
+
h[u] = !0;
|
|
3801
3801
|
}
|
|
3802
3802
|
};
|
|
3803
3803
|
M.parseExpression = function(e, t) {
|
|
@@ -3816,14 +3816,14 @@ M.parseMaybeAssign = function(e, t, i) {
|
|
|
3816
3816
|
return this.parseYield(e);
|
|
3817
3817
|
this.exprAllowed = !1;
|
|
3818
3818
|
}
|
|
3819
|
-
var r = !1, n = -1, u = -1,
|
|
3820
|
-
t ? (n = t.parenthesizedAssign, u = t.trailingComma,
|
|
3819
|
+
var r = !1, n = -1, u = -1, h = -1;
|
|
3820
|
+
t ? (n = t.parenthesizedAssign, u = t.trailingComma, h = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Jt(), r = !0);
|
|
3821
3821
|
var d = this.start, y = this.startLoc;
|
|
3822
3822
|
(this.type === l.parenL || this.type === l.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
3823
3823
|
var o = this.parseMaybeConditional(e, t);
|
|
3824
3824
|
if (i && (o = i.call(this, o, d, y)), this.type.isAssign) {
|
|
3825
3825
|
var w = this.startNodeAt(d, y);
|
|
3826
|
-
return w.operator = this.value, this.type === l.eq && (o = this.toAssignable(o, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= o.start && (t.shorthandAssign = -1), this.type === l.eq ? this.checkLValPattern(o) : this.checkLValSimple(o), w.left = o, this.next(), w.right = this.parseMaybeAssign(e),
|
|
3826
|
+
return w.operator = this.value, this.type === l.eq && (o = this.toAssignable(o, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= o.start && (t.shorthandAssign = -1), this.type === l.eq ? this.checkLValPattern(o) : this.checkLValSimple(o), w.left = o, this.next(), w.right = this.parseMaybeAssign(e), h > -1 && (t.doubleProto = h), this.finishNode(w, "AssignmentExpression");
|
|
3827
3827
|
} else
|
|
3828
3828
|
r && this.checkExpressionErrors(t, !0);
|
|
3829
3829
|
return n > -1 && (t.parenthesizedAssign = n), u > -1 && (t.trailingComma = u), o;
|
|
@@ -3845,44 +3845,44 @@ M.parseExprOps = function(e, t) {
|
|
|
3845
3845
|
M.parseExprOp = function(e, t, i, r, n) {
|
|
3846
3846
|
var u = this.type.binop;
|
|
3847
3847
|
if (u != null && (!n || this.type !== l._in) && u > r) {
|
|
3848
|
-
var
|
|
3848
|
+
var h = this.type === l.logicalOR || this.type === l.logicalAND, d = this.type === l.coalesce;
|
|
3849
3849
|
d && (u = l.logicalAND.binop);
|
|
3850
3850
|
var y = this.value;
|
|
3851
3851
|
this.next();
|
|
3852
|
-
var o = this.start, w = this.startLoc, S = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, n), o, w, u, n), A = this.buildBinary(t, i, e, S, y,
|
|
3853
|
-
return (
|
|
3852
|
+
var o = this.start, w = this.startLoc, S = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, n), o, w, u, n), A = this.buildBinary(t, i, e, S, y, h || d);
|
|
3853
|
+
return (h && this.type === l.coalesce || d && (this.type === l.logicalOR || this.type === l.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(A, t, i, r, n);
|
|
3854
3854
|
}
|
|
3855
3855
|
return e;
|
|
3856
3856
|
};
|
|
3857
3857
|
M.buildBinary = function(e, t, i, r, n, u) {
|
|
3858
3858
|
r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
|
|
3859
|
-
var
|
|
3860
|
-
return
|
|
3859
|
+
var h = this.startNodeAt(e, t);
|
|
3860
|
+
return h.left = i, h.operator = n, h.right = r, this.finishNode(h, u ? "LogicalExpression" : "BinaryExpression");
|
|
3861
3861
|
};
|
|
3862
3862
|
M.parseMaybeUnary = function(e, t, i, r) {
|
|
3863
|
-
var n = this.start, u = this.startLoc,
|
|
3863
|
+
var n = this.start, u = this.startLoc, h;
|
|
3864
3864
|
if (this.isContextual("await") && this.canAwait)
|
|
3865
|
-
|
|
3865
|
+
h = this.parseAwait(r), t = !0;
|
|
3866
3866
|
else if (this.type.prefix) {
|
|
3867
3867
|
var d = this.startNode(), y = this.type === l.incDec;
|
|
3868
|
-
d.operator = this.value, d.prefix = !0, this.next(), d.argument = this.parseMaybeUnary(null, !0, y, r), this.checkExpressionErrors(e, !0), y ? this.checkLValSimple(d.argument) : this.strict && d.operator === "delete" && cs(d.argument) ? this.raiseRecoverable(d.start, "Deleting local variable in strict mode") : d.operator === "delete" && mi(d.argument) ? this.raiseRecoverable(d.start, "Private fields can not be deleted") : t = !0,
|
|
3868
|
+
d.operator = this.value, d.prefix = !0, this.next(), d.argument = this.parseMaybeUnary(null, !0, y, r), this.checkExpressionErrors(e, !0), y ? this.checkLValSimple(d.argument) : this.strict && d.operator === "delete" && cs(d.argument) ? this.raiseRecoverable(d.start, "Deleting local variable in strict mode") : d.operator === "delete" && mi(d.argument) ? this.raiseRecoverable(d.start, "Private fields can not be deleted") : t = !0, h = this.finishNode(d, y ? "UpdateExpression" : "UnaryExpression");
|
|
3869
3869
|
} else if (!t && this.type === l.privateId)
|
|
3870
|
-
(r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(),
|
|
3870
|
+
(r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), h = this.parsePrivateIdent(), this.type !== l._in && this.unexpected();
|
|
3871
3871
|
else {
|
|
3872
|
-
if (
|
|
3873
|
-
return
|
|
3872
|
+
if (h = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e))
|
|
3873
|
+
return h;
|
|
3874
3874
|
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
3875
3875
|
var o = this.startNodeAt(n, u);
|
|
3876
|
-
o.operator = this.value, o.prefix = !1, o.argument =
|
|
3876
|
+
o.operator = this.value, o.prefix = !1, o.argument = h, this.checkLValSimple(h), this.next(), h = this.finishNode(o, "UpdateExpression");
|
|
3877
3877
|
}
|
|
3878
3878
|
}
|
|
3879
3879
|
if (!i && this.eat(l.starstar))
|
|
3880
3880
|
if (t)
|
|
3881
3881
|
this.unexpected(this.lastTokStart);
|
|
3882
3882
|
else
|
|
3883
|
-
return this.buildBinary(n, u,
|
|
3883
|
+
return this.buildBinary(n, u, h, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
3884
3884
|
else
|
|
3885
|
-
return
|
|
3885
|
+
return h;
|
|
3886
3886
|
};
|
|
3887
3887
|
function cs(e) {
|
|
3888
3888
|
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && cs(e.expression);
|
|
@@ -3898,10 +3898,10 @@ M.parseExprSubscripts = function(e, t) {
|
|
|
3898
3898
|
return e && u.type === "MemberExpression" && (e.parenthesizedAssign >= u.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= u.start && (e.parenthesizedBind = -1), e.trailingComma >= u.start && (e.trailingComma = -1)), u;
|
|
3899
3899
|
};
|
|
3900
3900
|
M.parseSubscripts = function(e, t, i, r, n) {
|
|
3901
|
-
for (var u = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start,
|
|
3902
|
-
var d = this.parseSubscript(e, t, i, r, u,
|
|
3903
|
-
if (d.optional && (
|
|
3904
|
-
if (
|
|
3901
|
+
for (var u = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, h = !1; ; ) {
|
|
3902
|
+
var d = this.parseSubscript(e, t, i, r, u, h, n);
|
|
3903
|
+
if (d.optional && (h = !0), d === e || d.type === "ArrowFunctionExpression") {
|
|
3904
|
+
if (h) {
|
|
3905
3905
|
var y = this.startNodeAt(t, i);
|
|
3906
3906
|
y.expression = d, d = this.finishNode(y, "ChainExpression");
|
|
3907
3907
|
}
|
|
@@ -3916,7 +3916,7 @@ M.shouldParseAsyncArrow = function() {
|
|
|
3916
3916
|
M.parseSubscriptAsyncArrow = function(e, t, i, r) {
|
|
3917
3917
|
return this.parseArrowExpression(this.startNodeAt(e, t), i, !0, r);
|
|
3918
3918
|
};
|
|
3919
|
-
M.parseSubscript = function(e, t, i, r, n, u,
|
|
3919
|
+
M.parseSubscript = function(e, t, i, r, n, u, h) {
|
|
3920
3920
|
var d = this.options.ecmaVersion >= 11, y = d && this.eat(l.questionDot);
|
|
3921
3921
|
r && y && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
3922
3922
|
var o = this.eat(l.bracketL);
|
|
@@ -3928,14 +3928,14 @@ M.parseSubscript = function(e, t, i, r, n, u, c) {
|
|
|
3928
3928
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
3929
3929
|
var pe = this.parseExprList(l.parenR, this.options.ecmaVersion >= 8, !1, S);
|
|
3930
3930
|
if (n && !y && this.shouldParseAsyncArrow())
|
|
3931
|
-
return this.checkPatternErrors(S, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = A, this.awaitPos = F, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i, pe,
|
|
3931
|
+
return this.checkPatternErrors(S, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = A, this.awaitPos = F, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i, pe, h);
|
|
3932
3932
|
this.checkExpressionErrors(S, !0), this.yieldPos = A || this.yieldPos, this.awaitPos = F || this.awaitPos, this.awaitIdentPos = Z || this.awaitIdentPos;
|
|
3933
3933
|
var D = this.startNodeAt(t, i);
|
|
3934
3934
|
D.callee = e, D.arguments = pe, d && (D.optional = y), e = this.finishNode(D, "CallExpression");
|
|
3935
3935
|
} else if (this.type === l.backQuote) {
|
|
3936
3936
|
(y || u) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
3937
|
-
var
|
|
3938
|
-
|
|
3937
|
+
var se = this.startNodeAt(t, i);
|
|
3938
|
+
se.tag = e, se.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(se, "TaggedTemplateExpression");
|
|
3939
3939
|
}
|
|
3940
3940
|
return e;
|
|
3941
3941
|
};
|
|
@@ -3948,14 +3948,14 @@ M.parseExprAtom = function(e, t, i) {
|
|
|
3948
3948
|
case l._this:
|
|
3949
3949
|
return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
3950
3950
|
case l.name:
|
|
3951
|
-
var u = this.start,
|
|
3951
|
+
var u = this.start, h = this.startLoc, d = this.containsEsc, y = this.parseIdent(!1);
|
|
3952
3952
|
if (this.options.ecmaVersion >= 8 && !d && y.name === "async" && !this.canInsertSemicolon() && this.eat(l._function))
|
|
3953
|
-
return this.overrideContext(H.f_expr), this.parseFunction(this.startNodeAt(u,
|
|
3953
|
+
return this.overrideContext(H.f_expr), this.parseFunction(this.startNodeAt(u, h), 0, !1, !0, t);
|
|
3954
3954
|
if (n && !this.canInsertSemicolon()) {
|
|
3955
3955
|
if (this.eat(l.arrow))
|
|
3956
|
-
return this.parseArrowExpression(this.startNodeAt(u,
|
|
3956
|
+
return this.parseArrowExpression(this.startNodeAt(u, h), [y], !1, t);
|
|
3957
3957
|
if (this.options.ecmaVersion >= 8 && y.name === "async" && this.type === l.name && !d && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
3958
|
-
return y = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(l.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(u,
|
|
3958
|
+
return y = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(l.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(u, h), [y], !0, t);
|
|
3959
3959
|
}
|
|
3960
3960
|
return y;
|
|
3961
3961
|
case l.regexp:
|
|
@@ -4032,7 +4032,7 @@ M.parseParenAndDistinguishExpression = function(e, t) {
|
|
|
4032
4032
|
var i = this.start, r = this.startLoc, n, u = this.options.ecmaVersion >= 8;
|
|
4033
4033
|
if (this.options.ecmaVersion >= 6) {
|
|
4034
4034
|
this.next();
|
|
4035
|
-
var
|
|
4035
|
+
var h = this.start, d = this.startLoc, y = [], o = !0, w = !1, S = new Jt(), A = this.yieldPos, F = this.awaitPos, Z;
|
|
4036
4036
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== l.parenR; )
|
|
4037
4037
|
if (o ? o = !1 : this.expect(l.comma), u && this.afterTrailingComma(l.parenR, !0)) {
|
|
4038
4038
|
w = !0;
|
|
@@ -4048,12 +4048,12 @@ M.parseParenAndDistinguishExpression = function(e, t) {
|
|
|
4048
4048
|
var pe = this.lastTokEnd, D = this.lastTokEndLoc;
|
|
4049
4049
|
if (this.expect(l.parenR), e && this.shouldParseArrow(y) && this.eat(l.arrow))
|
|
4050
4050
|
return this.checkPatternErrors(S, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = A, this.awaitPos = F, this.parseParenArrowList(i, r, y, t);
|
|
4051
|
-
(!y.length || w) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(S, !0), this.yieldPos = A || this.yieldPos, this.awaitPos = F || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(
|
|
4051
|
+
(!y.length || w) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(S, !0), this.yieldPos = A || this.yieldPos, this.awaitPos = F || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(h, d), n.expressions = y, this.finishNodeAt(n, "SequenceExpression", pe, D)) : n = y[0];
|
|
4052
4052
|
} else
|
|
4053
4053
|
n = this.parseParenExpression();
|
|
4054
4054
|
if (this.options.preserveParens) {
|
|
4055
|
-
var
|
|
4056
|
-
return
|
|
4055
|
+
var se = this.startNodeAt(i, r);
|
|
4056
|
+
return se.expression = n, this.finishNode(se, "ParenthesizedExpression");
|
|
4057
4057
|
} else
|
|
4058
4058
|
return n;
|
|
4059
4059
|
};
|
|
@@ -4115,12 +4115,12 @@ M.parseObj = function(e, t) {
|
|
|
4115
4115
|
return this.finishNode(i, e ? "ObjectPattern" : "ObjectExpression");
|
|
4116
4116
|
};
|
|
4117
4117
|
M.parseProperty = function(e, t) {
|
|
4118
|
-
var i = this.startNode(), r, n, u,
|
|
4118
|
+
var i = this.startNode(), r, n, u, h;
|
|
4119
4119
|
if (this.options.ecmaVersion >= 9 && this.eat(l.ellipsis))
|
|
4120
4120
|
return e ? (i.argument = this.parseIdent(!1), this.type === l.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(i, "RestElement")) : (i.argument = this.parseMaybeAssign(!1, t), this.type === l.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(i, "SpreadElement"));
|
|
4121
|
-
this.options.ecmaVersion >= 6 && (i.method = !1, i.shorthand = !1, (e || t) && (u = this.start,
|
|
4121
|
+
this.options.ecmaVersion >= 6 && (i.method = !1, i.shorthand = !1, (e || t) && (u = this.start, h = this.startLoc), e || (r = this.eat(l.star)));
|
|
4122
4122
|
var d = this.containsEsc;
|
|
4123
|
-
return this.parsePropertyName(i), !e && !d && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(i) ? (n = !0, r = this.options.ecmaVersion >= 9 && this.eat(l.star), this.parsePropertyName(i)) : n = !1, this.parsePropertyValue(i, e, r, n, u,
|
|
4123
|
+
return this.parsePropertyName(i), !e && !d && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(i) ? (n = !0, r = this.options.ecmaVersion >= 9 && this.eat(l.star), this.parsePropertyName(i)) : n = !1, this.parsePropertyValue(i, e, r, n, u, h, t, d), this.finishNode(i, "Property");
|
|
4124
4124
|
};
|
|
4125
4125
|
M.parseGetterSetter = function(e) {
|
|
4126
4126
|
var t = e.key.name;
|
|
@@ -4132,8 +4132,8 @@ M.parseGetterSetter = function(e) {
|
|
|
4132
4132
|
} else
|
|
4133
4133
|
e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
4134
4134
|
};
|
|
4135
|
-
M.parsePropertyValue = function(e, t, i, r, n, u,
|
|
4136
|
-
(i || r) && this.type === l.colon && this.unexpected(), this.eat(l.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1,
|
|
4135
|
+
M.parsePropertyValue = function(e, t, i, r, n, u, h, d) {
|
|
4136
|
+
(i || r) && this.type === l.colon && this.unexpected(), this.eat(l.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, h), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === l.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(i, r), e.kind = "init") : !t && !d && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== l.comma && this.type !== l.braceR && this.type !== l.eq ? ((i || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((i || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = n), t ? e.value = this.parseMaybeDefault(n, u, this.copyNode(e.key)) : this.type === l.eq && h ? (h.shorthandAssign < 0 && (h.shorthandAssign = this.start), e.value = this.parseMaybeDefault(n, u, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
4137
4137
|
};
|
|
4138
4138
|
M.parsePropertyName = function(e) {
|
|
4139
4139
|
if (this.options.ecmaVersion >= 6) {
|
|
@@ -4147,22 +4147,22 @@ M.initFunction = function(e) {
|
|
|
4147
4147
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
4148
4148
|
};
|
|
4149
4149
|
M.parseMethod = function(e, t, i) {
|
|
4150
|
-
var r = this.startNode(), n = this.yieldPos, u = this.awaitPos,
|
|
4151
|
-
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ei(t, r.generator) | Kt | (i ? ss : 0)), this.expect(l.parenL), r.params = this.parseBindingList(l.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = n, this.awaitPos = u, this.awaitIdentPos =
|
|
4150
|
+
var r = this.startNode(), n = this.yieldPos, u = this.awaitPos, h = this.awaitIdentPos;
|
|
4151
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ei(t, r.generator) | Kt | (i ? ss : 0)), this.expect(l.parenL), r.params = this.parseBindingList(l.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = n, this.awaitPos = u, this.awaitIdentPos = h, this.finishNode(r, "FunctionExpression");
|
|
4152
4152
|
};
|
|
4153
4153
|
M.parseArrowExpression = function(e, t, i, r) {
|
|
4154
|
-
var n = this.yieldPos, u = this.awaitPos,
|
|
4155
|
-
return this.enterScope(Ei(i, !1) | Ai), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!i), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = n, this.awaitPos = u, this.awaitIdentPos =
|
|
4154
|
+
var n = this.yieldPos, u = this.awaitPos, h = this.awaitIdentPos;
|
|
4155
|
+
return this.enterScope(Ei(i, !1) | Ai), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!i), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = n, this.awaitPos = u, this.awaitIdentPos = h, this.finishNode(e, "ArrowFunctionExpression");
|
|
4156
4156
|
};
|
|
4157
4157
|
M.parseFunctionBody = function(e, t, i, r) {
|
|
4158
|
-
var n = t && this.type !== l.braceL, u = this.strict,
|
|
4158
|
+
var n = t && this.type !== l.braceL, u = this.strict, h = !1;
|
|
4159
4159
|
if (n)
|
|
4160
4160
|
e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
4161
4161
|
else {
|
|
4162
4162
|
var d = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
4163
|
-
(!u || d) && (
|
|
4163
|
+
(!u || d) && (h = this.strictDirective(this.end), h && d && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
4164
4164
|
var y = this.labels;
|
|
4165
|
-
this.labels = [],
|
|
4165
|
+
this.labels = [], h && (this.strict = !0), this.checkParams(e, !u && !h && !t && !i && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, os), e.body = this.parseBlock(!1, void 0, h && !u), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = y;
|
|
4166
4166
|
}
|
|
4167
4167
|
this.exitScope();
|
|
4168
4168
|
};
|
|
@@ -4186,8 +4186,8 @@ M.parseExprList = function(e, t, i, r) {
|
|
|
4186
4186
|
u = !1;
|
|
4187
4187
|
else if (this.expect(l.comma), t && this.afterTrailingComma(e))
|
|
4188
4188
|
break;
|
|
4189
|
-
var
|
|
4190
|
-
i && this.type === l.comma ?
|
|
4189
|
+
var h = void 0;
|
|
4190
|
+
i && this.type === l.comma ? h = null : this.type === l.ellipsis ? (h = this.parseSpread(r), r && this.type === l.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : h = this.parseMaybeAssign(!1, r), n.push(h);
|
|
4191
4191
|
}
|
|
4192
4192
|
return n;
|
|
4193
4193
|
};
|
|
@@ -4242,19 +4242,19 @@ We.exitScope = function() {
|
|
|
4242
4242
|
this.scopeStack.pop();
|
|
4243
4243
|
};
|
|
4244
4244
|
We.treatFunctionsAsVarInScope = function(e) {
|
|
4245
|
-
return e.flags & lt || !this.inModule && e.flags &
|
|
4245
|
+
return e.flags & lt || !this.inModule && e.flags & _t;
|
|
4246
4246
|
};
|
|
4247
4247
|
We.declareName = function(e, t, i) {
|
|
4248
4248
|
var r = !1;
|
|
4249
4249
|
if (t === Fe) {
|
|
4250
4250
|
var n = this.currentScope();
|
|
4251
|
-
r = n.lexical.indexOf(e) > -1 || n.functions.indexOf(e) > -1 || n.var.indexOf(e) > -1, n.lexical.push(e), this.inModule && n.flags &
|
|
4251
|
+
r = n.lexical.indexOf(e) > -1 || n.functions.indexOf(e) > -1 || n.var.indexOf(e) > -1, n.lexical.push(e), this.inModule && n.flags & _t && delete this.undefinedExports[e];
|
|
4252
4252
|
} else if (t === as) {
|
|
4253
4253
|
var u = this.currentScope();
|
|
4254
4254
|
u.lexical.push(e);
|
|
4255
4255
|
} else if (t === ns) {
|
|
4256
|
-
var
|
|
4257
|
-
this.treatFunctionsAsVar ? r =
|
|
4256
|
+
var h = this.currentScope();
|
|
4257
|
+
this.treatFunctionsAsVar ? r = h.lexical.indexOf(e) > -1 : r = h.lexical.indexOf(e) > -1 || h.var.indexOf(e) > -1, h.functions.push(e);
|
|
4258
4258
|
} else
|
|
4259
4259
|
for (var d = this.scopeStack.length - 1; d >= 0; --d) {
|
|
4260
4260
|
var y = this.scopeStack[d];
|
|
@@ -4262,7 +4262,7 @@ We.declareName = function(e, t, i) {
|
|
|
4262
4262
|
r = !0;
|
|
4263
4263
|
break;
|
|
4264
4264
|
}
|
|
4265
|
-
if (y.var.push(e), this.inModule && y.flags &
|
|
4265
|
+
if (y.var.push(e), this.inModule && y.flags & _t && delete this.undefinedExports[e], y.flags & Xt)
|
|
4266
4266
|
break;
|
|
4267
4267
|
}
|
|
4268
4268
|
r && this.raiseRecoverable(i, "Identifier '" + e + "' has already been declared");
|
|
@@ -4276,37 +4276,37 @@ We.currentScope = function() {
|
|
|
4276
4276
|
We.currentVarScope = function() {
|
|
4277
4277
|
for (var e = this.scopeStack.length - 1; ; e--) {
|
|
4278
4278
|
var t = this.scopeStack[e];
|
|
4279
|
-
if (t.flags & (Xt |
|
|
4279
|
+
if (t.flags & (Xt | wt | Qe))
|
|
4280
4280
|
return t;
|
|
4281
4281
|
}
|
|
4282
4282
|
};
|
|
4283
4283
|
We.currentThisScope = function() {
|
|
4284
4284
|
for (var e = this.scopeStack.length - 1; ; e--) {
|
|
4285
4285
|
var t = this.scopeStack[e];
|
|
4286
|
-
if (t.flags & (Xt |
|
|
4286
|
+
if (t.flags & (Xt | wt | Qe) && !(t.flags & Ai))
|
|
4287
4287
|
return t;
|
|
4288
4288
|
}
|
|
4289
4289
|
};
|
|
4290
|
-
var
|
|
4291
|
-
this.type = "", this.start = i, this.end = 0, t.options.locations && (this.loc = new
|
|
4292
|
-
},
|
|
4293
|
-
|
|
4294
|
-
return new
|
|
4290
|
+
var St = function(t, i, r) {
|
|
4291
|
+
this.type = "", this.start = i, this.end = 0, t.options.locations && (this.loc = new kt(t, r)), t.options.directSourceFile && (this.sourceFile = t.options.directSourceFile), t.options.ranges && (this.range = [i, 0]);
|
|
4292
|
+
}, Tt = J.prototype;
|
|
4293
|
+
Tt.startNode = function() {
|
|
4294
|
+
return new St(this, this.start, this.startLoc);
|
|
4295
4295
|
};
|
|
4296
|
-
|
|
4297
|
-
return new
|
|
4296
|
+
Tt.startNodeAt = function(e, t) {
|
|
4297
|
+
return new St(this, e, t);
|
|
4298
4298
|
};
|
|
4299
4299
|
function hs(e, t, i, r) {
|
|
4300
4300
|
return e.type = t, e.end = i, this.options.locations && (e.loc.end = r), this.options.ranges && (e.range[1] = i), e;
|
|
4301
4301
|
}
|
|
4302
|
-
|
|
4302
|
+
Tt.finishNode = function(e, t) {
|
|
4303
4303
|
return hs.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
4304
4304
|
};
|
|
4305
|
-
|
|
4305
|
+
Tt.finishNodeAt = function(e, t, i, r) {
|
|
4306
4306
|
return hs.call(this, e, t, i, r);
|
|
4307
4307
|
};
|
|
4308
|
-
|
|
4309
|
-
var t = new
|
|
4308
|
+
Tt.copyNode = function(e) {
|
|
4309
|
+
var t = new St(this, e.start, this.startLoc);
|
|
4310
4310
|
for (var i in e)
|
|
4311
4311
|
t[i] = e[i];
|
|
4312
4312
|
return t;
|
|
@@ -4379,16 +4379,16 @@ De.prototype.at = function(t, i) {
|
|
|
4379
4379
|
var u = r.charCodeAt(t);
|
|
4380
4380
|
if (!(i || this.switchU) || u <= 55295 || u >= 57344 || t + 1 >= n)
|
|
4381
4381
|
return u;
|
|
4382
|
-
var
|
|
4383
|
-
return
|
|
4382
|
+
var h = r.charCodeAt(t + 1);
|
|
4383
|
+
return h >= 56320 && h <= 57343 ? (u << 10) + h - 56613888 : u;
|
|
4384
4384
|
};
|
|
4385
4385
|
De.prototype.nextIndex = function(t, i) {
|
|
4386
4386
|
i === void 0 && (i = !1);
|
|
4387
4387
|
var r = this.source, n = r.length;
|
|
4388
4388
|
if (t >= n)
|
|
4389
4389
|
return n;
|
|
4390
|
-
var u = r.charCodeAt(t),
|
|
4391
|
-
return !(i || this.switchU) || u <= 55295 || u >= 57344 || t + 1 >= n || (
|
|
4390
|
+
var u = r.charCodeAt(t), h;
|
|
4391
|
+
return !(i || this.switchU) || u <= 55295 || u >= 57344 || t + 1 >= n || (h = r.charCodeAt(t + 1)) < 56320 || h > 57343 ? t + 1 : t + 2;
|
|
4392
4392
|
};
|
|
4393
4393
|
De.prototype.current = function(t) {
|
|
4394
4394
|
return t === void 0 && (t = !1), this.at(this.pos, t);
|
|
@@ -4405,8 +4405,8 @@ De.prototype.eat = function(t, i) {
|
|
|
4405
4405
|
De.prototype.eatChars = function(t, i) {
|
|
4406
4406
|
i === void 0 && (i = !1);
|
|
4407
4407
|
for (var r = this.pos, n = 0, u = t; n < u.length; n += 1) {
|
|
4408
|
-
var
|
|
4409
|
-
if (d === -1 || d !==
|
|
4408
|
+
var h = u[n], d = this.at(r, i);
|
|
4409
|
+
if (d === -1 || d !== h)
|
|
4410
4410
|
return !1;
|
|
4411
4411
|
r = this.nextIndex(r, i);
|
|
4412
4412
|
}
|
|
@@ -4414,8 +4414,8 @@ De.prototype.eatChars = function(t, i) {
|
|
|
4414
4414
|
};
|
|
4415
4415
|
C.validateRegExpFlags = function(e) {
|
|
4416
4416
|
for (var t = e.validFlags, i = e.flags, r = !1, n = !1, u = 0; u < i.length; u++) {
|
|
4417
|
-
var
|
|
4418
|
-
t.indexOf(
|
|
4417
|
+
var h = i.charAt(u);
|
|
4418
|
+
t.indexOf(h) === -1 && this.raise(e.start, "Invalid regular expression flag"), i.indexOf(h, u + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), h === "u" && (r = !0), h === "v" && (n = !0);
|
|
4419
4419
|
}
|
|
4420
4420
|
this.options.ecmaVersion >= 15 && r && n && this.raise(e.start, "Invalid regular expression flag");
|
|
4421
4421
|
};
|
|
@@ -4587,11 +4587,11 @@ C.regexp_eatUncapturingGroup = function(e) {
|
|
|
4587
4587
|
i.indexOf(u, n + 1) > -1 && e.raise("Duplicate regular expression modifiers");
|
|
4588
4588
|
}
|
|
4589
4589
|
if (r) {
|
|
4590
|
-
var
|
|
4591
|
-
!i && !
|
|
4592
|
-
for (var d = 0; d <
|
|
4593
|
-
var y =
|
|
4594
|
-
(
|
|
4590
|
+
var h = this.regexp_eatModifiers(e);
|
|
4591
|
+
!i && !h && e.current() === 58 && e.raise("Invalid regular expression modifiers");
|
|
4592
|
+
for (var d = 0; d < h.length; d++) {
|
|
4593
|
+
var y = h.charAt(d);
|
|
4594
|
+
(h.indexOf(y, d + 1) > -1 || i.indexOf(y) > -1) && e.raise("Duplicate regular expression modifiers");
|
|
4595
4595
|
}
|
|
4596
4596
|
}
|
|
4597
4597
|
}
|
|
@@ -4786,9 +4786,9 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
4786
4786
|
117
|
|
4787
4787
|
/* u */
|
|
4788
4788
|
) && this.regexp_eatFixedHexDigits(e, 4)) {
|
|
4789
|
-
var
|
|
4790
|
-
if (
|
|
4791
|
-
return e.lastIntValue = (n - 55296) * 1024 + (
|
|
4789
|
+
var h = e.lastIntValue;
|
|
4790
|
+
if (h >= 56320 && h <= 57343)
|
|
4791
|
+
return e.lastIntValue = (n - 55296) * 1024 + (h - 56320) + 65536, !0;
|
|
4792
4792
|
}
|
|
4793
4793
|
e.pos = u, e.lastIntValue = n;
|
|
4794
4794
|
}
|
|
@@ -5179,7 +5179,7 @@ C.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
5179
5179
|
return !0;
|
|
5180
5180
|
};
|
|
5181
5181
|
var Qt = function(t) {
|
|
5182
|
-
this.type = t.type, this.value = t.value, this.start = t.start, this.end = t.end, t.options.locations && (this.loc = new
|
|
5182
|
+
this.type = t.type, this.value = t.value, this.start = t.start, this.end = t.end, t.options.locations && (this.loc = new kt(t, t.startLoc, t.endLoc)), t.options.ranges && (this.range = [t.start, t.end]);
|
|
5183
5183
|
}, j = J.prototype;
|
|
5184
5184
|
j.next = function(e) {
|
|
5185
5185
|
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Qt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
@@ -5462,19 +5462,19 @@ j.readRegexp = function() {
|
|
|
5462
5462
|
}
|
|
5463
5463
|
var n = this.input.slice(i, this.pos);
|
|
5464
5464
|
++this.pos;
|
|
5465
|
-
var u = this.pos,
|
|
5465
|
+
var u = this.pos, h = this.readWord1();
|
|
5466
5466
|
this.containsEsc && this.unexpected(u);
|
|
5467
5467
|
var d = this.regexpState || (this.regexpState = new De(this));
|
|
5468
|
-
d.reset(i, n,
|
|
5468
|
+
d.reset(i, n, h), this.validateRegExpFlags(d), this.validateRegExpPattern(d);
|
|
5469
5469
|
var y = null;
|
|
5470
5470
|
try {
|
|
5471
|
-
y = new RegExp(n,
|
|
5471
|
+
y = new RegExp(n, h);
|
|
5472
5472
|
} catch {
|
|
5473
5473
|
}
|
|
5474
|
-
return this.finishToken(l.regexp, { pattern: n, flags:
|
|
5474
|
+
return this.finishToken(l.regexp, { pattern: n, flags: h, value: y });
|
|
5475
5475
|
};
|
|
5476
5476
|
j.readInt = function(e, t, i) {
|
|
5477
|
-
for (var r = this.options.ecmaVersion >= 12 && t === void 0, n = i && this.input.charCodeAt(this.pos) === 48, u = this.pos,
|
|
5477
|
+
for (var r = this.options.ecmaVersion >= 12 && t === void 0, n = i && this.input.charCodeAt(this.pos) === 48, u = this.pos, h = 0, d = 0, y = 0, o = t ?? 1 / 0; y < o; ++y, ++this.pos) {
|
|
5478
5478
|
var w = this.input.charCodeAt(this.pos), S = void 0;
|
|
5479
5479
|
if (r && w === 95) {
|
|
5480
5480
|
n && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), d === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), y === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), d = w;
|
|
@@ -5482,9 +5482,9 @@ j.readInt = function(e, t, i) {
|
|
|
5482
5482
|
}
|
|
5483
5483
|
if (w >= 97 ? S = w - 97 + 10 : w >= 65 ? S = w - 65 + 10 : w >= 48 && w <= 57 ? S = w - 48 : S = 1 / 0, S >= e)
|
|
5484
5484
|
break;
|
|
5485
|
-
d = w,
|
|
5485
|
+
d = w, h = h * e + S;
|
|
5486
5486
|
}
|
|
5487
|
-
return r && d === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === u || t != null && this.pos - u !== t ? null :
|
|
5487
|
+
return r && d === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === u || t != null && this.pos - u !== t ? null : h;
|
|
5488
5488
|
};
|
|
5489
5489
|
function Th(e, t) {
|
|
5490
5490
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
@@ -5670,8 +5670,8 @@ j.readWord1 = function() {
|
|
|
5670
5670
|
this.containsEsc = !0, e += this.input.slice(i, this.pos);
|
|
5671
5671
|
var u = this.pos;
|
|
5672
5672
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
5673
|
-
var
|
|
5674
|
-
(t ? Ee : Ve)(
|
|
5673
|
+
var h = this.readCodePoint();
|
|
5674
|
+
(t ? Ee : Ve)(h, r) || this.invalidStringToken(u, "Invalid Unicode escape"), e += ze(h), i = this.pos;
|
|
5675
5675
|
} else
|
|
5676
5676
|
break;
|
|
5677
5677
|
t = !1;
|
|
@@ -5688,9 +5688,9 @@ J.acorn = {
|
|
|
5688
5688
|
version: Ns,
|
|
5689
5689
|
defaultOptions: jt,
|
|
5690
5690
|
Position: ot,
|
|
5691
|
-
SourceLocation:
|
|
5691
|
+
SourceLocation: kt,
|
|
5692
5692
|
getLineInfo: Pi,
|
|
5693
|
-
Node:
|
|
5693
|
+
Node: St,
|
|
5694
5694
|
TokenType: z,
|
|
5695
5695
|
tokTypes: l,
|
|
5696
5696
|
keywordTypes: at,
|
|
@@ -5715,10 +5715,10 @@ function Ah(e, t) {
|
|
|
5715
5715
|
}
|
|
5716
5716
|
const Eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5717
5717
|
__proto__: null,
|
|
5718
|
-
Node:
|
|
5718
|
+
Node: St,
|
|
5719
5719
|
Parser: J,
|
|
5720
5720
|
Position: ot,
|
|
5721
|
-
SourceLocation:
|
|
5721
|
+
SourceLocation: kt,
|
|
5722
5722
|
TokContext: ce,
|
|
5723
5723
|
Token: Qt,
|
|
5724
5724
|
TokenType: z,
|
|
@@ -5741,7 +5741,7 @@ const Eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5741
5741
|
function mr(e, t) {
|
|
5742
5742
|
for (var i = 0; i < t.length; i++) {
|
|
5743
5743
|
var r = t[i];
|
|
5744
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, typeof (n = (function(u,
|
|
5744
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, typeof (n = (function(u, h) {
|
|
5745
5745
|
if (typeof u != "object" || u === null) return u;
|
|
5746
5746
|
var d = u[Symbol.toPrimitive];
|
|
5747
5747
|
if (d !== void 0) {
|
|
@@ -5763,7 +5763,7 @@ function Ut() {
|
|
|
5763
5763
|
return e;
|
|
5764
5764
|
}, Ut.apply(this, arguments);
|
|
5765
5765
|
}
|
|
5766
|
-
function
|
|
5766
|
+
function Rt(e, t) {
|
|
5767
5767
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, yi(e, t);
|
|
5768
5768
|
}
|
|
5769
5769
|
function yi(e, t) {
|
|
@@ -5782,8 +5782,8 @@ function vr(e, t) {
|
|
|
5782
5782
|
if (Array.isArray(e) || (i = (function(n, u) {
|
|
5783
5783
|
if (n) {
|
|
5784
5784
|
if (typeof n == "string") return yr(n, u);
|
|
5785
|
-
var
|
|
5786
|
-
return
|
|
5785
|
+
var h = Object.prototype.toString.call(n).slice(8, -1);
|
|
5786
|
+
return h === "Object" && n.constructor && (h = n.constructor.name), h === "Map" || h === "Set" ? Array.from(n) : h === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h) ? yr(n, u) : void 0;
|
|
5787
5787
|
}
|
|
5788
5788
|
})(e)) || t) {
|
|
5789
5789
|
i && (e = i);
|
|
@@ -5806,21 +5806,21 @@ function Nh(e) {
|
|
|
5806
5806
|
var i = { assert: ge(0, { startsExpr: xe }), asserts: ge(0, { startsExpr: xe }), global: ge(0, { startsExpr: xe }), keyof: ge(0, { startsExpr: xe }), readonly: ge(0, { startsExpr: xe }), unique: ge(0, { startsExpr: xe }), abstract: ge(0, { startsExpr: xe }), declare: ge(0, { startsExpr: xe }), enum: ge(0, { startsExpr: xe }), module: ge(0, { startsExpr: xe }), namespace: ge(0, { startsExpr: xe }), interface: ge(0, { startsExpr: xe }), type: ge(0, { startsExpr: xe }) }, r = { at: new z("@"), jsxName: new z("jsxName"), jsxText: new z("jsxText", { beforeExpr: !0 }), jsxTagStart: new z("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new z("jsxTagEnd") }, n = { tc_oTag: new ce("<tag", !1, !1), tc_cTag: new ce("</tag", !1, !1), tc_expr: new ce("<tag>...</tag>", !0, !0) }, u = new RegExp("^(?:" + Object.keys(i).join("|") + ")$");
|
|
5807
5807
|
r.jsxTagStart.updateContext = function() {
|
|
5808
5808
|
this.context.push(n.tc_expr), this.context.push(n.tc_oTag), this.exprAllowed = !1;
|
|
5809
|
-
}, r.jsxTagEnd.updateContext = function(
|
|
5809
|
+
}, r.jsxTagEnd.updateContext = function(h) {
|
|
5810
5810
|
var d = this.context.pop();
|
|
5811
|
-
d === n.tc_oTag &&
|
|
5812
|
-
}, t = { tokTypes: Ut({}, i, r), tokContexts: Ut({}, n), keywordsRegExp: u, tokenIsLiteralPropertyName: function(
|
|
5813
|
-
return [l.name, l.string, l.num].concat(Object.values(at), Object.values(i)).includes(
|
|
5814
|
-
}, tokenIsKeywordOrIdentifier: function(
|
|
5815
|
-
return [l.name].concat(Object.values(at), Object.values(i)).includes(
|
|
5816
|
-
}, tokenIsIdentifier: function(
|
|
5817
|
-
return [].concat(Object.values(i), [l.name]).includes(
|
|
5818
|
-
}, tokenIsTSDeclarationStart: function(
|
|
5819
|
-
return [i.abstract, i.declare, i.enum, i.module, i.namespace, i.interface, i.type].includes(
|
|
5820
|
-
}, tokenIsTSTypeOperator: function(
|
|
5821
|
-
return [i.keyof, i.readonly, i.unique].includes(
|
|
5822
|
-
}, tokenIsTemplate: function(
|
|
5823
|
-
return
|
|
5811
|
+
d === n.tc_oTag && h === l.slash || d === n.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === n.tc_expr) : this.exprAllowed = !0;
|
|
5812
|
+
}, t = { tokTypes: Ut({}, i, r), tokContexts: Ut({}, n), keywordsRegExp: u, tokenIsLiteralPropertyName: function(h) {
|
|
5813
|
+
return [l.name, l.string, l.num].concat(Object.values(at), Object.values(i)).includes(h);
|
|
5814
|
+
}, tokenIsKeywordOrIdentifier: function(h) {
|
|
5815
|
+
return [l.name].concat(Object.values(at), Object.values(i)).includes(h);
|
|
5816
|
+
}, tokenIsIdentifier: function(h) {
|
|
5817
|
+
return [].concat(Object.values(i), [l.name]).includes(h);
|
|
5818
|
+
}, tokenIsTSDeclarationStart: function(h) {
|
|
5819
|
+
return [i.abstract, i.declare, i.enum, i.module, i.namespace, i.interface, i.type].includes(h);
|
|
5820
|
+
}, tokenIsTSTypeOperator: function(h) {
|
|
5821
|
+
return [i.keyof, i.readonly, i.unique].includes(h);
|
|
5822
|
+
}, tokenIsTemplate: function(h) {
|
|
5823
|
+
return h === l.invalidTemplate;
|
|
5824
5824
|
} };
|
|
5825
5825
|
}
|
|
5826
5826
|
return t;
|
|
@@ -5874,8 +5874,8 @@ var N = { AbstractMethodHasImplementation: function(e) {
|
|
|
5874
5874
|
}, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", GenericsEndWithComma: "Trailing comma is not allowed at the end of generics.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: function(e) {
|
|
5875
5875
|
return "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got " + e.type + ".";
|
|
5876
5876
|
}, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Rh = { quot: '"', amp: "&", apos: "'", lt: "<", gt: ">", nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", fnof: "ƒ", circ: "ˆ", tilde: "˜", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", bull: "•", hellip: "…", permil: "‰", prime: "′", Prime: "″", lsaquo: "‹", rsaquo: "›", oline: "‾", frasl: "⁄", euro: "€", image: "ℑ", weierp: "℘", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "∧", or: "∨", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦" }, Dh = /^[\da-fA-F]+$/, Mh = /^\d+$/;
|
|
5877
|
-
function
|
|
5878
|
-
return e && (e.type === "JSXIdentifier" ? e.name : e.type === "JSXNamespacedName" ? e.namespace.name + ":" + e.name.name : e.type === "JSXMemberExpression" ?
|
|
5877
|
+
function gt(e) {
|
|
5878
|
+
return e && (e.type === "JSXIdentifier" ? e.name : e.type === "JSXNamespacedName" ? e.namespace.name + ":" + e.name.name : e.type === "JSXMemberExpression" ? gt(e.object) + "." + gt(e.property) : void 0);
|
|
5879
5879
|
}
|
|
5880
5880
|
var ui = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
5881
5881
|
function br(e) {
|
|
@@ -5903,8 +5903,8 @@ function _r(e) {
|
|
|
5903
5903
|
}
|
|
5904
5904
|
function Fh(e) {
|
|
5905
5905
|
var t = {}, i = t.dts, r = i !== void 0 && i, n = t.allowSatisfies, u = n !== void 0 && n;
|
|
5906
|
-
return function(
|
|
5907
|
-
var d =
|
|
5906
|
+
return function(h) {
|
|
5907
|
+
var d = h.acorn || Eh, y = Nh(d), o = d.tokTypes, w = d.keywordTypes, S = d.isIdentifierStart, A = d.lineBreak, F = d.isNewLine, Z = d.tokContexts, pe = d.isIdentifierChar, D = y.tokTypes, se = y.tokContexts, ft = y.keywordsRegExp, Ae = y.tokenIsLiteralPropertyName, _e = y.tokenIsTemplate, Ke = y.tokenIsTSDeclarationStart, q = y.tokenIsIdentifier, Ct = y.tokenIsKeywordOrIdentifier, Rs = y.tokenIsTSTypeOperator;
|
|
5908
5908
|
function Ds(P, fe, ue) {
|
|
5909
5909
|
ue === void 0 && (ue = P.length);
|
|
5910
5910
|
for (var te = fe; te < ue; te++) {
|
|
@@ -5913,25 +5913,25 @@ function Fh(e) {
|
|
|
5913
5913
|
}
|
|
5914
5914
|
return -1;
|
|
5915
5915
|
}
|
|
5916
|
-
|
|
5916
|
+
h = (function(P, fe, ue) {
|
|
5917
5917
|
var te = ue.tokTypes, B = fe.tokTypes;
|
|
5918
5918
|
return (function(f) {
|
|
5919
5919
|
function s() {
|
|
5920
5920
|
return f.apply(this, arguments) || this;
|
|
5921
5921
|
}
|
|
5922
|
-
|
|
5922
|
+
Rt(s, f);
|
|
5923
5923
|
var a = s.prototype;
|
|
5924
|
-
return a.takeDecorators = function(
|
|
5924
|
+
return a.takeDecorators = function(c) {
|
|
5925
5925
|
var p = this.decoratorStack[this.decoratorStack.length - 1];
|
|
5926
|
-
p.length && (
|
|
5927
|
-
}, a.parseDecorators = function(
|
|
5926
|
+
p.length && (c.decorators = p, this.resetStartLocationFromNode(c, p[0]), this.decoratorStack[this.decoratorStack.length - 1] = []);
|
|
5927
|
+
}, a.parseDecorators = function(c) {
|
|
5928
5928
|
for (var p = this.decoratorStack[this.decoratorStack.length - 1]; this.match(B.at); ) {
|
|
5929
5929
|
var m = this.parseDecorator();
|
|
5930
5930
|
p.push(m);
|
|
5931
5931
|
}
|
|
5932
|
-
this.match(te._export) ?
|
|
5932
|
+
this.match(te._export) ? c || this.unexpected() : this.canHaveLeadingDecorator() || this.raise(this.start, "Leading decorators must be attached to a class declaration.");
|
|
5933
5933
|
}, a.parseDecorator = function() {
|
|
5934
|
-
var
|
|
5934
|
+
var c = this.startNode();
|
|
5935
5935
|
this.next(), this.decoratorStack.push([]);
|
|
5936
5936
|
var p, m = this.start, v = this.startLoc;
|
|
5937
5937
|
if (this.match(te.parenL)) {
|
|
@@ -5944,22 +5944,22 @@ function Fh(e) {
|
|
|
5944
5944
|
var T = this.startNodeAt(m, v);
|
|
5945
5945
|
T.object = p, T.property = this.parseIdent(!0), T.computed = !1, p = this.finishNode(T, "MemberExpression");
|
|
5946
5946
|
}
|
|
5947
|
-
return
|
|
5948
|
-
}, a.parseMaybeDecoratorArguments = function(
|
|
5947
|
+
return c.expression = this.parseMaybeDecoratorArguments(p), this.decoratorStack.pop(), this.finishNode(c, "Decorator");
|
|
5948
|
+
}, a.parseMaybeDecoratorArguments = function(c) {
|
|
5949
5949
|
if (this.eat(te.parenL)) {
|
|
5950
|
-
var p = this.startNodeAtNode(
|
|
5951
|
-
return p.callee =
|
|
5950
|
+
var p = this.startNodeAtNode(c);
|
|
5951
|
+
return p.callee = c, p.arguments = this.parseExprList(te.parenR, !1), this.finishNode(p, "CallExpression");
|
|
5952
5952
|
}
|
|
5953
|
-
return
|
|
5953
|
+
return c;
|
|
5954
5954
|
}, s;
|
|
5955
5955
|
})(P);
|
|
5956
|
-
})(
|
|
5957
|
-
var B = P.tokTypes, f = fe.tokTypes, s = P.isNewLine, a = P.isIdentifierChar,
|
|
5956
|
+
})(h, y, d), h = (function(P, fe, ue, te) {
|
|
5957
|
+
var B = P.tokTypes, f = fe.tokTypes, s = P.isNewLine, a = P.isIdentifierChar, c = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
5958
5958
|
return (function(p) {
|
|
5959
5959
|
function m() {
|
|
5960
5960
|
return p.apply(this, arguments) || this;
|
|
5961
5961
|
}
|
|
5962
|
-
|
|
5962
|
+
Rt(m, p);
|
|
5963
5963
|
var v = m.prototype;
|
|
5964
5964
|
return v.jsx_readToken = function() {
|
|
5965
5965
|
for (var x = "", g = this.pos; ; ) {
|
|
@@ -6014,13 +6014,13 @@ function Fh(e) {
|
|
|
6014
6014
|
return this.type === f.jsxName ? x.name = this.value : this.type.keyword ? x.name = this.type.keyword : this.unexpected(), this.next(), this.finishNode(x, "JSXIdentifier");
|
|
6015
6015
|
}, v.jsx_parseNamespacedName = function() {
|
|
6016
6016
|
var x = this.start, g = this.startLoc, _ = this.jsx_parseIdentifier();
|
|
6017
|
-
if (!
|
|
6017
|
+
if (!c.allowNamespaces || !this.eat(B.colon)) return _;
|
|
6018
6018
|
var T = this.startNodeAt(x, g);
|
|
6019
6019
|
return T.namespace = _, T.name = this.jsx_parseIdentifier(), this.finishNode(T, "JSXNamespacedName");
|
|
6020
6020
|
}, v.jsx_parseElementName = function() {
|
|
6021
6021
|
if (this.type === f.jsxTagEnd) return "";
|
|
6022
6022
|
var x = this.start, g = this.startLoc, _ = this.jsx_parseNamespacedName();
|
|
6023
|
-
for (this.type !== B.dot || _.type !== "JSXNamespacedName" ||
|
|
6023
|
+
for (this.type !== B.dot || _.type !== "JSXNamespacedName" || c.allowNamespacedObjects || this.unexpected(); this.eat(B.dot); ) {
|
|
6024
6024
|
var T = this.startNodeAt(x, g);
|
|
6025
6025
|
T.object = _, T.property = this.jsx_parseIdentifier(), _ = this.finishNode(T, "JSXMemberExpression");
|
|
6026
6026
|
}
|
|
@@ -6074,7 +6074,7 @@ function Fh(e) {
|
|
|
6074
6074
|
default:
|
|
6075
6075
|
this.unexpected();
|
|
6076
6076
|
}
|
|
6077
|
-
|
|
6077
|
+
gt(V.name) !== gt(L.name) && this.raise(V.start, "Expected corresponding JSX closing tag for <" + gt(L.name) + ">");
|
|
6078
6078
|
}
|
|
6079
6079
|
var E = L.name ? "Element" : "Fragment";
|
|
6080
6080
|
return _["opening" + E] = L, _["closing" + E] = V, _.children = T, this.type === B.relational && this.value === "<" && this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"), this.finishNode(_, "JSX" + E);
|
|
@@ -6086,55 +6086,55 @@ function Fh(e) {
|
|
|
6086
6086
|
return this.next(), this.jsx_parseElementAt(x, g);
|
|
6087
6087
|
}, m;
|
|
6088
6088
|
})(ue);
|
|
6089
|
-
})(d, y,
|
|
6089
|
+
})(d, y, h), h = (function(P, fe, ue) {
|
|
6090
6090
|
var te = fe.tokTypes, B = ue.tokTypes;
|
|
6091
6091
|
return (function(f) {
|
|
6092
6092
|
function s() {
|
|
6093
6093
|
return f.apply(this, arguments) || this;
|
|
6094
6094
|
}
|
|
6095
|
-
|
|
6095
|
+
Rt(s, f);
|
|
6096
6096
|
var a = s.prototype;
|
|
6097
|
-
return a.parseMaybeImportAttributes = function(
|
|
6097
|
+
return a.parseMaybeImportAttributes = function(c) {
|
|
6098
6098
|
if (this.type === B._with || this.type === te.assert) {
|
|
6099
6099
|
this.next();
|
|
6100
6100
|
var p = this.parseImportAttributes();
|
|
6101
|
-
p && (
|
|
6101
|
+
p && (c.attributes = p);
|
|
6102
6102
|
}
|
|
6103
6103
|
}, a.parseImportAttributes = function() {
|
|
6104
6104
|
this.expect(B.braceL);
|
|
6105
|
-
var
|
|
6106
|
-
return this.expect(B.braceR),
|
|
6105
|
+
var c = this.parseWithEntries();
|
|
6106
|
+
return this.expect(B.braceR), c;
|
|
6107
6107
|
}, a.parseWithEntries = function() {
|
|
6108
|
-
var
|
|
6108
|
+
var c = [], p = /* @__PURE__ */ new Set();
|
|
6109
6109
|
do {
|
|
6110
6110
|
if (this.type === B.braceR) break;
|
|
6111
6111
|
var m, v = this.startNode();
|
|
6112
|
-
m = this.type === B.string ? this.parseLiteral(this.value) : this.parseIdent(!0), this.next(), v.key = m, p.has(v.key.name) && this.raise(this.pos, "Duplicated key in attributes"), p.add(v.key.name), this.type !== B.string && this.raise(this.pos, "Only string is supported as an attribute value"), v.value = this.parseLiteral(this.value),
|
|
6112
|
+
m = this.type === B.string ? this.parseLiteral(this.value) : this.parseIdent(!0), this.next(), v.key = m, p.has(v.key.name) && this.raise(this.pos, "Duplicated key in attributes"), p.add(v.key.name), this.type !== B.string && this.raise(this.pos, "Only string is supported as an attribute value"), v.value = this.parseLiteral(this.value), c.push(this.finishNode(v, "ImportAttribute"));
|
|
6113
6113
|
} while (this.eat(B.comma));
|
|
6114
|
-
return
|
|
6114
|
+
return c;
|
|
6115
6115
|
}, s;
|
|
6116
6116
|
})(P);
|
|
6117
|
-
})(
|
|
6117
|
+
})(h, y, d);
|
|
6118
6118
|
var Ms = /* @__PURE__ */ (function(P) {
|
|
6119
|
-
function fe(s, a,
|
|
6119
|
+
function fe(s, a, c) {
|
|
6120
6120
|
var p;
|
|
6121
|
-
return (p = P.call(this, s, a,
|
|
6121
|
+
return (p = P.call(this, s, a, c) || this).preValue = null, p.preToken = null, p.isLookahead = !1, p.isAmbientContext = !1, p.inAbstractClass = !1, p.inType = !1, p.inDisallowConditionalTypesContext = !1, p.maybeInArrowParameters = !1, p.shouldParseArrowReturnType = void 0, p.shouldParseAsyncArrowReturnType = void 0, p.decoratorStack = [[]], p.importsStack = [[]], p.importOrExportOuterKind = void 0, p.tsParseConstModifier = p.tsParseModifiers.bind((function(m) {
|
|
6122
6122
|
if (m === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
6123
6123
|
return m;
|
|
6124
6124
|
})(p), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: N.InvalidModifierOnTypeParameterPositions }), p;
|
|
6125
6125
|
}
|
|
6126
|
-
|
|
6126
|
+
Rt(fe, P);
|
|
6127
6127
|
var ue, te, B, f = fe.prototype;
|
|
6128
6128
|
return f.getTokenFromCodeInType = function(s) {
|
|
6129
6129
|
return s === 62 || s === 60 ? this.finishOp(o.relational, 1) : P.prototype.getTokenFromCode.call(this, s);
|
|
6130
6130
|
}, f.readToken = function(s) {
|
|
6131
6131
|
if (!this.inType) {
|
|
6132
6132
|
var a = this.curContext();
|
|
6133
|
-
if (a ===
|
|
6134
|
-
if (a ===
|
|
6133
|
+
if (a === se.tc_expr) return this.jsx_readToken();
|
|
6134
|
+
if (a === se.tc_oTag || a === se.tc_cTag) {
|
|
6135
6135
|
if (S(s)) return this.jsx_readWord();
|
|
6136
6136
|
if (s == 62) return ++this.pos, this.finishToken(D.jsxTagEnd);
|
|
6137
|
-
if ((s === 34 || s === 39) && a ==
|
|
6137
|
+
if ((s === 34 || s === 39) && a == se.tc_oTag) return this.jsx_readString(s);
|
|
6138
6138
|
}
|
|
6139
6139
|
if (s === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) return ++this.pos, this.finishToken(D.jsxTagStart);
|
|
6140
6140
|
}
|
|
@@ -6147,20 +6147,20 @@ function Fh(e) {
|
|
|
6147
6147
|
return s.type !== "" && s.end !== 0 ? s : P.prototype.finishNode.call(this, s, a);
|
|
6148
6148
|
}, f.tryParse = function(s, a) {
|
|
6149
6149
|
a === void 0 && (a = this.cloneCurLookaheadState());
|
|
6150
|
-
var
|
|
6150
|
+
var c = { node: null };
|
|
6151
6151
|
try {
|
|
6152
6152
|
return { node: s(function(m) {
|
|
6153
|
-
throw m === void 0 && (m = null),
|
|
6153
|
+
throw m === void 0 && (m = null), c.node = m, c;
|
|
6154
6154
|
}), error: null, thrown: !1, aborted: !1, failState: null };
|
|
6155
6155
|
} catch (m) {
|
|
6156
6156
|
var p = this.getCurLookaheadState();
|
|
6157
6157
|
if (this.setLookaheadState(a), m instanceof SyntaxError) return { node: null, error: m, thrown: !0, aborted: !1, failState: p };
|
|
6158
|
-
if (m ===
|
|
6158
|
+
if (m === c) return { node: c.node, error: null, thrown: !1, aborted: !0, failState: p };
|
|
6159
6159
|
throw m;
|
|
6160
6160
|
}
|
|
6161
6161
|
}, f.setOptionalParametersError = function(s, a) {
|
|
6162
|
-
var
|
|
6163
|
-
s.optionalParametersLoc = (
|
|
6162
|
+
var c;
|
|
6163
|
+
s.optionalParametersLoc = (c = a?.loc) != null ? c : this.startLoc;
|
|
6164
6164
|
}, f.reScan_lt_gt = function() {
|
|
6165
6165
|
this.type === o.relational && (this.pos -= 1, this.readToken_lt_gt(this.fullCharCodeAtPos()));
|
|
6166
6166
|
}, f.reScan_lt = function() {
|
|
@@ -6173,15 +6173,15 @@ function Fh(e) {
|
|
|
6173
6173
|
}, f.nextTokenStart = function() {
|
|
6174
6174
|
return this.nextTokenStartSince(this.pos);
|
|
6175
6175
|
}, f.tsHasSomeModifiers = function(s, a) {
|
|
6176
|
-
return a.some(function(
|
|
6177
|
-
return _r(
|
|
6176
|
+
return a.some(function(c) {
|
|
6177
|
+
return _r(c) ? s.accessibility === c : !!s[c];
|
|
6178
6178
|
});
|
|
6179
6179
|
}, f.tsIsStartOfStaticBlocks = function() {
|
|
6180
6180
|
return this.isContextual("static") && this.lookaheadCharCode() === 123;
|
|
6181
6181
|
}, f.tsCheckForInvalidTypeCasts = function(s) {
|
|
6182
6182
|
var a = this;
|
|
6183
|
-
s.forEach(function(
|
|
6184
|
-
|
|
6183
|
+
s.forEach(function(c) {
|
|
6184
|
+
c?.type === "TSTypeCastExpression" && a.raise(c.typeAnnotation.start, N.UnexpectedTypeAnnotation);
|
|
6185
6185
|
});
|
|
6186
6186
|
}, f.atPossibleAsyncArrow = function(s) {
|
|
6187
6187
|
return s.type === "Identifier" && s.name === "async" && this.lastTokEndLoc.column === s.end && !this.canInsertSemicolon() && s.end - s.start == 5 && s.start === this.potentialArrowAt;
|
|
@@ -6189,7 +6189,7 @@ function Fh(e) {
|
|
|
6189
6189
|
return q(this.type);
|
|
6190
6190
|
}, f.tsTryParseTypeOrTypePredicateAnnotation = function() {
|
|
6191
6191
|
return this.match(o.colon) ? this.tsParseTypeOrTypePredicateAnnotation(o.colon) : void 0;
|
|
6192
|
-
}, f.tsTryParseGenericAsyncArrowFunction = function(s, a,
|
|
6192
|
+
}, f.tsTryParseGenericAsyncArrowFunction = function(s, a, c) {
|
|
6193
6193
|
var p = this;
|
|
6194
6194
|
if (this.tsMatchLeftRelational()) {
|
|
6195
6195
|
var m = this.maybeInArrowParameters;
|
|
@@ -6198,7 +6198,7 @@ function Fh(e) {
|
|
|
6198
6198
|
var x = p.startNodeAt(s, a);
|
|
6199
6199
|
return x.typeParameters = p.tsParseTypeParameters(), P.prototype.parseFunctionParams.call(p, x), x.returnType = p.tsTryParseTypeOrTypePredicateAnnotation(), p.expect(o.arrow), x;
|
|
6200
6200
|
});
|
|
6201
|
-
if (this.maybeInArrowParameters = m, v) return P.prototype.parseArrowExpression.call(this, v, null, !0,
|
|
6201
|
+
if (this.maybeInArrowParameters = m, v) return P.prototype.parseArrowExpression.call(this, v, null, !0, c);
|
|
6202
6202
|
}
|
|
6203
6203
|
}, f.tsParseTypeArgumentsInExpression = function() {
|
|
6204
6204
|
if (this.reScan_lt() === o.relational) return this.tsParseTypeArguments();
|
|
@@ -6213,9 +6213,9 @@ function Fh(e) {
|
|
|
6213
6213
|
}, f.tsTryParseTypeAnnotation = function() {
|
|
6214
6214
|
return this.match(o.colon) ? this.tsParseTypeAnnotation() : void 0;
|
|
6215
6215
|
}, f.isUnparsedContextual = function(s, a) {
|
|
6216
|
-
var
|
|
6217
|
-
if (this.input.slice(s,
|
|
6218
|
-
var p = this.input.charCodeAt(
|
|
6216
|
+
var c = s + a.length;
|
|
6217
|
+
if (this.input.slice(s, c) === a) {
|
|
6218
|
+
var p = this.input.charCodeAt(c);
|
|
6219
6219
|
return !(pe(p) || (64512 & p) == 55296);
|
|
6220
6220
|
}
|
|
6221
6221
|
return !1;
|
|
@@ -6226,8 +6226,8 @@ function Fh(e) {
|
|
|
6226
6226
|
}, f.lookaheadCharCode = function() {
|
|
6227
6227
|
return this.input.charCodeAt(this.nextTokenStart());
|
|
6228
6228
|
}, f.compareLookaheadState = function(s, a) {
|
|
6229
|
-
for (var
|
|
6230
|
-
var m = p[
|
|
6229
|
+
for (var c = 0, p = Object.keys(s); c < p.length; c++) {
|
|
6230
|
+
var m = p[c];
|
|
6231
6231
|
if (s[m] !== a[m]) return !1;
|
|
6232
6232
|
}
|
|
6233
6233
|
return !0;
|
|
@@ -6240,11 +6240,11 @@ function Fh(e) {
|
|
|
6240
6240
|
}, f.setLookaheadState = function(s) {
|
|
6241
6241
|
this.pos = s.pos, this.value = s.value, this.endLoc = s.endLoc, this.lastTokEnd = s.lastTokEnd, this.lastTokStart = s.lastTokStart, this.lastTokStartLoc = s.lastTokStartLoc, this.type = s.type, this.start = s.start, this.end = s.end, this.context = s.context, this.startLoc = s.startLoc, this.lastTokEndLoc = s.lastTokEndLoc, this.curLine = s.curLine, this.lineStart = s.lineStart, this.curPosition = s.curPosition, this.containsEsc = s.containsEsc;
|
|
6242
6242
|
}, f.tsLookAhead = function(s) {
|
|
6243
|
-
var a = this.getCurLookaheadState(),
|
|
6244
|
-
return this.setLookaheadState(a),
|
|
6243
|
+
var a = this.getCurLookaheadState(), c = s();
|
|
6244
|
+
return this.setLookaheadState(a), c;
|
|
6245
6245
|
}, f.lookahead = function(s) {
|
|
6246
6246
|
var a = this.getCurLookaheadState();
|
|
6247
|
-
if (this.createLookaheadState(), this.isLookahead = !0, s !== void 0) for (var
|
|
6247
|
+
if (this.createLookaheadState(), this.isLookahead = !0, s !== void 0) for (var c = 0; c < s; c++) this.nextToken();
|
|
6248
6248
|
else this.nextToken();
|
|
6249
6249
|
this.isLookahead = !1;
|
|
6250
6250
|
var p = this.getCurLookaheadState();
|
|
@@ -6255,28 +6255,28 @@ function Fh(e) {
|
|
|
6255
6255
|
}, f.skipBlockComment = function() {
|
|
6256
6256
|
var s;
|
|
6257
6257
|
this.isLookahead || (s = this.options.onComment && this.curPosition());
|
|
6258
|
-
var a = this.pos,
|
|
6259
|
-
if (
|
|
6260
|
-
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(a + 2,
|
|
6258
|
+
var a = this.pos, c = this.input.indexOf("*/", this.pos += 2);
|
|
6259
|
+
if (c === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = c + 2, this.options.locations) for (var p, m = a; (p = Ds(this.input, m, this.pos)) > -1; ) ++this.curLine, m = this.lineStart = p;
|
|
6260
|
+
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(a + 2, c), a, this.pos, s, this.curPosition());
|
|
6261
6261
|
}, f.skipLineComment = function(s) {
|
|
6262
|
-
var a,
|
|
6262
|
+
var a, c = this.pos;
|
|
6263
6263
|
this.isLookahead || (a = this.options.onComment && this.curPosition());
|
|
6264
6264
|
for (var p = this.input.charCodeAt(this.pos += s); this.pos < this.input.length && !F(p); ) p = this.input.charCodeAt(++this.pos);
|
|
6265
|
-
this.isLookahead || this.options.onComment && this.options.onComment(!1, this.input.slice(
|
|
6265
|
+
this.isLookahead || this.options.onComment && this.options.onComment(!1, this.input.slice(c + s, this.pos), c, this.pos, a, this.curPosition());
|
|
6266
6266
|
}, f.finishToken = function(s, a) {
|
|
6267
6267
|
this.preValue = this.value, this.preToken = this.type, this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
6268
|
-
var
|
|
6269
|
-
this.type = s, this.value = a, this.isLookahead || this.updateContext(
|
|
6270
|
-
}, f.resetStartLocation = function(s, a,
|
|
6271
|
-
s.start = a, s.loc.start =
|
|
6268
|
+
var c = this.type;
|
|
6269
|
+
this.type = s, this.value = a, this.isLookahead || this.updateContext(c);
|
|
6270
|
+
}, f.resetStartLocation = function(s, a, c) {
|
|
6271
|
+
s.start = a, s.loc.start = c, this.options.ranges && (s.range[0] = a);
|
|
6272
6272
|
}, f.isLineTerminator = function() {
|
|
6273
6273
|
return this.eat(o.semi) || P.prototype.canInsertSemicolon.call(this);
|
|
6274
6274
|
}, f.hasFollowingLineBreak = function() {
|
|
6275
6275
|
return xr.lastIndex = this.end, xr.test(this.input);
|
|
6276
|
-
}, f.addExtra = function(s, a,
|
|
6276
|
+
}, f.addExtra = function(s, a, c, p) {
|
|
6277
6277
|
if (p === void 0 && (p = !0), s) {
|
|
6278
6278
|
var m = s.extra = s.extra || {};
|
|
6279
|
-
p ? m[a] =
|
|
6279
|
+
p ? m[a] = c : Object.defineProperty(m, a, { enumerable: p, value: c });
|
|
6280
6280
|
}
|
|
6281
6281
|
}, f.isLiteralPropertyName = function() {
|
|
6282
6282
|
return Ae(this.type);
|
|
@@ -6315,21 +6315,21 @@ function Fh(e) {
|
|
|
6315
6315
|
return this.type === s;
|
|
6316
6316
|
}, f.matchJsx = function(s) {
|
|
6317
6317
|
return this.type === y.tokTypes[s];
|
|
6318
|
-
}, f.ts_eatWithState = function(s, a,
|
|
6319
|
-
if (s ===
|
|
6318
|
+
}, f.ts_eatWithState = function(s, a, c) {
|
|
6319
|
+
if (s === c.type) {
|
|
6320
6320
|
for (var p = 0; p < a; p++) this.next();
|
|
6321
6321
|
return !0;
|
|
6322
6322
|
}
|
|
6323
6323
|
return !1;
|
|
6324
|
-
}, f.ts_eatContextualWithState = function(s, a,
|
|
6324
|
+
}, f.ts_eatContextualWithState = function(s, a, c) {
|
|
6325
6325
|
if (ft.test(s)) {
|
|
6326
|
-
if (this.ts_isContextualWithState(
|
|
6326
|
+
if (this.ts_isContextualWithState(c, D[s])) {
|
|
6327
6327
|
for (var p = 0; p < a; p++) this.next();
|
|
6328
6328
|
return !0;
|
|
6329
6329
|
}
|
|
6330
6330
|
return !1;
|
|
6331
6331
|
}
|
|
6332
|
-
if (!this.isContextualWithState(s,
|
|
6332
|
+
if (!this.isContextualWithState(s, c)) return !1;
|
|
6333
6333
|
for (var m = 0; m < a; m++) this.next();
|
|
6334
6334
|
return !0;
|
|
6335
6335
|
}, f.canHaveLeadingDecorator = function() {
|
|
@@ -6344,8 +6344,8 @@ function Fh(e) {
|
|
|
6344
6344
|
}, f.tsParseEntityName = function(s) {
|
|
6345
6345
|
s === void 0 && (s = !0);
|
|
6346
6346
|
for (var a = this.parseIdent(s); this.eat(o.dot); ) {
|
|
6347
|
-
var
|
|
6348
|
-
|
|
6347
|
+
var c = this.startNodeAtNode(a);
|
|
6348
|
+
c.left = a, c.right = this.parseIdent(s), a = this.finishNode(c, "TSQualifiedName");
|
|
6349
6349
|
}
|
|
6350
6350
|
return a;
|
|
6351
6351
|
}, f.tsParseEnumMember = function() {
|
|
@@ -6365,13 +6365,13 @@ function Fh(e) {
|
|
|
6365
6365
|
}, f.tsTryParseDeclare = function(s) {
|
|
6366
6366
|
var a = this;
|
|
6367
6367
|
if (!this.isLineTerminator()) {
|
|
6368
|
-
var
|
|
6369
|
-
return this.isContextual("let") && (p = o._var,
|
|
6368
|
+
var c, p = this.type;
|
|
6369
|
+
return this.isContextual("let") && (p = o._var, c = "let"), this.tsInAmbientContext(function() {
|
|
6370
6370
|
if (p === o._function) return s.declare = !0, a.parseFunctionStatement(s, !1, !0);
|
|
6371
6371
|
if (p === o._class) return s.declare = !0, a.parseClass(s, !0);
|
|
6372
6372
|
if (p === D.enum) return a.tsParseEnumDeclaration(s, { declare: !0 });
|
|
6373
6373
|
if (p === D.global) return a.tsParseAmbientExternalModuleDeclaration(s);
|
|
6374
|
-
if (p === o._const || p === o._var) return a.match(o._const) && a.isLookaheadContextual("enum") ? (a.expect(o._const), a.tsParseEnumDeclaration(s, { const: !0, declare: !0 })) : (s.declare = !0, a.parseVarStatement(s,
|
|
6374
|
+
if (p === o._const || p === o._var) return a.match(o._const) && a.isLookaheadContextual("enum") ? (a.expect(o._const), a.tsParseEnumDeclaration(s, { const: !0, declare: !0 })) : (s.declare = !0, a.parseVarStatement(s, c || a.value, !0));
|
|
6375
6375
|
if (p === D.interface) {
|
|
6376
6376
|
var m = a.tsParseInterfaceDeclaration(s, { declare: !0 });
|
|
6377
6377
|
if (m) return m;
|
|
@@ -6391,27 +6391,27 @@ function Fh(e) {
|
|
|
6391
6391
|
case "TypeParametersOrArguments":
|
|
6392
6392
|
return this.tsMatchRightRelational();
|
|
6393
6393
|
}
|
|
6394
|
-
}, f.tsParseDelimitedListWorker = function(s, a,
|
|
6394
|
+
}, f.tsParseDelimitedListWorker = function(s, a, c, p) {
|
|
6395
6395
|
for (var m = [], v = -1; !this.tsIsListTerminator(s); ) {
|
|
6396
6396
|
v = -1;
|
|
6397
6397
|
var x = a();
|
|
6398
6398
|
if (x == null) return;
|
|
6399
6399
|
if (m.push(x), !this.eat(o.comma)) {
|
|
6400
6400
|
if (this.tsIsListTerminator(s)) break;
|
|
6401
|
-
return void (
|
|
6401
|
+
return void (c && this.expect(o.comma));
|
|
6402
6402
|
}
|
|
6403
6403
|
v = this.lastTokStart;
|
|
6404
6404
|
}
|
|
6405
6405
|
return p && (p.value = v), m;
|
|
6406
|
-
}, f.tsParseDelimitedList = function(s, a,
|
|
6406
|
+
}, f.tsParseDelimitedList = function(s, a, c) {
|
|
6407
6407
|
return (function(p) {
|
|
6408
6408
|
if (p == null) throw new Error("Unexpected " + p + " value.");
|
|
6409
6409
|
return p;
|
|
6410
|
-
})(this.tsParseDelimitedListWorker(s, a, !0,
|
|
6411
|
-
}, f.tsParseBracketedList = function(s, a,
|
|
6412
|
-
p || this.expect(
|
|
6410
|
+
})(this.tsParseDelimitedListWorker(s, a, !0, c));
|
|
6411
|
+
}, f.tsParseBracketedList = function(s, a, c, p, m) {
|
|
6412
|
+
p || this.expect(c ? o.bracketL : o.relational);
|
|
6413
6413
|
var v = this.tsParseDelimitedList(s, a, m);
|
|
6414
|
-
return this.expect(
|
|
6414
|
+
return this.expect(c ? o.bracketR : o.relational), v;
|
|
6415
6415
|
}, f.tsParseTypeParameterName = function() {
|
|
6416
6416
|
return this.parseIdent().name;
|
|
6417
6417
|
}, f.tsEatThenParseType = function(s) {
|
|
@@ -6472,9 +6472,9 @@ function Fh(e) {
|
|
|
6472
6472
|
var s = this.startNode();
|
|
6473
6473
|
return this.next(), this.finishNode(s, "TSThisType");
|
|
6474
6474
|
}, f.tsParseTypeAnnotation = function(s, a) {
|
|
6475
|
-
var
|
|
6475
|
+
var c = this;
|
|
6476
6476
|
return s === void 0 && (s = !0), a === void 0 && (a = this.startNode()), this.tsInType(function() {
|
|
6477
|
-
s &&
|
|
6477
|
+
s && c.expect(o.colon), a.typeAnnotation = c.tsParseType();
|
|
6478
6478
|
}), this.finishNode(a, "TSTypeAnnotation");
|
|
6479
6479
|
}, f.tsParseThisTypePredicate = function(s) {
|
|
6480
6480
|
this.next();
|
|
@@ -6489,36 +6489,36 @@ function Fh(e) {
|
|
|
6489
6489
|
}, f.tsParseTypeOrTypePredicateAnnotation = function(s) {
|
|
6490
6490
|
var a = this;
|
|
6491
6491
|
return this.tsInType(function() {
|
|
6492
|
-
var
|
|
6492
|
+
var c = a.startNode();
|
|
6493
6493
|
a.expect(s);
|
|
6494
6494
|
var p = a.startNode(), m = !!a.tsTryParse(a.tsParseTypePredicateAsserts.bind(a));
|
|
6495
6495
|
if (m && a.match(o._this)) {
|
|
6496
6496
|
var v = a.tsParseThisTypeOrThisTypePredicate();
|
|
6497
|
-
return v.type === "TSThisType" ? (p.parameterName = v, p.asserts = !0, p.typeAnnotation = null, v = a.finishNode(p, "TSTypePredicate")) : (a.resetStartLocationFromNode(v, p), v.asserts = !0),
|
|
6497
|
+
return v.type === "TSThisType" ? (p.parameterName = v, p.asserts = !0, p.typeAnnotation = null, v = a.finishNode(p, "TSTypePredicate")) : (a.resetStartLocationFromNode(v, p), v.asserts = !0), c.typeAnnotation = v, a.finishNode(c, "TSTypeAnnotation");
|
|
6498
6498
|
}
|
|
6499
6499
|
var x = a.tsIsIdentifier() && a.tsTryParse(a.tsParseTypePredicatePrefix.bind(a));
|
|
6500
|
-
if (!x) return m ? (p.parameterName = a.parseIdent(), p.asserts = m, p.typeAnnotation = null,
|
|
6500
|
+
if (!x) return m ? (p.parameterName = a.parseIdent(), p.asserts = m, p.typeAnnotation = null, c.typeAnnotation = a.finishNode(p, "TSTypePredicate"), a.finishNode(c, "TSTypeAnnotation")) : a.tsParseTypeAnnotation(!1, c);
|
|
6501
6501
|
var g = a.tsParseTypeAnnotation(!1);
|
|
6502
|
-
return p.parameterName = x, p.typeAnnotation = g, p.asserts = m,
|
|
6502
|
+
return p.parameterName = x, p.typeAnnotation = g, p.asserts = m, c.typeAnnotation = a.finishNode(p, "TSTypePredicate"), a.finishNode(c, "TSTypeAnnotation");
|
|
6503
6503
|
});
|
|
6504
6504
|
}, f.tsFillSignature = function(s, a) {
|
|
6505
|
-
var
|
|
6506
|
-
a.typeParameters = this.tsTryParseTypeParameters(), this.expect(o.parenL), a.parameters = this.tsParseBindingListForSignature(), (
|
|
6505
|
+
var c = s === o.arrow;
|
|
6506
|
+
a.typeParameters = this.tsTryParseTypeParameters(), this.expect(o.parenL), a.parameters = this.tsParseBindingListForSignature(), (c || this.match(s)) && (a.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(s));
|
|
6507
6507
|
}, f.tsTryNextParseConstantContext = function() {
|
|
6508
6508
|
if (this.lookahead().type !== o._const) return null;
|
|
6509
6509
|
this.next();
|
|
6510
6510
|
var s = this.tsParseTypeReference();
|
|
6511
6511
|
return s.typeParameters && this.raise(s.typeName.start, N.CannotFindName({ name: "const" })), s;
|
|
6512
6512
|
}, f.tsParseFunctionOrConstructorType = function(s, a) {
|
|
6513
|
-
var
|
|
6513
|
+
var c = this, p = this.startNode();
|
|
6514
6514
|
return s === "TSConstructorType" && (p.abstract = !!a, a && this.next(), this.next()), this.tsInAllowConditionalTypesContext(function() {
|
|
6515
|
-
return
|
|
6515
|
+
return c.tsFillSignature(o.arrow, p);
|
|
6516
6516
|
}), this.finishNode(p, s);
|
|
6517
|
-
}, f.tsParseUnionOrIntersectionType = function(s, a,
|
|
6518
|
-
var p = this.startNode(), m = this.eat(
|
|
6517
|
+
}, f.tsParseUnionOrIntersectionType = function(s, a, c) {
|
|
6518
|
+
var p = this.startNode(), m = this.eat(c), v = [];
|
|
6519
6519
|
do
|
|
6520
6520
|
v.push(a());
|
|
6521
|
-
while (this.eat(
|
|
6521
|
+
while (this.eat(c));
|
|
6522
6522
|
return v.length !== 1 || m ? (p.types = v, this.finishNode(p, s)) : v[0];
|
|
6523
6523
|
}, f.tsCheckTypeAnnotationForReadOnly = function(s) {
|
|
6524
6524
|
switch (s.typeAnnotation.type) {
|
|
@@ -6542,10 +6542,10 @@ function Fh(e) {
|
|
|
6542
6542
|
}, f.tsParseInferType = function() {
|
|
6543
6543
|
var s = this, a = this.startNode();
|
|
6544
6544
|
this.expectContextual("infer");
|
|
6545
|
-
var
|
|
6546
|
-
return
|
|
6545
|
+
var c = this.startNode();
|
|
6546
|
+
return c.name = this.tsParseTypeParameterName(), c.constraint = this.tsTryParse(function() {
|
|
6547
6547
|
return s.tsParseConstraintForInferType();
|
|
6548
|
-
}), a.typeParameter = this.finishNode(
|
|
6548
|
+
}), a.typeParameter = this.finishNode(c, "TSTypeParameter"), this.finishNode(a, "TSInferType");
|
|
6549
6549
|
}, f.tsParseLiteralTypeNode = function() {
|
|
6550
6550
|
var s = this, a = this.startNode();
|
|
6551
6551
|
return a.literal = (function() {
|
|
@@ -6575,7 +6575,7 @@ function Fh(e) {
|
|
|
6575
6575
|
var s = this.startNode();
|
|
6576
6576
|
return s.members = this.tsParseObjectTypeMembers(), this.finishNode(s, "TSTypeLiteral");
|
|
6577
6577
|
}, f.tsParseTupleElementType = function() {
|
|
6578
|
-
var s = this.startLoc, a = this.start,
|
|
6578
|
+
var s = this.startLoc, a = this.start, c = this.eat(o.ellipsis), p = this.tsParseType(), m = this.eat(o.question);
|
|
6579
6579
|
if (this.eat(o.colon)) {
|
|
6580
6580
|
var v = this.startNodeAtNode(p);
|
|
6581
6581
|
v.optional = m, p.type !== "TSTypeReference" || p.typeParameters || p.typeName.type !== "Identifier" ? (this.raise(p.start, N.InvalidTupleMemberLabel), v.label = p) : v.label = p.typeName, v.elementType = this.tsParseType(), p = this.finishNode(v, "TSNamedTupleMember");
|
|
@@ -6583,7 +6583,7 @@ function Fh(e) {
|
|
|
6583
6583
|
var x = this.startNodeAtNode(p);
|
|
6584
6584
|
x.typeAnnotation = p, p = this.finishNode(x, "TSOptionalType");
|
|
6585
6585
|
}
|
|
6586
|
-
if (
|
|
6586
|
+
if (c) {
|
|
6587
6587
|
var g = this.startNodeAt(a, s);
|
|
6588
6588
|
g.typeAnnotation = p, p = this.finishNode(g, "TSRestType");
|
|
6589
6589
|
}
|
|
@@ -6591,10 +6591,10 @@ function Fh(e) {
|
|
|
6591
6591
|
}, f.tsParseTupleType = function() {
|
|
6592
6592
|
var s = this, a = this.startNode();
|
|
6593
6593
|
a.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), !0, !1);
|
|
6594
|
-
var
|
|
6594
|
+
var c = !1, p = null;
|
|
6595
6595
|
return a.elementTypes.forEach(function(m) {
|
|
6596
6596
|
var v = m.type;
|
|
6597
|
-
!
|
|
6597
|
+
!c || v === "TSRestType" || v === "TSOptionalType" || v === "TSNamedTupleMember" && m.optional || s.raise(m.start, N.OptionalTypeBeforeRequired), c || (c = v === "TSNamedTupleMember" && m.optional || v === "TSOptionalType");
|
|
6598
6598
|
var x = v;
|
|
6599
6599
|
v === "TSRestType" && (x = (m = m.typeAnnotation).type);
|
|
6600
6600
|
var g = x === "TSNamedTupleMember";
|
|
@@ -6644,7 +6644,7 @@ function Fh(e) {
|
|
|
6644
6644
|
default:
|
|
6645
6645
|
var a = this.type;
|
|
6646
6646
|
if (q(a) || a === o._void || a === o._null) {
|
|
6647
|
-
var
|
|
6647
|
+
var c = a === o._void ? "TSVoidKeyword" : a === o._null ? "TSNullKeyword" : (function(m) {
|
|
6648
6648
|
switch (m) {
|
|
6649
6649
|
case "any":
|
|
6650
6650
|
return "TSAnyKeyword";
|
|
@@ -6670,9 +6670,9 @@ function Fh(e) {
|
|
|
6670
6670
|
return;
|
|
6671
6671
|
}
|
|
6672
6672
|
})(this.value);
|
|
6673
|
-
if (
|
|
6673
|
+
if (c !== void 0 && this.lookaheadCharCode() !== 46) {
|
|
6674
6674
|
var p = this.startNode();
|
|
6675
|
-
return this.next(), this.finishNode(p,
|
|
6675
|
+
return this.next(), this.finishNode(p, c);
|
|
6676
6676
|
}
|
|
6677
6677
|
return this.tsParseTypeReference();
|
|
6678
6678
|
}
|
|
@@ -6683,8 +6683,8 @@ function Fh(e) {
|
|
|
6683
6683
|
var a = this.startNodeAtNode(s);
|
|
6684
6684
|
a.elementType = s, this.expect(o.bracketR), s = this.finishNode(a, "TSArrayType");
|
|
6685
6685
|
} else {
|
|
6686
|
-
var
|
|
6687
|
-
|
|
6686
|
+
var c = this.startNodeAtNode(s);
|
|
6687
|
+
c.objectType = s, c.indexType = this.tsParseType(), this.expect(o.bracketR), s = this.finishNode(c, "TSIndexedAccessType");
|
|
6688
6688
|
}
|
|
6689
6689
|
return s;
|
|
6690
6690
|
}, f.tsParseTypeOperatorOrHigher = function() {
|
|
@@ -6703,14 +6703,14 @@ function Fh(e) {
|
|
|
6703
6703
|
br(this.inType);
|
|
6704
6704
|
var a = this.tsParseNonConditionalType();
|
|
6705
6705
|
if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(o._extends)) return a;
|
|
6706
|
-
var
|
|
6707
|
-
return
|
|
6706
|
+
var c = this.startNodeAtNode(a);
|
|
6707
|
+
return c.checkType = a, c.extendsType = this.tsInDisallowConditionalTypesContext(function() {
|
|
6708
6708
|
return s.tsParseNonConditionalType();
|
|
6709
|
-
}), this.expect(o.question),
|
|
6709
|
+
}), this.expect(o.question), c.trueType = this.tsInAllowConditionalTypesContext(function() {
|
|
6710
6710
|
return s.tsParseType();
|
|
6711
|
-
}), this.expect(o.colon),
|
|
6711
|
+
}), this.expect(o.colon), c.falseType = this.tsInAllowConditionalTypesContext(function() {
|
|
6712
6712
|
return s.tsParseType();
|
|
6713
|
-
}), this.finishNode(
|
|
6713
|
+
}), this.finishNode(c, "TSConditionalType");
|
|
6714
6714
|
}, f.tsIsUnambiguouslyIndexSignature = function() {
|
|
6715
6715
|
return this.next(), !!q(this.type) && (this.next(), this.match(o.colon));
|
|
6716
6716
|
}, f.tsInType = function(s) {
|
|
@@ -6726,8 +6726,8 @@ function Fh(e) {
|
|
|
6726
6726
|
this.expect(o.bracketL);
|
|
6727
6727
|
var a = this.parseIdent();
|
|
6728
6728
|
a.typeAnnotation = this.tsParseTypeAnnotation(), this.resetEndLocation(a), this.expect(o.bracketR), s.parameters = [a];
|
|
6729
|
-
var
|
|
6730
|
-
return
|
|
6729
|
+
var c = this.tsTryParseTypeAnnotation();
|
|
6730
|
+
return c && (s.typeAnnotation = c), this.tsParseTypeMemberSemicolon(), this.finishNode(s, "TSIndexSignature");
|
|
6731
6731
|
}
|
|
6732
6732
|
}, f.tsParseNoneModifiers = function(s) {
|
|
6733
6733
|
this.tsParseModifiers({ modified: s, allowedModifiers: [], disallowedModifiers: ["in", "out"], errorTemplate: N.InvalidModifierOnTypeParameterPositions });
|
|
@@ -6738,39 +6738,39 @@ function Fh(e) {
|
|
|
6738
6738
|
}, f.tsParseTypeParameters = function(s) {
|
|
6739
6739
|
var a = this.startNode();
|
|
6740
6740
|
this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart") ? this.next() : this.unexpected();
|
|
6741
|
-
var
|
|
6742
|
-
return a.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, s), !1, !0,
|
|
6741
|
+
var c = { value: -1 };
|
|
6742
|
+
return a.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, s), !1, !0, c), a.params.length === 0 && this.raise(this.start, N.EmptyTypeParameters), c.value !== -1 && this.addExtra(a, "trailingComma", c.value), this.finishNode(a, "TSTypeParameterDeclaration");
|
|
6743
6743
|
}, f.tsTryParseTypeParameters = function(s) {
|
|
6744
6744
|
if (this.tsMatchLeftRelational()) return this.tsParseTypeParameters(s);
|
|
6745
6745
|
}, f.tsTryParse = function(s) {
|
|
6746
|
-
var a = this.getCurLookaheadState(),
|
|
6747
|
-
return
|
|
6746
|
+
var a = this.getCurLookaheadState(), c = s();
|
|
6747
|
+
return c !== void 0 && c !== !1 ? c : void this.setLookaheadState(a);
|
|
6748
6748
|
}, f.tsTokenCanFollowModifier = function() {
|
|
6749
6749
|
return (this.match(o.bracketL) || this.match(o.braceL) || this.match(o.star) || this.match(o.ellipsis) || this.match(o.privateId) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
|
|
6750
6750
|
}, f.tsNextTokenCanFollowModifier = function() {
|
|
6751
6751
|
return this.next(!0), this.tsTokenCanFollowModifier();
|
|
6752
6752
|
}, f.tsParseModifier = function(s, a) {
|
|
6753
6753
|
if (q(this.type) || this.type === o._in) {
|
|
6754
|
-
var
|
|
6755
|
-
if (s.indexOf(
|
|
6754
|
+
var c = this.value;
|
|
6755
|
+
if (s.indexOf(c) !== -1 && !this.containsEsc) {
|
|
6756
6756
|
if (a && this.tsIsStartOfStaticBlocks()) return;
|
|
6757
|
-
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) return
|
|
6757
|
+
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) return c;
|
|
6758
6758
|
}
|
|
6759
6759
|
}
|
|
6760
6760
|
}, f.tsParseModifiersByMap = function(s) {
|
|
6761
|
-
for (var a = s.modified,
|
|
6761
|
+
for (var a = s.modified, c = s.map, p = 0, m = Object.keys(c); p < m.length; p++) {
|
|
6762
6762
|
var v = m[p];
|
|
6763
|
-
a[v] =
|
|
6763
|
+
a[v] = c[v];
|
|
6764
6764
|
}
|
|
6765
6765
|
}, f.tsParseModifiers = function(s) {
|
|
6766
|
-
for (var a = this,
|
|
6767
|
-
G === X &&
|
|
6766
|
+
for (var a = this, c = s.modified, p = s.allowedModifiers, m = s.disallowedModifiers, v = s.stopOnStartOfClassStaticBlock, x = s.errorTemplate, g = x === void 0 ? N.InvalidModifierOnTypeMember : x, _ = {}, T = function(K, G, X, re) {
|
|
6767
|
+
G === X && c[re] && a.raise(K.column, N.InvalidModifiersOrder({ orderedModifiers: [X, re] }));
|
|
6768
6768
|
}, L = function(K, G, X, re) {
|
|
6769
|
-
(
|
|
6769
|
+
(c[X] && G === re || c[re] && G === X) && a.raise(K.column, N.IncompatibleModifiers({ modifiers: [X, re] }));
|
|
6770
6770
|
}; ; ) {
|
|
6771
6771
|
var V = this.startLoc, E = this.tsParseModifier(p.concat(m ?? []), v);
|
|
6772
6772
|
if (!E) break;
|
|
6773
|
-
_r(E) ?
|
|
6773
|
+
_r(E) ? c.accessibility ? this.raise(this.start, N.DuplicateAccessibilityModifier()) : (T(V, E, E, "override"), T(V, E, E, "static"), T(V, E, E, "readonly"), T(V, E, E, "accessor"), _.accessibility = E, c.accessibility = E) : zh(E) ? c[E] ? this.raise(this.start, N.DuplicateModifier({ modifier: E })) : (T(V, E, "in", "out"), _[E] = E, c[E] = !0) : Vh(E) ? c[E] ? this.raise(this.start, N.DuplicateModifier({ modifier: E })) : (L(V, E, "accessor", "readonly"), L(V, E, "accessor", "static"), L(V, E, "accessor", "override"), _[E] = E, c[E] = !0) : Object.hasOwnProperty.call(c, E) ? this.raise(this.start, N.DuplicateModifier({ modifier: E })) : (T(V, E, "static", "readonly"), T(V, E, "static", "override"), T(V, E, "override", "readonly"), T(V, E, "abstract", "override"), L(V, E, "declare", "override"), L(V, E, "static", "abstract"), _[E] = E, c[E] = !0), m != null && m.includes(E) && this.raise(this.start, g);
|
|
6774
6774
|
}
|
|
6775
6775
|
return _;
|
|
6776
6776
|
}, f.tsParseInOutModifiers = function(s) {
|
|
@@ -6783,26 +6783,26 @@ function Fh(e) {
|
|
|
6783
6783
|
});
|
|
6784
6784
|
}), a.params.length === 0 && this.raise(this.start, N.EmptyTypeArguments), this.exprAllowed = !1, this.expect(o.relational), this.finishNode(a, "TSTypeParameterInstantiation");
|
|
6785
6785
|
}, f.tsParseHeritageClause = function(s) {
|
|
6786
|
-
var a = this,
|
|
6786
|
+
var a = this, c = this.start, p = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
6787
6787
|
var m = a.startNode();
|
|
6788
6788
|
return m.expression = a.tsParseEntityName(), a.tsMatchLeftRelational() && (m.typeParameters = a.tsParseTypeArguments()), a.finishNode(m, "TSExpressionWithTypeArguments");
|
|
6789
6789
|
});
|
|
6790
|
-
return p.length || this.raise(
|
|
6790
|
+
return p.length || this.raise(c, N.EmptyHeritageClauseType({ token: s })), p;
|
|
6791
6791
|
}, f.tsParseTypeMemberSemicolon = function() {
|
|
6792
6792
|
this.eat(o.comma) || this.isLineTerminator() || this.expect(o.semi);
|
|
6793
6793
|
}, f.tsTryParseAndCatch = function(s) {
|
|
6794
|
-
var a = this.tryParse(function(
|
|
6795
|
-
return s() ||
|
|
6794
|
+
var a = this.tryParse(function(c) {
|
|
6795
|
+
return s() || c();
|
|
6796
6796
|
});
|
|
6797
6797
|
if (!a.aborted && a.node) return a.error && this.setLookaheadState(a.failState), a.node;
|
|
6798
6798
|
}, f.tsParseSignatureMember = function(s, a) {
|
|
6799
6799
|
return this.tsFillSignature(o.colon, a), this.tsParseTypeMemberSemicolon(), this.finishNode(a, s);
|
|
6800
6800
|
}, f.tsParsePropertyOrMethodSignature = function(s, a) {
|
|
6801
6801
|
this.eat(o.question) && (s.optional = !0);
|
|
6802
|
-
var
|
|
6802
|
+
var c = s;
|
|
6803
6803
|
if (this.match(o.parenL) || this.tsMatchLeftRelational()) {
|
|
6804
6804
|
a && this.raise(s.start, N.ReadonlyForMethodSignature);
|
|
6805
|
-
var p =
|
|
6805
|
+
var p = c;
|
|
6806
6806
|
p.kind && this.tsMatchLeftRelational() && this.raise(this.start, N.AccesorCannotHaveTypeParameters), this.tsFillSignature(o.colon, p), this.tsParseTypeMemberSemicolon();
|
|
6807
6807
|
var m = "parameters", v = "typeAnnotation";
|
|
6808
6808
|
if (p.kind === "get") p[m].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(p[m][0]) && this.raise(this.start, N.AccesorCannotDeclareThisParameter));
|
|
@@ -6816,7 +6816,7 @@ function Fh(e) {
|
|
|
6816
6816
|
} else p.kind = "method";
|
|
6817
6817
|
return this.finishNode(p, "TSMethodSignature");
|
|
6818
6818
|
}
|
|
6819
|
-
var g =
|
|
6819
|
+
var g = c;
|
|
6820
6820
|
a && (g.readonly = !0);
|
|
6821
6821
|
var _ = this.tsTryParseTypeAnnotation();
|
|
6822
6822
|
return _ && (g.typeAnnotation = _), this.tsParseTypeMemberSemicolon(), this.finishNode(g, "TSPropertySignature");
|
|
@@ -6829,8 +6829,8 @@ function Fh(e) {
|
|
|
6829
6829
|
}
|
|
6830
6830
|
return this.tsParseModifiers({ modified: s, allowedModifiers: ["readonly"], disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] }), this.tsTryParseIndexSignature(s) || (this.parsePropertyName(s), s.computed || s.key.type !== "Identifier" || s.key.name !== "get" && s.key.name !== "set" || !this.tsTokenCanFollowModifier() || (s.kind = s.key.name, this.parsePropertyName(s)), this.tsParsePropertyOrMethodSignature(s, !!s.readonly));
|
|
6831
6831
|
}, f.tsParseList = function(s, a) {
|
|
6832
|
-
for (var
|
|
6833
|
-
return
|
|
6832
|
+
for (var c = []; !this.tsIsListTerminator(s); ) c.push(a());
|
|
6833
|
+
return c;
|
|
6834
6834
|
}, f.tsParseObjectTypeMembers = function() {
|
|
6835
6835
|
this.expect(o.braceL);
|
|
6836
6836
|
var s = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
|
|
@@ -6838,8 +6838,8 @@ function Fh(e) {
|
|
|
6838
6838
|
}, f.tsParseInterfaceDeclaration = function(s, a) {
|
|
6839
6839
|
if (a === void 0 && (a = {}), this.hasFollowingLineBreak()) return null;
|
|
6840
6840
|
this.expectContextual("interface"), a.declare && (s.declare = !0), q(this.type) ? (s.id = this.parseIdent(), this.checkLValSimple(s.id, 7)) : (s.id = null, this.raise(this.start, N.MissingInterfaceName)), s.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)), this.eat(o._extends) && (s.extends = this.tsParseHeritageClause("extends"));
|
|
6841
|
-
var
|
|
6842
|
-
return
|
|
6841
|
+
var c = this.startNode();
|
|
6842
|
+
return c.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), s.body = this.finishNode(c, "TSInterfaceBody"), this.finishNode(s, "TSInterfaceDeclaration");
|
|
6843
6843
|
}, f.tsParseAbstractDeclaration = function(s) {
|
|
6844
6844
|
if (this.match(o._class)) return s.abstract = !0, this.parseClass(s, !0);
|
|
6845
6845
|
if (this.ts_isContextual(D.interface)) {
|
|
@@ -6850,8 +6850,8 @@ function Fh(e) {
|
|
|
6850
6850
|
}, f.tsParseExpressionStatement = function(s, a) {
|
|
6851
6851
|
switch (a.name) {
|
|
6852
6852
|
case "declare":
|
|
6853
|
-
var
|
|
6854
|
-
if (
|
|
6853
|
+
var c = this.tsTryParseDeclare(s);
|
|
6854
|
+
if (c) return c.declare = !0, c;
|
|
6855
6855
|
break;
|
|
6856
6856
|
case "global":
|
|
6857
6857
|
if (this.match(o.braceL)) {
|
|
@@ -6866,9 +6866,9 @@ function Fh(e) {
|
|
|
6866
6866
|
}, f.tsParseModuleReference = function() {
|
|
6867
6867
|
return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(!1);
|
|
6868
6868
|
}, f.tsIsExportDefaultSpecifier = function() {
|
|
6869
|
-
var s = this.type, a = this.isAsyncFunction(),
|
|
6869
|
+
var s = this.type, a = this.isAsyncFunction(), c = this.isLet();
|
|
6870
6870
|
if (q(s)) {
|
|
6871
|
-
if (a && !this.containsEsc ||
|
|
6871
|
+
if (a && !this.containsEsc || c) return !1;
|
|
6872
6872
|
if ((s === D.type || s === D.interface) && !this.containsEsc) {
|
|
6873
6873
|
var p = this.lookahead();
|
|
6874
6874
|
if (q(p.type) && !this.isContextualWithState("from", p) || p.type === o.braceL) return !1;
|
|
@@ -6893,44 +6893,44 @@ function Fh(e) {
|
|
|
6893
6893
|
return s ? !this.hasFollowingLineBreak() && (this.next(), !0) : !this.isLineTerminator();
|
|
6894
6894
|
}, f.tsParseModuleOrNamespaceDeclaration = function(s, a) {
|
|
6895
6895
|
if (a === void 0 && (a = !1), s.id = this.parseIdent(), a || this.checkLValSimple(s.id, 8), this.eat(o.dot)) {
|
|
6896
|
-
var
|
|
6897
|
-
this.tsParseModuleOrNamespaceDeclaration(
|
|
6896
|
+
var c = this.startNode();
|
|
6897
|
+
this.tsParseModuleOrNamespaceDeclaration(c, !0), s.body = c;
|
|
6898
6898
|
} else P.prototype.enterScope.call(this, yt), s.body = this.tsParseModuleBlock(), P.prototype.exitScope.call(this);
|
|
6899
6899
|
return this.finishNode(s, "TSModuleDeclaration");
|
|
6900
|
-
}, f.checkLValSimple = function(s, a,
|
|
6901
|
-
return a === void 0 && (a = 0), P.prototype.checkLValSimple.call(this, s, a,
|
|
6900
|
+
}, f.checkLValSimple = function(s, a, c) {
|
|
6901
|
+
return a === void 0 && (a = 0), P.prototype.checkLValSimple.call(this, s, a, c);
|
|
6902
6902
|
}, f.tsParseTypeAliasDeclaration = function(s) {
|
|
6903
6903
|
var a = this;
|
|
6904
6904
|
return s.id = this.parseIdent(), this.checkLValSimple(s.id, 6), s.typeAnnotation = this.tsInType(function() {
|
|
6905
6905
|
if (s.typeParameters = a.tsTryParseTypeParameters(a.tsParseInOutModifiers.bind(a)), a.expect(o.eq), a.ts_isContextual(D.interface) && a.lookahead().type !== o.dot) {
|
|
6906
|
-
var
|
|
6907
|
-
return a.next(), a.finishNode(
|
|
6906
|
+
var c = a.startNode();
|
|
6907
|
+
return a.next(), a.finishNode(c, "TSIntrinsicKeyword");
|
|
6908
6908
|
}
|
|
6909
6909
|
return a.tsParseType();
|
|
6910
6910
|
}), this.semicolon(), this.finishNode(s, "TSTypeAliasDeclaration");
|
|
6911
|
-
}, f.tsParseDeclaration = function(s, a,
|
|
6911
|
+
}, f.tsParseDeclaration = function(s, a, c) {
|
|
6912
6912
|
switch (a) {
|
|
6913
6913
|
case "abstract":
|
|
6914
|
-
if (this.tsCheckLineTerminator(
|
|
6914
|
+
if (this.tsCheckLineTerminator(c) && (this.match(o._class) || q(this.type))) return this.tsParseAbstractDeclaration(s);
|
|
6915
6915
|
break;
|
|
6916
6916
|
case "module":
|
|
6917
|
-
if (this.tsCheckLineTerminator(
|
|
6917
|
+
if (this.tsCheckLineTerminator(c)) {
|
|
6918
6918
|
if (this.match(o.string)) return this.tsParseAmbientExternalModuleDeclaration(s);
|
|
6919
6919
|
if (q(this.type)) return this.tsParseModuleOrNamespaceDeclaration(s);
|
|
6920
6920
|
}
|
|
6921
6921
|
break;
|
|
6922
6922
|
case "namespace":
|
|
6923
|
-
if (this.tsCheckLineTerminator(
|
|
6923
|
+
if (this.tsCheckLineTerminator(c) && q(this.type)) return this.tsParseModuleOrNamespaceDeclaration(s);
|
|
6924
6924
|
break;
|
|
6925
6925
|
case "type":
|
|
6926
|
-
if (this.tsCheckLineTerminator(
|
|
6926
|
+
if (this.tsCheckLineTerminator(c) && q(this.type)) return this.tsParseTypeAliasDeclaration(s);
|
|
6927
6927
|
}
|
|
6928
6928
|
}, f.tsTryParseExportDeclaration = function() {
|
|
6929
6929
|
return this.tsParseDeclaration(this.startNode(), this.value, !0);
|
|
6930
6930
|
}, f.tsParseImportEqualsDeclaration = function(s, a) {
|
|
6931
6931
|
s.isExport = a || !1, s.id = this.parseIdent(), this.checkLValSimple(s.id, 2), P.prototype.expect.call(this, o.eq);
|
|
6932
|
-
var
|
|
6933
|
-
return s.importKind === "type" &&
|
|
6932
|
+
var c = this.tsParseModuleReference();
|
|
6933
|
+
return s.importKind === "type" && c.type !== "TSExternalModuleReference" && this.raise(c.start, N.ImportAliasHasImportType), s.moduleReference = c, P.prototype.semicolon.call(this), this.finishNode(s, "TSImportEqualsDeclaration");
|
|
6934
6934
|
}, f.isExportDefaultSpecifier = function() {
|
|
6935
6935
|
if (this.tsIsDeclarationStart()) return !1;
|
|
6936
6936
|
var s = this.type;
|
|
@@ -6941,35 +6941,35 @@ function Fh(e) {
|
|
|
6941
6941
|
if (q(a.type) && !this.isContextualWithState("from", a) || a.type === o.braceL) return !1;
|
|
6942
6942
|
}
|
|
6943
6943
|
} else if (!this.match(o._default)) return !1;
|
|
6944
|
-
var
|
|
6945
|
-
if (this.input.charCodeAt(
|
|
6944
|
+
var c = this.nextTokenStart(), p = this.isUnparsedContextual(c, "from");
|
|
6945
|
+
if (this.input.charCodeAt(c) === 44 || q(this.type) && p) return !0;
|
|
6946
6946
|
if (this.match(o._default) && p) {
|
|
6947
|
-
var m = this.input.charCodeAt(this.nextTokenStartSince(
|
|
6947
|
+
var m = this.input.charCodeAt(this.nextTokenStartSince(c + 4));
|
|
6948
6948
|
return m === 34 || m === 39;
|
|
6949
6949
|
}
|
|
6950
6950
|
return !1;
|
|
6951
6951
|
}, f.parseTemplate = function(s) {
|
|
6952
|
-
var a = (s === void 0 ? {} : s).isTagged,
|
|
6952
|
+
var a = (s === void 0 ? {} : s).isTagged, c = a !== void 0 && a, p = this.startNode();
|
|
6953
6953
|
this.next(), p.expressions = [];
|
|
6954
|
-
var m = this.parseTemplateElement({ isTagged:
|
|
6955
|
-
for (p.quasis = [m]; !m.tail; ) this.type === o.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(o.dollarBraceL), p.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()), this.expect(o.braceR), p.quasis.push(m = this.parseTemplateElement({ isTagged:
|
|
6954
|
+
var m = this.parseTemplateElement({ isTagged: c });
|
|
6955
|
+
for (p.quasis = [m]; !m.tail; ) this.type === o.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(o.dollarBraceL), p.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()), this.expect(o.braceR), p.quasis.push(m = this.parseTemplateElement({ isTagged: c }));
|
|
6956
6956
|
return this.next(), this.finishNode(p, "TemplateLiteral");
|
|
6957
|
-
}, f.parseFunction = function(s, a,
|
|
6957
|
+
}, f.parseFunction = function(s, a, c, p, m) {
|
|
6958
6958
|
this.initFunction(s), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !p) && (this.type === o.star && 2 & a && this.unexpected(), s.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (s.async = !!p), 1 & a && (s.id = 4 & a && this.type !== o.name ? null : this.parseIdent());
|
|
6959
6959
|
var v = this.yieldPos, x = this.awaitPos, g = this.awaitIdentPos, _ = this.maybeInArrowParameters;
|
|
6960
6960
|
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(ci(s.async, s.generator)), 1 & a || (s.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(s);
|
|
6961
6961
|
var T = 1 & a;
|
|
6962
|
-
return this.parseFunctionBody(s,
|
|
6963
|
-
}, f.parseFunctionBody = function(s, a,
|
|
6964
|
-
a === void 0 && (a = !1),
|
|
6962
|
+
return this.parseFunctionBody(s, c, !1, m, { isFunctionDeclaration: T }), this.yieldPos = v, this.awaitPos = x, this.awaitIdentPos = g, 1 & a && s.id && !(2 & a) && this.checkLValSimple(s.id, s.body ? this.strict || s.generator || s.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = _, this.finishNode(s, T ? "FunctionDeclaration" : "FunctionExpression");
|
|
6963
|
+
}, f.parseFunctionBody = function(s, a, c, p, m) {
|
|
6964
|
+
a === void 0 && (a = !1), c === void 0 && (c = !1), p === void 0 && (p = !1), this.match(o.colon) && (s.returnType = this.tsParseTypeOrTypePredicateAnnotation(o.colon));
|
|
6965
6965
|
var v = m != null && m.isFunctionDeclaration ? "TSDeclareFunction" : m != null && m.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
6966
|
-
return v && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(s, v) : v === "TSDeclareFunction" && this.isAmbientContext && (this.raise(s.start, N.DeclareFunctionHasImplementation), s.declare) ? (P.prototype.parseFunctionBody.call(this, s, a,
|
|
6966
|
+
return v && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(s, v) : v === "TSDeclareFunction" && this.isAmbientContext && (this.raise(s.start, N.DeclareFunctionHasImplementation), s.declare) ? (P.prototype.parseFunctionBody.call(this, s, a, c, !1), this.finishNode(s, v)) : (P.prototype.parseFunctionBody.call(this, s, a, c, p), s);
|
|
6967
6967
|
}, f.parseNew = function() {
|
|
6968
6968
|
var s;
|
|
6969
6969
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
6970
|
-
var a = this.startNode(),
|
|
6970
|
+
var a = this.startNode(), c = this.parseIdent(!0);
|
|
6971
6971
|
if (this.options.ecmaVersion >= 6 && this.eat(o.dot)) {
|
|
6972
|
-
a.meta =
|
|
6972
|
+
a.meta = c;
|
|
6973
6973
|
var p = this.containsEsc;
|
|
6974
6974
|
return a.property = this.parseIdent(!0), a.property.name !== "target" && this.raiseRecoverable(a.property.start, "The only valid meta property for new is 'new.target'"), p && this.raiseRecoverable(a.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(a.start, "'new.target' can only be used in functions and class static block"), this.finishNode(a, "MetaProperty");
|
|
6975
6975
|
}
|
|
@@ -6977,15 +6977,15 @@ function Fh(e) {
|
|
|
6977
6977
|
a.callee = this.parseSubscripts(this.parseExprAtom(), m, v, !0, !1), x && a.callee.type === "ImportExpression" && this.raise(m, "Cannot use new with import()");
|
|
6978
6978
|
var g = a.callee;
|
|
6979
6979
|
return g.type !== "TSInstantiationExpression" || (s = g.extra) != null && s.parenthesized || (a.typeParameters = g.typeParameters, a.callee = g.expression), a.arguments = this.eat(o.parenL) ? this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1) : [], this.finishNode(a, "NewExpression");
|
|
6980
|
-
}, f.parseExprOp = function(s, a,
|
|
6980
|
+
}, f.parseExprOp = function(s, a, c, p, m) {
|
|
6981
6981
|
var v;
|
|
6982
6982
|
if (o._in.binop > p && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (v = "TSAsExpression"), u && this.isContextual("satisfies") && (v = "TSSatisfiesExpression"), v)) {
|
|
6983
|
-
var x = this.startNodeAt(a,
|
|
6983
|
+
var x = this.startNodeAt(a, c);
|
|
6984
6984
|
x.expression = s;
|
|
6985
6985
|
var g = this.tsTryNextParseConstantContext();
|
|
6986
|
-
return x.typeAnnotation = g || this.tsNextThenParseType(), this.finishNode(x, v), this.reScan_lt_gt(), this.parseExprOp(x, a,
|
|
6986
|
+
return x.typeAnnotation = g || this.tsNextThenParseType(), this.finishNode(x, v), this.reScan_lt_gt(), this.parseExprOp(x, a, c, p, m);
|
|
6987
6987
|
}
|
|
6988
|
-
return P.prototype.parseExprOp.call(this, s, a,
|
|
6988
|
+
return P.prototype.parseExprOp.call(this, s, a, c, p, m);
|
|
6989
6989
|
}, f.parseImportSpecifiers = function() {
|
|
6990
6990
|
var s = [], a = !0;
|
|
6991
6991
|
if (y.tokenIsIdentifier(this.type) && (s.push(this.parseImportDefaultSpecifier()), !this.eat(o.comma))) return s;
|
|
@@ -6999,8 +6999,8 @@ function Fh(e) {
|
|
|
6999
6999
|
}, f.parseImport = function(s) {
|
|
7000
7000
|
var a = this.lookahead();
|
|
7001
7001
|
if (s.importKind = "value", this.importOrExportOuterKind = "value", q(a.type) || this.match(o.star) || this.match(o.braceL)) {
|
|
7002
|
-
var
|
|
7003
|
-
if (
|
|
7002
|
+
var c = this.lookahead(2);
|
|
7003
|
+
if (c.type !== o.comma && !this.isContextualWithState("from", c) && c.type !== o.eq && this.ts_eatContextualWithState("type", 1, a) && (this.importOrExportOuterKind = "type", s.importKind = "type", a = this.lookahead(), c = this.lookahead(2)), q(a.type) && c.type === o.eq) {
|
|
7004
7004
|
this.next();
|
|
7005
7005
|
var p = this.tsParseImportEqualsDeclaration(s);
|
|
7006
7006
|
return this.importOrExportOuterKind = "value", p;
|
|
@@ -7025,26 +7025,26 @@ function Fh(e) {
|
|
|
7025
7025
|
s.arguments = [a];
|
|
7026
7026
|
}
|
|
7027
7027
|
if (!this.eat(o.parenR)) {
|
|
7028
|
-
var
|
|
7029
|
-
this.eat(o.comma) && this.eat(o.parenR) ? this.raiseRecoverable(
|
|
7028
|
+
var c = this.start;
|
|
7029
|
+
this.eat(o.comma) && this.eat(o.parenR) ? this.raiseRecoverable(c, "Trailing comma is not allowed in import()") : this.unexpected(c);
|
|
7030
7030
|
}
|
|
7031
7031
|
return this.finishNode(s, "ImportExpression");
|
|
7032
7032
|
}, f.parseExport = function(s, a) {
|
|
7033
|
-
var
|
|
7034
|
-
if (this.ts_eatWithState(o._import, 2,
|
|
7033
|
+
var c = this.lookahead();
|
|
7034
|
+
if (this.ts_eatWithState(o._import, 2, c)) {
|
|
7035
7035
|
this.ts_isContextual(D.type) && this.lookaheadCharCode() !== 61 ? (s.importKind = "type", this.importOrExportOuterKind = "type", this.next()) : (s.importKind = "value", this.importOrExportOuterKind = "value");
|
|
7036
7036
|
var p = this.tsParseImportEqualsDeclaration(s, !0);
|
|
7037
7037
|
return this.importOrExportOuterKind = void 0, p;
|
|
7038
7038
|
}
|
|
7039
|
-
if (this.ts_eatWithState(o.eq, 2,
|
|
7039
|
+
if (this.ts_eatWithState(o.eq, 2, c)) {
|
|
7040
7040
|
var m = s;
|
|
7041
7041
|
return m.expression = this.parseExpression(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(m, "TSExportAssignment");
|
|
7042
7042
|
}
|
|
7043
|
-
if (this.ts_eatContextualWithState("as", 2,
|
|
7043
|
+
if (this.ts_eatContextualWithState("as", 2, c)) {
|
|
7044
7044
|
var v = s;
|
|
7045
7045
|
return this.expectContextual("namespace"), v.id = this.parseIdent(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(v, "TSNamespaceExportDeclaration");
|
|
7046
7046
|
}
|
|
7047
|
-
if (this.ts_isContextualWithState(
|
|
7047
|
+
if (this.ts_isContextualWithState(c, D.type) && this.lookahead(2).type === o.braceL ? (this.next(), this.importOrExportOuterKind = "type", s.exportKind = "type") : (this.importOrExportOuterKind = "value", s.exportKind = "value"), this.next(), this.eat(o.star)) return this.parseExportAllDeclaration(s, a);
|
|
7048
7048
|
if (this.eat(o._default)) return this.checkExport(a, "default", this.lastTokStart), s.declaration = this.parseExportDefaultDeclaration(), this.finishNode(s, "ExportDefaultDeclaration");
|
|
7049
7049
|
if (this.shouldParseExportStatement()) s.declaration = this.parseExportDeclaration(s), s.declaration.type === "VariableDeclaration" ? this.checkVariableExport(a, s.declaration.declarations) : this.checkExport(a, s.declaration.id, s.declaration.id.start), s.specifiers = [], s.source = null;
|
|
7050
7050
|
else {
|
|
@@ -7059,21 +7059,21 @@ function Fh(e) {
|
|
|
7059
7059
|
this.semicolon();
|
|
7060
7060
|
}
|
|
7061
7061
|
return this.finishNode(s, "ExportNamedDeclaration");
|
|
7062
|
-
}, f.checkExport = function(s, a,
|
|
7062
|
+
}, f.checkExport = function(s, a, c) {
|
|
7063
7063
|
s && (typeof a != "string" && (a = a.type === "Identifier" ? a.name : a.value), s[a] = !0);
|
|
7064
|
-
}, f.parseMaybeDefault = function(s, a,
|
|
7065
|
-
var p = P.prototype.parseMaybeDefault.call(this, s, a,
|
|
7064
|
+
}, f.parseMaybeDefault = function(s, a, c) {
|
|
7065
|
+
var p = P.prototype.parseMaybeDefault.call(this, s, a, c);
|
|
7066
7066
|
return p.type === "AssignmentPattern" && p.typeAnnotation && p.right.start < p.typeAnnotation.start && this.raise(p.typeAnnotation.start, N.TypeAnnotationAfterAssign), p;
|
|
7067
7067
|
}, f.typeCastToParameter = function(s) {
|
|
7068
7068
|
return s.expression.typeAnnotation = s.typeAnnotation, this.resetEndLocation(s.expression, s.typeAnnotation.end), s.expression;
|
|
7069
7069
|
}, f.toAssignableList = function(s, a) {
|
|
7070
|
-
for (var
|
|
7071
|
-
var p = s[
|
|
7072
|
-
p?.type === "TSTypeCastExpression" && (s[
|
|
7070
|
+
for (var c = 0; c < s.length; c++) {
|
|
7071
|
+
var p = s[c];
|
|
7072
|
+
p?.type === "TSTypeCastExpression" && (s[c] = this.typeCastToParameter(p));
|
|
7073
7073
|
}
|
|
7074
7074
|
return P.prototype.toAssignableList.call(this, s, a);
|
|
7075
7075
|
}, f.reportReservedArrowTypeParam = function(s) {
|
|
7076
|
-
}, f.parseExprAtom = function(s, a,
|
|
7076
|
+
}, f.parseExprAtom = function(s, a, c) {
|
|
7077
7077
|
if (this.type === D.jsxText) return this.jsx_parseText();
|
|
7078
7078
|
if (this.type === D.jsxTagStart) return this.jsx_parseElement();
|
|
7079
7079
|
if (this.type === D.at) return this.parseDecorators(), this.parseExprAtom();
|
|
@@ -7086,31 +7086,31 @@ function Fh(e) {
|
|
|
7086
7086
|
}
|
|
7087
7087
|
return g;
|
|
7088
7088
|
}
|
|
7089
|
-
return P.prototype.parseExprAtom.call(this, s, a,
|
|
7089
|
+
return P.prototype.parseExprAtom.call(this, s, a, c);
|
|
7090
7090
|
}, f.parseExprAtomDefault = function() {
|
|
7091
7091
|
if (q(this.type)) {
|
|
7092
|
-
var s = this.potentialArrowAt === this.start, a = this.containsEsc,
|
|
7093
|
-
if (!a &&
|
|
7092
|
+
var s = this.potentialArrowAt === this.start, a = this.containsEsc, c = this.parseIdent();
|
|
7093
|
+
if (!a && c.name === "async" && !this.canInsertSemicolon()) {
|
|
7094
7094
|
var p = this.type;
|
|
7095
|
-
if (p === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(
|
|
7095
|
+
if (p === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(c), void 0, !0, !0);
|
|
7096
7096
|
if (q(p)) {
|
|
7097
7097
|
if (this.lookaheadCharCode() === 61) {
|
|
7098
7098
|
var m = this.parseIdent(!1);
|
|
7099
|
-
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(
|
|
7099
|
+
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(c), [m], !0);
|
|
7100
7100
|
}
|
|
7101
|
-
return
|
|
7101
|
+
return c;
|
|
7102
7102
|
}
|
|
7103
7103
|
}
|
|
7104
|
-
return s && this.match(o.arrow) && !this.canInsertSemicolon() ? (this.next(), this.parseArrowExpression(this.startNodeAtNode(
|
|
7104
|
+
return s && this.match(o.arrow) && !this.canInsertSemicolon() ? (this.next(), this.parseArrowExpression(this.startNodeAtNode(c), [c], !1)) : c;
|
|
7105
7105
|
}
|
|
7106
7106
|
this.unexpected();
|
|
7107
7107
|
}, f.parseIdentNode = function() {
|
|
7108
7108
|
var s = this.startNode();
|
|
7109
|
-
return
|
|
7110
|
-
}, f.parseVarStatement = function(s, a,
|
|
7111
|
-
|
|
7109
|
+
return Ct(this.type) ? (s.name = this.value, s) : P.prototype.parseIdentNode.call(this);
|
|
7110
|
+
}, f.parseVarStatement = function(s, a, c) {
|
|
7111
|
+
c === void 0 && (c = !1);
|
|
7112
7112
|
var p = this.isAmbientContext;
|
|
7113
|
-
this.next(), P.prototype.parseVar.call(this, s, !1, a,
|
|
7113
|
+
this.next(), P.prototype.parseVar.call(this, s, !1, a, c || p), this.semicolon();
|
|
7114
7114
|
var m = this.finishNode(s, "VariableDeclaration");
|
|
7115
7115
|
if (!p) return m;
|
|
7116
7116
|
for (var v, x = vr(m.declarations); !(v = x()).done; ) {
|
|
@@ -7118,7 +7118,7 @@ function Fh(e) {
|
|
|
7118
7118
|
_ && (a !== "const" || g.id.typeAnnotation ? this.raise(_.start, N.InitializerNotAllowedInAmbientContext) : _.type !== "StringLiteral" && _.type !== "BooleanLiteral" && _.type !== "NumericLiteral" && _.type !== "BigIntLiteral" && (_.type !== "TemplateLiteral" || _.expressions.length > 0) && !jh(_) && this.raise(_.start, N.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
7119
7119
|
}
|
|
7120
7120
|
return m;
|
|
7121
|
-
}, f.parseStatement = function(s, a,
|
|
7121
|
+
}, f.parseStatement = function(s, a, c) {
|
|
7122
7122
|
if (this.match(D.at) && this.parseDecorators(!0), this.match(o._const) && this.isLookaheadContextual("enum")) {
|
|
7123
7123
|
var p = this.startNode();
|
|
7124
7124
|
return this.expect(o._const), this.tsParseEnumDeclaration(p, { const: !0 });
|
|
@@ -7128,7 +7128,7 @@ function Fh(e) {
|
|
|
7128
7128
|
var m = this.tsParseInterfaceDeclaration(this.startNode());
|
|
7129
7129
|
if (m) return m;
|
|
7130
7130
|
}
|
|
7131
|
-
return P.prototype.parseStatement.call(this, s, a,
|
|
7131
|
+
return P.prototype.parseStatement.call(this, s, a, c);
|
|
7132
7132
|
}, f.parseAccessModifier = function() {
|
|
7133
7133
|
return this.tsParseModifier(["public", "protected", "private"]);
|
|
7134
7134
|
}, f.parsePostMemberNameModifiers = function(s) {
|
|
@@ -7137,24 +7137,24 @@ function Fh(e) {
|
|
|
7137
7137
|
return (a.type === "Identifier" ? this.tsParseExpressionStatement(s, a) : void 0) || P.prototype.parseExpressionStatement.call(this, s, a);
|
|
7138
7138
|
}, f.shouldParseExportStatement = function() {
|
|
7139
7139
|
return !!this.tsIsDeclarationStart() || !!this.match(D.at) || P.prototype.shouldParseExportStatement.call(this);
|
|
7140
|
-
}, f.parseConditional = function(s, a,
|
|
7140
|
+
}, f.parseConditional = function(s, a, c, p, m) {
|
|
7141
7141
|
if (this.eat(o.question)) {
|
|
7142
|
-
var v = this.startNodeAt(a,
|
|
7142
|
+
var v = this.startNodeAt(a, c);
|
|
7143
7143
|
return v.test = s, v.consequent = this.parseMaybeAssign(), this.expect(o.colon), v.alternate = this.parseMaybeAssign(p), this.finishNode(v, "ConditionalExpression");
|
|
7144
7144
|
}
|
|
7145
7145
|
return s;
|
|
7146
7146
|
}, f.parseMaybeConditional = function(s, a) {
|
|
7147
|
-
var
|
|
7147
|
+
var c = this, p = this.start, m = this.startLoc, v = this.parseExprOps(s, a);
|
|
7148
7148
|
if (this.checkExpressionErrors(a)) return v;
|
|
7149
7149
|
if (!this.maybeInArrowParameters || !this.match(o.question)) return this.parseConditional(v, p, m, s, a);
|
|
7150
7150
|
var x = this.tryParse(function() {
|
|
7151
|
-
return
|
|
7151
|
+
return c.parseConditional(v, p, m, s, a);
|
|
7152
7152
|
});
|
|
7153
7153
|
return x.node ? (x.error && this.setLookaheadState(x.failState), x.node) : (x.error && this.setOptionalParametersError(a, x.error), v);
|
|
7154
7154
|
}, f.parseParenItem = function(s) {
|
|
7155
|
-
var a = this.start,
|
|
7155
|
+
var a = this.start, c = this.startLoc;
|
|
7156
7156
|
if (s = P.prototype.parseParenItem.call(this, s), this.eat(o.question) && (s.optional = !0, this.resetEndLocation(s)), this.match(o.colon)) {
|
|
7157
|
-
var p = this.startNodeAt(a,
|
|
7157
|
+
var p = this.startNodeAt(a, c);
|
|
7158
7158
|
return p.expression = s, p.typeAnnotation = this.tsParseTypeAnnotation(), this.finishNode(p, "TSTypeCastExpression");
|
|
7159
7159
|
}
|
|
7160
7160
|
return s;
|
|
@@ -7163,15 +7163,15 @@ function Fh(e) {
|
|
|
7163
7163
|
if (!this.isAmbientContext && this.ts_isContextual(D.declare)) return this.tsInAmbientContext(function() {
|
|
7164
7164
|
return a.parseExportDeclaration(s);
|
|
7165
7165
|
});
|
|
7166
|
-
var
|
|
7166
|
+
var c = this.start, p = this.startLoc, m = this.eatContextual("declare");
|
|
7167
7167
|
!m || !this.ts_isContextual(D.declare) && this.shouldParseExportStatement() || this.raise(this.start, N.ExpectedAmbientAfterExportDeclare);
|
|
7168
7168
|
var v = q(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
7169
|
-
return v ? ((v.type === "TSInterfaceDeclaration" || v.type === "TSTypeAliasDeclaration" || m) && (s.exportKind = "type"), m && (this.resetStartLocation(v,
|
|
7169
|
+
return v ? ((v.type === "TSInterfaceDeclaration" || v.type === "TSTypeAliasDeclaration" || m) && (s.exportKind = "type"), m && (this.resetStartLocation(v, c, p), v.declare = !0), v) : null;
|
|
7170
7170
|
}, f.parseClassId = function(s, a) {
|
|
7171
7171
|
if (a || !this.isContextual("implements")) {
|
|
7172
7172
|
P.prototype.parseClassId.call(this, s, a);
|
|
7173
|
-
var
|
|
7174
|
-
|
|
7173
|
+
var c = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));
|
|
7174
|
+
c && (s.typeParameters = c);
|
|
7175
7175
|
}
|
|
7176
7176
|
}, f.parseClassPropertyAnnotation = function(s) {
|
|
7177
7177
|
s.optional || (this.value === "!" && this.eat(o.prefix) ? s.definite = !0 : this.eat(o.question) && (s.optional = !0));
|
|
@@ -7184,27 +7184,27 @@ function Fh(e) {
|
|
|
7184
7184
|
this.raise(this.start, N.AbstractPropertyHasInitializer({ propertyName: a.type !== "Identifier" || s.computed ? "[" + this.input.slice(a.start, a.end) + "]" : a.name }));
|
|
7185
7185
|
}
|
|
7186
7186
|
return P.prototype.parseClassField.call(this, s);
|
|
7187
|
-
}, f.parseClassMethod = function(s, a,
|
|
7187
|
+
}, f.parseClassMethod = function(s, a, c, p) {
|
|
7188
7188
|
var m = s.kind === "constructor", v = s.key.type === "PrivateIdentifier", x = this.tsTryParseTypeParameters();
|
|
7189
7189
|
v ? (x && (s.typeParameters = x), s.accessibility && this.raise(s.start, N.PrivateMethodsHasAccessibility({ modifier: s.accessibility }))) : x && m && this.raise(x.start, N.ConstructorHasTypeParameters);
|
|
7190
7190
|
var g = s.declare, _ = s.kind;
|
|
7191
7191
|
!(g !== void 0 && g) || _ !== "get" && _ !== "set" || this.raise(s.start, N.DeclareAccessor({ kind: _ })), x && (s.typeParameters = x);
|
|
7192
7192
|
var T = s.key;
|
|
7193
|
-
s.kind === "constructor" ? (a && this.raise(T.start, "Constructor can't be a generator"),
|
|
7194
|
-
var L = s.value = this.parseMethod(a,
|
|
7193
|
+
s.kind === "constructor" ? (a && this.raise(T.start, "Constructor can't be a generator"), c && this.raise(T.start, "Constructor can't be an async method")) : s.static && gr(s, "prototype") && this.raise(T.start, "Classes may not have a static property named prototype");
|
|
7194
|
+
var L = s.value = this.parseMethod(a, c, p, !0, s);
|
|
7195
7195
|
return s.kind === "get" && L.params.length !== 0 && this.raiseRecoverable(L.start, "getter should have no params"), s.kind === "set" && L.params.length !== 1 && this.raiseRecoverable(L.start, "setter should have exactly one param"), s.kind === "set" && L.params[0].type === "RestElement" && this.raiseRecoverable(L.params[0].start, "Setter cannot use rest params"), this.finishNode(s, "MethodDefinition");
|
|
7196
7196
|
}, f.isClassMethod = function() {
|
|
7197
7197
|
return this.match(o.relational);
|
|
7198
7198
|
}, f.parseClassElement = function(s) {
|
|
7199
7199
|
var a = this;
|
|
7200
7200
|
if (this.eat(o.semi)) return null;
|
|
7201
|
-
var
|
|
7202
|
-
|
|
7201
|
+
var c, p = this.options.ecmaVersion, m = this.startNode(), v = "", x = !1, g = !1, _ = "method", T = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], L = this.tsParseModifiers({ modified: m, allowedModifiers: T, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate: N.InvalidModifierOnTypeParameterPositions });
|
|
7202
|
+
c = !!L.static;
|
|
7203
7203
|
var V = function() {
|
|
7204
7204
|
if (!a.tsIsStartOfStaticBlocks()) {
|
|
7205
7205
|
var E = a.tsTryParseIndexSignature(m);
|
|
7206
7206
|
if (E) return m.abstract && a.raise(m.start, N.IndexSignatureHasAbstract), m.accessibility && a.raise(m.start, N.IndexSignatureHasAccessibility({ modifier: m.accessibility })), m.declare && a.raise(m.start, N.IndexSignatureHasDeclare), m.override && a.raise(m.start, N.IndexSignatureHasOverride), E;
|
|
7207
|
-
if (!a.inAbstractClass && m.abstract && a.raise(m.start, N.NonAbstractClassHasAbstractMethod), m.override && s && a.raise(m.start, N.OverrideNotInSubClass), m.static =
|
|
7207
|
+
if (!a.inAbstractClass && m.abstract && a.raise(m.start, N.NonAbstractClassHasAbstractMethod), m.override && s && a.raise(m.start, N.OverrideNotInSubClass), m.static = c, c && (a.isClassElementNameStart() || a.type === o.star || (v = "static")), !v && p >= 8 && a.eatContextual("async") && (!a.isClassElementNameStart() && a.type !== o.star || a.canInsertSemicolon() ? v = "async" : g = !0), !v && (p >= 9 || !g) && a.eat(o.star) && (x = !0), !v && !g && !x) {
|
|
7208
7208
|
var K = a.value;
|
|
7209
7209
|
(a.eatContextual("get") || a.eatContextual("set")) && (a.isClassElementNameStart() ? _ = K : v = K);
|
|
7210
7210
|
}
|
|
@@ -7226,15 +7226,15 @@ function Fh(e) {
|
|
|
7226
7226
|
a && (s.typeParameters = a), P.prototype.parseFunctionParams.call(this, s);
|
|
7227
7227
|
}, f.parseVarId = function(s, a) {
|
|
7228
7228
|
P.prototype.parseVarId.call(this, s, a), s.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.value === "!" && this.eat(o.prefix) && (s.definite = !0);
|
|
7229
|
-
var
|
|
7230
|
-
|
|
7231
|
-
}, f.parseArrowExpression = function(s, a,
|
|
7229
|
+
var c = this.tsTryParseTypeAnnotation();
|
|
7230
|
+
c && (s.id.typeAnnotation = c, this.resetEndLocation(s.id));
|
|
7231
|
+
}, f.parseArrowExpression = function(s, a, c, p) {
|
|
7232
7232
|
this.match(o.colon) && (s.returnType = this.tsParseTypeAnnotation());
|
|
7233
7233
|
var m = this.yieldPos, v = this.awaitPos, x = this.awaitIdentPos;
|
|
7234
|
-
this.enterScope(16 | ci(
|
|
7234
|
+
this.enterScope(16 | ci(c, !1)), this.initFunction(s);
|
|
7235
7235
|
var g = this.maybeInArrowParameters;
|
|
7236
|
-
return this.options.ecmaVersion >= 8 && (s.async = !!
|
|
7237
|
-
}, f.parseMaybeAssignOrigin = function(s, a,
|
|
7236
|
+
return this.options.ecmaVersion >= 8 && (s.async = !!c), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, s.params = this.toAssignableList(a, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(s, !0, !1, p), this.yieldPos = m, this.awaitPos = v, this.awaitIdentPos = x, this.maybeInArrowParameters = g, this.finishNode(s, "ArrowFunctionExpression");
|
|
7237
|
+
}, f.parseMaybeAssignOrigin = function(s, a, c) {
|
|
7238
7238
|
if (this.isContextual("yield")) {
|
|
7239
7239
|
if (this.inGenerator) return this.parseYield(s);
|
|
7240
7240
|
this.exprAllowed = !1;
|
|
@@ -7244,31 +7244,31 @@ function Fh(e) {
|
|
|
7244
7244
|
var g = this.start, _ = this.startLoc;
|
|
7245
7245
|
(this.type === o.parenL || q(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = s === "await");
|
|
7246
7246
|
var T = this.parseMaybeConditional(s, a);
|
|
7247
|
-
if (
|
|
7247
|
+
if (c && (T = c.call(this, T, g, _)), this.type.isAssign) {
|
|
7248
7248
|
var L = this.startNodeAt(g, _);
|
|
7249
7249
|
return L.operator = this.value, this.type === o.eq && (T = this.toAssignable(T, !0, a)), p || (a.parenthesizedAssign = a.trailingComma = a.doubleProto = -1), a.shorthandAssign >= T.start && (a.shorthandAssign = -1), this.type === o.eq ? this.checkLValPattern(T) : this.checkLValSimple(T), L.left = T, this.next(), L.right = this.parseMaybeAssign(s), x > -1 && (a.doubleProto = x), this.finishNode(L, "AssignmentExpression");
|
|
7250
7250
|
}
|
|
7251
7251
|
return p && this.checkExpressionErrors(a, !0), m > -1 && (a.parenthesizedAssign = m), v > -1 && (a.trailingComma = v), T;
|
|
7252
|
-
}, f.parseMaybeAssign = function(s, a,
|
|
7252
|
+
}, f.parseMaybeAssign = function(s, a, c) {
|
|
7253
7253
|
var p, m, v, x, g, _, T, L, V, E, K, G = this;
|
|
7254
7254
|
if (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational()) {
|
|
7255
7255
|
if (L = this.cloneCurLookaheadState(), !(V = this.tryParse(function() {
|
|
7256
|
-
return G.parseMaybeAssignOrigin(s, a,
|
|
7256
|
+
return G.parseMaybeAssignOrigin(s, a, c);
|
|
7257
7257
|
}, L)).error) return V.node;
|
|
7258
7258
|
var X = this.context, re = X[X.length - 1];
|
|
7259
7259
|
re === y.tokContexts.tc_oTag && X[X.length - 2] === y.tokContexts.tc_expr ? (X.pop(), X.pop()) : re !== y.tokContexts.tc_oTag && re !== y.tokContexts.tc_expr || X.pop();
|
|
7260
7260
|
}
|
|
7261
|
-
if (!((p = V) != null && p.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(s, a,
|
|
7261
|
+
if (!((p = V) != null && p.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(s, a, c);
|
|
7262
7262
|
L && !this.compareLookaheadState(L, this.getCurLookaheadState()) || (L = this.cloneCurLookaheadState());
|
|
7263
7263
|
var ve = this.tryParse(function($e) {
|
|
7264
7264
|
var dt, mt;
|
|
7265
7265
|
K = G.tsParseTypeParameters();
|
|
7266
|
-
var Be = G.parseMaybeAssignOrigin(s, a,
|
|
7266
|
+
var Be = G.parseMaybeAssignOrigin(s, a, c);
|
|
7267
7267
|
return (Be.type !== "ArrowFunctionExpression" || (dt = Be.extra) != null && dt.parenthesized) && $e(), ((mt = K) == null ? void 0 : mt.params.length) !== 0 && G.resetStartLocationFromNode(Be, K), Be.typeParameters = K, Be;
|
|
7268
7268
|
}, L);
|
|
7269
7269
|
if (!ve.error && !ve.aborted) return K && this.reportReservedArrowTypeParam(K), ve.node;
|
|
7270
7270
|
if (!V && (br(!0), !(E = this.tryParse(function() {
|
|
7271
|
-
return G.parseMaybeAssignOrigin(s, a,
|
|
7271
|
+
return G.parseMaybeAssignOrigin(s, a, c);
|
|
7272
7272
|
}, L)).error)) return E.node;
|
|
7273
7273
|
if ((m = V) != null && m.node) return this.setLookaheadState(V.failState), V.node;
|
|
7274
7274
|
if (ve.node) return this.setLookaheadState(ve.failState), K && this.reportReservedArrowTypeParam(K), ve.node;
|
|
@@ -7276,27 +7276,27 @@ function Fh(e) {
|
|
|
7276
7276
|
throw (x = V) != null && x.thrown ? V.error : ve.thrown ? ve.error : (g = E) != null && g.thrown ? E.error : ((_ = V) == null ? void 0 : _.error) || ve.error || ((T = E) == null ? void 0 : T.error);
|
|
7277
7277
|
}, f.parseAssignableListItem = function(s) {
|
|
7278
7278
|
for (var a = []; this.match(D.at); ) a.push(this.parseDecorator());
|
|
7279
|
-
var
|
|
7279
|
+
var c, p = this.start, m = this.startLoc, v = !1, x = !1;
|
|
7280
7280
|
if (s !== void 0) {
|
|
7281
7281
|
var g = {};
|
|
7282
|
-
this.tsParseModifiers({ modified: g, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }),
|
|
7282
|
+
this.tsParseModifiers({ modified: g, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), c = g.accessibility, x = g.override, v = g.readonly, s === !1 && (c || v || x) && this.raise(m.start, N.UnexpectedParameterModifier);
|
|
7283
7283
|
}
|
|
7284
7284
|
var _ = this.parseMaybeDefault(p, m);
|
|
7285
7285
|
this.parseBindingListItem(_);
|
|
7286
7286
|
var T = this.parseMaybeDefault(_.start, _.loc, _);
|
|
7287
|
-
if (a.length && (T.decorators = a),
|
|
7287
|
+
if (a.length && (T.decorators = a), c || v || x) {
|
|
7288
7288
|
var L = this.startNodeAt(p, m);
|
|
7289
|
-
return
|
|
7289
|
+
return c && (L.accessibility = c), v && (L.readonly = v), x && (L.override = x), T.type !== "Identifier" && T.type !== "AssignmentPattern" && this.raise(L.start, N.UnsupportedParameterPropertyKind), L.parameter = T, this.finishNode(L, "TSParameterProperty");
|
|
7290
7290
|
}
|
|
7291
7291
|
return T;
|
|
7292
|
-
}, f.checkLValInnerPattern = function(s, a,
|
|
7293
|
-
a === void 0 && (a = 0), s.type === "TSParameterProperty" ? this.checkLValInnerPattern(s.parameter, a,
|
|
7292
|
+
}, f.checkLValInnerPattern = function(s, a, c) {
|
|
7293
|
+
a === void 0 && (a = 0), s.type === "TSParameterProperty" ? this.checkLValInnerPattern(s.parameter, a, c) : P.prototype.checkLValInnerPattern.call(this, s, a, c);
|
|
7294
7294
|
}, f.parseBindingListItem = function(s) {
|
|
7295
7295
|
this.eat(o.question) && (s.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(s.start, N.PatternIsOptional), s.optional = !0);
|
|
7296
7296
|
var a = this.tsTryParseTypeAnnotation();
|
|
7297
7297
|
return a && (s.typeAnnotation = a), this.resetEndLocation(s), s;
|
|
7298
7298
|
}, f.isAssignable = function(s, a) {
|
|
7299
|
-
var
|
|
7299
|
+
var c = this;
|
|
7300
7300
|
switch (s.type) {
|
|
7301
7301
|
case "TSTypeCastExpression":
|
|
7302
7302
|
return this.isAssignable(s.expression, a);
|
|
@@ -7310,7 +7310,7 @@ function Fh(e) {
|
|
|
7310
7310
|
case "ObjectExpression":
|
|
7311
7311
|
var p = s.properties.length - 1;
|
|
7312
7312
|
return s.properties.every(function(m, v) {
|
|
7313
|
-
return m.type !== "ObjectMethod" && (v === p || m.type !== "SpreadElement") &&
|
|
7313
|
+
return m.type !== "ObjectMethod" && (v === p || m.type !== "SpreadElement") && c.isAssignable(m);
|
|
7314
7314
|
});
|
|
7315
7315
|
case "Property":
|
|
7316
7316
|
case "ObjectProperty":
|
|
@@ -7319,7 +7319,7 @@ function Fh(e) {
|
|
|
7319
7319
|
return this.isAssignable(s.argument);
|
|
7320
7320
|
case "ArrayExpression":
|
|
7321
7321
|
return s.elements.every(function(m) {
|
|
7322
|
-
return m === null ||
|
|
7322
|
+
return m === null || c.isAssignable(m);
|
|
7323
7323
|
});
|
|
7324
7324
|
case "AssignmentExpression":
|
|
7325
7325
|
return s.operator === "=";
|
|
@@ -7331,57 +7331,57 @@ function Fh(e) {
|
|
|
7331
7331
|
default:
|
|
7332
7332
|
return !1;
|
|
7333
7333
|
}
|
|
7334
|
-
}, f.toAssignable = function(s, a,
|
|
7335
|
-
switch (a === void 0 && (a = !1),
|
|
7334
|
+
}, f.toAssignable = function(s, a, c) {
|
|
7335
|
+
switch (a === void 0 && (a = !1), c === void 0 && (c = new vt()), s.type) {
|
|
7336
7336
|
case "ParenthesizedExpression":
|
|
7337
|
-
return this.toAssignableParenthesizedExpression(s, a,
|
|
7337
|
+
return this.toAssignableParenthesizedExpression(s, a, c);
|
|
7338
7338
|
case "TSAsExpression":
|
|
7339
7339
|
case "TSSatisfiesExpression":
|
|
7340
7340
|
case "TSNonNullExpression":
|
|
7341
7341
|
case "TSTypeAssertion":
|
|
7342
|
-
return a || this.raise(s.start, N.UnexpectedTypeCastInParameter), this.toAssignable(s.expression, a,
|
|
7342
|
+
return a || this.raise(s.start, N.UnexpectedTypeCastInParameter), this.toAssignable(s.expression, a, c);
|
|
7343
7343
|
case "MemberExpression":
|
|
7344
7344
|
break;
|
|
7345
7345
|
case "AssignmentExpression":
|
|
7346
|
-
return a || s.left.type !== "TSTypeCastExpression" || (s.left = this.typeCastToParameter(s.left)), P.prototype.toAssignable.call(this, s, a,
|
|
7346
|
+
return a || s.left.type !== "TSTypeCastExpression" || (s.left = this.typeCastToParameter(s.left)), P.prototype.toAssignable.call(this, s, a, c);
|
|
7347
7347
|
case "TSTypeCastExpression":
|
|
7348
7348
|
return this.typeCastToParameter(s);
|
|
7349
7349
|
default:
|
|
7350
|
-
return P.prototype.toAssignable.call(this, s, a,
|
|
7350
|
+
return P.prototype.toAssignable.call(this, s, a, c);
|
|
7351
7351
|
}
|
|
7352
7352
|
return s;
|
|
7353
|
-
}, f.toAssignableParenthesizedExpression = function(s, a,
|
|
7353
|
+
}, f.toAssignableParenthesizedExpression = function(s, a, c) {
|
|
7354
7354
|
switch (s.expression.type) {
|
|
7355
7355
|
case "TSAsExpression":
|
|
7356
7356
|
case "TSSatisfiesExpression":
|
|
7357
7357
|
case "TSNonNullExpression":
|
|
7358
7358
|
case "TSTypeAssertion":
|
|
7359
7359
|
case "ParenthesizedExpression":
|
|
7360
|
-
return this.toAssignable(s.expression, a,
|
|
7360
|
+
return this.toAssignable(s.expression, a, c);
|
|
7361
7361
|
default:
|
|
7362
|
-
return P.prototype.toAssignable.call(this, s, a,
|
|
7362
|
+
return P.prototype.toAssignable.call(this, s, a, c);
|
|
7363
7363
|
}
|
|
7364
7364
|
}, f.curPosition = function() {
|
|
7365
7365
|
if (this.options.locations) {
|
|
7366
7366
|
var s = P.prototype.curPosition.call(this);
|
|
7367
7367
|
return Object.defineProperty(s, "offset", { get: function() {
|
|
7368
7368
|
return function(a) {
|
|
7369
|
-
var
|
|
7370
|
-
return
|
|
7369
|
+
var c = new d.Position(this.line, this.column + a);
|
|
7370
|
+
return c.index = this.index + a, c;
|
|
7371
7371
|
};
|
|
7372
7372
|
} }), s.index = this.pos, s;
|
|
7373
7373
|
}
|
|
7374
7374
|
}, f.parseBindingAtom = function() {
|
|
7375
7375
|
return this.type === o._this ? this.parseIdent(!0) : P.prototype.parseBindingAtom.call(this);
|
|
7376
7376
|
}, f.shouldParseArrow = function(s) {
|
|
7377
|
-
var a,
|
|
7377
|
+
var a, c = this;
|
|
7378
7378
|
if (a = this.match(o.colon) ? s.every(function(m) {
|
|
7379
|
-
return
|
|
7379
|
+
return c.isAssignable(m, !0);
|
|
7380
7380
|
}) : !this.canInsertSemicolon()) {
|
|
7381
7381
|
if (this.match(o.colon)) {
|
|
7382
7382
|
var p = this.tryParse(function(m) {
|
|
7383
|
-
var v =
|
|
7384
|
-
return !
|
|
7383
|
+
var v = c.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
7384
|
+
return !c.canInsertSemicolon() && c.match(o.arrow) || m(), v;
|
|
7385
7385
|
});
|
|
7386
7386
|
if (p.aborted) return this.shouldParseArrowReturnType = void 0, !1;
|
|
7387
7387
|
p.thrown || (p.error && this.setLookaheadState(p.failState), this.shouldParseArrowReturnType = p.node);
|
|
@@ -7389,11 +7389,11 @@ function Fh(e) {
|
|
|
7389
7389
|
return !!this.match(o.arrow) || (this.shouldParseArrowReturnType = void 0, !1);
|
|
7390
7390
|
}
|
|
7391
7391
|
return this.shouldParseArrowReturnType = void 0, a;
|
|
7392
|
-
}, f.parseParenArrowList = function(s, a,
|
|
7392
|
+
}, f.parseParenArrowList = function(s, a, c, p) {
|
|
7393
7393
|
var m = this.startNodeAt(s, a);
|
|
7394
|
-
return m.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(m,
|
|
7394
|
+
return m.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(m, c, !1, p);
|
|
7395
7395
|
}, f.parseParenAndDistinguishExpression = function(s, a) {
|
|
7396
|
-
var
|
|
7396
|
+
var c, p = this.start, m = this.startLoc, v = this.options.ecmaVersion >= 8;
|
|
7397
7397
|
if (this.options.ecmaVersion >= 6) {
|
|
7398
7398
|
var x = this.maybeInArrowParameters;
|
|
7399
7399
|
this.maybeInArrowParameters = !0, this.next();
|
|
@@ -7411,40 +7411,40 @@ function Fh(e) {
|
|
|
7411
7411
|
}
|
|
7412
7412
|
var re = this.lastTokEnd, ve = this.lastTokEndLoc;
|
|
7413
7413
|
if (this.expect(o.parenR), this.maybeInArrowParameters = x, s && this.shouldParseArrow(L) && this.eat(o.arrow)) return this.checkPatternErrors(K, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = G, this.awaitPos = X, this.parseParenArrowList(p, m, L, a);
|
|
7414
|
-
L.length && !E || this.unexpected(this.lastTokStart), g && this.unexpected(g), this.checkExpressionErrors(K, !0), this.yieldPos = G || this.yieldPos, this.awaitPos = X || this.awaitPos, L.length > 1 ? ((
|
|
7415
|
-
} else
|
|
7414
|
+
L.length && !E || this.unexpected(this.lastTokStart), g && this.unexpected(g), this.checkExpressionErrors(K, !0), this.yieldPos = G || this.yieldPos, this.awaitPos = X || this.awaitPos, L.length > 1 ? ((c = this.startNodeAt(_, T)).expressions = L, this.finishNodeAt(c, "SequenceExpression", re, ve)) : c = L[0];
|
|
7415
|
+
} else c = this.parseParenExpression();
|
|
7416
7416
|
if (this.options.preserveParens) {
|
|
7417
7417
|
var $e = this.startNodeAt(p, m);
|
|
7418
|
-
return $e.expression =
|
|
7418
|
+
return $e.expression = c, this.finishNode($e, "ParenthesizedExpression");
|
|
7419
7419
|
}
|
|
7420
|
-
return
|
|
7421
|
-
}, f.parseTaggedTemplateExpression = function(s, a,
|
|
7422
|
-
var m = this.startNodeAt(a,
|
|
7420
|
+
return c;
|
|
7421
|
+
}, f.parseTaggedTemplateExpression = function(s, a, c, p) {
|
|
7422
|
+
var m = this.startNodeAt(a, c);
|
|
7423
7423
|
return m.tag = s, m.quasi = this.parseTemplate({ isTagged: !0 }), p && this.raise(a, "Tagged Template Literals are not allowed in optionalChain."), this.finishNode(m, "TaggedTemplateExpression");
|
|
7424
7424
|
}, f.shouldParseAsyncArrow = function() {
|
|
7425
7425
|
var s = this;
|
|
7426
7426
|
if (!this.match(o.colon)) return !this.canInsertSemicolon() && this.eat(o.arrow);
|
|
7427
|
-
var a = this.tryParse(function(
|
|
7427
|
+
var a = this.tryParse(function(c) {
|
|
7428
7428
|
var p = s.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
7429
|
-
return !s.canInsertSemicolon() && s.match(o.arrow) ||
|
|
7429
|
+
return !s.canInsertSemicolon() && s.match(o.arrow) || c(), p;
|
|
7430
7430
|
});
|
|
7431
7431
|
return a.aborted ? (this.shouldParseAsyncArrowReturnType = void 0, !1) : a.thrown ? void 0 : (a.error && this.setLookaheadState(a.failState), this.shouldParseAsyncArrowReturnType = a.node, !this.canInsertSemicolon() && this.eat(o.arrow));
|
|
7432
|
-
}, f.parseSubscriptAsyncArrow = function(s, a,
|
|
7432
|
+
}, f.parseSubscriptAsyncArrow = function(s, a, c, p) {
|
|
7433
7433
|
var m = this.startNodeAt(s, a);
|
|
7434
|
-
return m.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(m,
|
|
7435
|
-
}, f.parseExprList = function(s, a,
|
|
7434
|
+
return m.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(m, c, !0, p);
|
|
7435
|
+
}, f.parseExprList = function(s, a, c, p) {
|
|
7436
7436
|
for (var m = [], v = !0; !this.eat(s); ) {
|
|
7437
7437
|
if (v) v = !1;
|
|
7438
7438
|
else if (this.expect(o.comma), a && this.afterTrailingComma(s)) break;
|
|
7439
7439
|
var x = void 0;
|
|
7440
|
-
|
|
7440
|
+
c && this.type === o.comma ? x = null : this.type === o.ellipsis ? (x = this.parseSpread(p), p && this.type === o.comma && p.trailingComma < 0 && (p.trailingComma = this.start)) : x = this.parseMaybeAssign(!1, p, this.parseParenItem), m.push(x);
|
|
7441
7441
|
}
|
|
7442
7442
|
return m;
|
|
7443
|
-
}, f.parseSubscript = function(s, a,
|
|
7443
|
+
}, f.parseSubscript = function(s, a, c, p, m, v, x) {
|
|
7444
7444
|
var g = this, _ = v;
|
|
7445
7445
|
if (!this.hasPrecedingLineBreak() && this.value === "!" && this.match(o.prefix)) {
|
|
7446
7446
|
this.exprAllowed = !1, this.next();
|
|
7447
|
-
var T = this.startNodeAt(a,
|
|
7447
|
+
var T = this.startNodeAt(a, c);
|
|
7448
7448
|
return T.expression = s, s = this.finishNode(T, "TSNonNullExpression");
|
|
7449
7449
|
}
|
|
7450
7450
|
var L = !1;
|
|
@@ -7455,24 +7455,24 @@ function Fh(e) {
|
|
|
7455
7455
|
if (this.tsMatchLeftRelational() || this.match(o.bitShift)) {
|
|
7456
7456
|
var V, E = this.tsTryParseAndCatch(function() {
|
|
7457
7457
|
if (!p && g.atPossibleAsyncArrow(s)) {
|
|
7458
|
-
var Mi = g.tsTryParseGenericAsyncArrowFunction(a,
|
|
7458
|
+
var Mi = g.tsTryParseGenericAsyncArrowFunction(a, c, x);
|
|
7459
7459
|
if (Mi) return s = Mi;
|
|
7460
7460
|
}
|
|
7461
|
-
var
|
|
7462
|
-
if (!
|
|
7461
|
+
var Et = g.tsParseTypeArgumentsInExpression();
|
|
7462
|
+
if (!Et) return s;
|
|
7463
7463
|
if (L && !g.match(o.parenL)) return V = g.curPosition(), s;
|
|
7464
7464
|
if (_e(g.type) || g.type === o.backQuote) {
|
|
7465
|
-
var Vi = g.parseTaggedTemplateExpression(s, a,
|
|
7466
|
-
return Vi.typeParameters =
|
|
7465
|
+
var Vi = g.parseTaggedTemplateExpression(s, a, c, _);
|
|
7466
|
+
return Vi.typeParameters = Et, Vi;
|
|
7467
7467
|
}
|
|
7468
7468
|
if (!p && g.eat(o.parenL)) {
|
|
7469
|
-
var zi = new vt(), et = g.startNodeAt(a,
|
|
7470
|
-
return et.callee = s, et.arguments = g.parseExprList(o.parenR, g.options.ecmaVersion >= 8, !1, zi), g.tsCheckForInvalidTypeCasts(et.arguments), et.typeParameters =
|
|
7469
|
+
var zi = new vt(), et = g.startNodeAt(a, c);
|
|
7470
|
+
return et.callee = s, et.arguments = g.parseExprList(o.parenR, g.options.ecmaVersion >= 8, !1, zi), g.tsCheckForInvalidTypeCasts(et.arguments), et.typeParameters = Et, _ && (et.optional = L), g.checkExpressionErrors(zi, !0), s = g.finishNode(et, "CallExpression");
|
|
7471
7471
|
}
|
|
7472
7472
|
var ti = g.type;
|
|
7473
7473
|
if (!(g.tsMatchRightRelational() || ti === o.bitShift || ti !== o.parenL && (ji = ti, !!ji.startsExpr) && !g.hasPrecedingLineBreak())) {
|
|
7474
|
-
var ji, ii = g.startNodeAt(a,
|
|
7475
|
-
return ii.expression = s, ii.typeParameters =
|
|
7474
|
+
var ji, ii = g.startNodeAt(a, c);
|
|
7475
|
+
return ii.expression = s, ii.typeParameters = Et, g.finishNode(ii, "TSInstantiationExpression");
|
|
7476
7476
|
}
|
|
7477
7477
|
});
|
|
7478
7478
|
if (V && this.unexpected(V), E) return E.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start, N.InvalidPropertyAccessAfterInstantiationExpression), s = E;
|
|
@@ -7481,7 +7481,7 @@ function Fh(e) {
|
|
|
7481
7481
|
p && G && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
7482
7482
|
var X = this.eat(o.bracketL);
|
|
7483
7483
|
if (X || G && this.type !== o.parenL && this.type !== o.backQuote || this.eat(o.dot)) {
|
|
7484
|
-
var re = this.startNodeAt(a,
|
|
7484
|
+
var re = this.startNodeAt(a, c);
|
|
7485
7485
|
re.object = s, X ? (re.property = this.parseExpression(), this.expect(o.bracketR)) : re.property = this.type === o.privateId && s.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), re.computed = !!X, K && (re.optional = G), s = this.finishNode(re, "MemberExpression");
|
|
7486
7486
|
} else if (!p && this.eat(o.parenL)) {
|
|
7487
7487
|
var ve = this.maybeInArrowParameters;
|
|
@@ -7489,38 +7489,38 @@ function Fh(e) {
|
|
|
7489
7489
|
var $e = new vt(), dt = this.yieldPos, mt = this.awaitPos, Be = this.awaitIdentPos;
|
|
7490
7490
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
7491
7491
|
var Di = this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1, $e);
|
|
7492
|
-
if (m && !G && this.shouldParseAsyncArrow()) this.checkPatternErrors($e, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = dt, this.awaitPos = mt, this.awaitIdentPos = Be, s = this.parseSubscriptAsyncArrow(a,
|
|
7492
|
+
if (m && !G && this.shouldParseAsyncArrow()) this.checkPatternErrors($e, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = dt, this.awaitPos = mt, this.awaitIdentPos = Be, s = this.parseSubscriptAsyncArrow(a, c, Di, x);
|
|
7493
7493
|
else {
|
|
7494
7494
|
this.checkExpressionErrors($e, !0), this.yieldPos = dt || this.yieldPos, this.awaitPos = mt || this.awaitPos, this.awaitIdentPos = Be || this.awaitIdentPos;
|
|
7495
|
-
var
|
|
7496
|
-
|
|
7495
|
+
var At = this.startNodeAt(a, c);
|
|
7496
|
+
At.callee = s, At.arguments = Di, K && (At.optional = G), s = this.finishNode(At, "CallExpression");
|
|
7497
7497
|
}
|
|
7498
7498
|
this.maybeInArrowParameters = ve;
|
|
7499
7499
|
} else if (this.type === o.backQuote) {
|
|
7500
7500
|
(G || _) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
7501
|
-
var ei = this.startNodeAt(a,
|
|
7501
|
+
var ei = this.startNodeAt(a, c);
|
|
7502
7502
|
ei.tag = s, ei.quasi = this.parseTemplate({ isTagged: !0 }), s = this.finishNode(ei, "TaggedTemplateExpression");
|
|
7503
7503
|
}
|
|
7504
7504
|
return s;
|
|
7505
7505
|
}, f.parseGetterSetter = function(s) {
|
|
7506
7506
|
s.kind = s.key.name, this.parsePropertyName(s), s.value = this.parseMethod(!1);
|
|
7507
|
-
var a = s.kind === "get" ? 0 : 1,
|
|
7507
|
+
var a = s.kind === "get" ? 0 : 1, c = s.value.params[0], p = c && this.isThisParam(c);
|
|
7508
7508
|
s.value.params.length !== (a = p ? a + 1 : a) ? this.raiseRecoverable(s.value.start, s.kind === "get" ? "getter should have no params" : "setter should have exactly one param") : s.kind === "set" && s.value.params[0].type === "RestElement" && this.raiseRecoverable(s.value.params[0].start, "Setter cannot use rest params");
|
|
7509
7509
|
}, f.parseProperty = function(s, a) {
|
|
7510
7510
|
if (!s) {
|
|
7511
|
-
var
|
|
7512
|
-
if (this.match(D.at)) for (; this.match(D.at); )
|
|
7511
|
+
var c = [];
|
|
7512
|
+
if (this.match(D.at)) for (; this.match(D.at); ) c.push(this.parseDecorator());
|
|
7513
7513
|
var p = P.prototype.parseProperty.call(this, s, a);
|
|
7514
|
-
return p.type === "SpreadElement" &&
|
|
7514
|
+
return p.type === "SpreadElement" && c.length && this.raise(p.start, "Decorators can't be used with SpreadElement"), c.length && (p.decorators = c, c = []), p;
|
|
7515
7515
|
}
|
|
7516
7516
|
return P.prototype.parseProperty.call(this, s, a);
|
|
7517
7517
|
}, f.parseCatchClauseParam = function() {
|
|
7518
7518
|
var s = this.parseBindingAtom(), a = s.type === "Identifier";
|
|
7519
7519
|
this.enterScope(a ? 32 : 0), this.checkLValPattern(s, a ? 4 : 2);
|
|
7520
|
-
var
|
|
7521
|
-
return
|
|
7520
|
+
var c = this.tsTryParseTypeAnnotation();
|
|
7521
|
+
return c && (s.typeAnnotation = c, this.resetEndLocation(s)), this.expect(o.parenR), s;
|
|
7522
7522
|
}, f.parseClass = function(s, a) {
|
|
7523
|
-
var
|
|
7523
|
+
var c = this.inAbstractClass;
|
|
7524
7524
|
this.inAbstractClass = !!s.abstract;
|
|
7525
7525
|
try {
|
|
7526
7526
|
this.next(), this.takeDecorators(s);
|
|
@@ -7536,14 +7536,14 @@ function Fh(e) {
|
|
|
7536
7536
|
}
|
|
7537
7537
|
return this.strict = p, this.next(), g.length && this.raise(this.start, "Decorators must be attached to a class element."), s.body = this.finishNode(v, "ClassBody"), this.exitClassBody(), this.finishNode(s, a ? "ClassDeclaration" : "ClassExpression");
|
|
7538
7538
|
} finally {
|
|
7539
|
-
this.inAbstractClass =
|
|
7539
|
+
this.inAbstractClass = c;
|
|
7540
7540
|
}
|
|
7541
7541
|
}, f.parseClassFunctionParams = function() {
|
|
7542
7542
|
var s = this.tsTryParseTypeParameters(this.tsParseConstModifier), a = this.parseBindingList(o.parenR, !1, this.options.ecmaVersion >= 8, !0);
|
|
7543
7543
|
return s && (a.typeParameters = s), a;
|
|
7544
|
-
}, f.parseMethod = function(s, a,
|
|
7544
|
+
}, f.parseMethod = function(s, a, c, p, m) {
|
|
7545
7545
|
var v = this.startNode(), x = this.yieldPos, g = this.awaitPos, _ = this.awaitIdentPos;
|
|
7546
|
-
if (this.initFunction(v), this.options.ecmaVersion >= 6 && (v.generator = s), this.options.ecmaVersion >= 8 && (v.async = !!a), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | ci(a, v.generator) | (
|
|
7546
|
+
if (this.initFunction(v), this.options.ecmaVersion >= 6 && (v.generator = s), this.options.ecmaVersion >= 8 && (v.async = !!a), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | ci(a, v.generator) | (c ? 128 : 0)), this.expect(o.parenL), v.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(v, !1, !0, !1, { isClassMethod: p }), this.yieldPos = x, this.awaitPos = g, this.awaitIdentPos = _, m && m.abstract && v.body) {
|
|
7547
7547
|
var T = m.key;
|
|
7548
7548
|
this.raise(m.start, N.AbstractMethodHasImplementation({ methodName: T.type !== "Identifier" || m.computed ? "[" + this.input.slice(T.start, T.end) + "]" : T.name }));
|
|
7549
7549
|
}
|
|
@@ -7551,12 +7551,12 @@ function Fh(e) {
|
|
|
7551
7551
|
}, fe.parse = function(s, a) {
|
|
7552
7552
|
if (a.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
7553
7553
|
a.locations = !0;
|
|
7554
|
-
var
|
|
7555
|
-
return r && (
|
|
7556
|
-
}, fe.parseExpressionAt = function(s, a,
|
|
7557
|
-
if (
|
|
7558
|
-
|
|
7559
|
-
var p = new this(
|
|
7554
|
+
var c = new this(a, s);
|
|
7555
|
+
return r && (c.isAmbientContext = !0), c.parse();
|
|
7556
|
+
}, fe.parseExpressionAt = function(s, a, c) {
|
|
7557
|
+
if (c.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
7558
|
+
c.locations = !0;
|
|
7559
|
+
var p = new this(c, s, a);
|
|
7560
7560
|
return r && (p.isAmbientContext = !0), p.nextToken(), p.parseExpression();
|
|
7561
7561
|
}, f.parseImportSpecifier = function() {
|
|
7562
7562
|
if (this.ts_isContextual(D.type)) {
|
|
@@ -7568,23 +7568,23 @@ function Fh(e) {
|
|
|
7568
7568
|
}, f.parseExportSpecifier = function(s) {
|
|
7569
7569
|
var a = this.ts_isContextual(D.type);
|
|
7570
7570
|
if (!this.match(o.string) && a) {
|
|
7571
|
-
var
|
|
7572
|
-
return
|
|
7571
|
+
var c = this.startNode();
|
|
7572
|
+
return c.local = this.parseModuleExportName(), this.parseTypeOnlyImportExportSpecifier(c, !1, this.importOrExportOuterKind === "type"), this.finishNode(c, "ExportSpecifier"), this.checkExport(s, c.exported, c.exported.start), c;
|
|
7573
7573
|
}
|
|
7574
7574
|
var p = P.prototype.parseExportSpecifier.call(this, s);
|
|
7575
7575
|
return p.exportKind = "value", p;
|
|
7576
|
-
}, f.parseTypeOnlyImportExportSpecifier = function(s, a,
|
|
7576
|
+
}, f.parseTypeOnlyImportExportSpecifier = function(s, a, c) {
|
|
7577
7577
|
var p, m = a ? "imported" : "local", v = a ? "local" : "exported", x = s[m], g = !1, _ = !0, T = x.start;
|
|
7578
7578
|
if (this.isContextual("as")) {
|
|
7579
7579
|
var L = this.parseIdent();
|
|
7580
7580
|
if (this.isContextual("as")) {
|
|
7581
7581
|
var V = this.parseIdent();
|
|
7582
|
-
|
|
7583
|
-
} else
|
|
7584
|
-
} else
|
|
7585
|
-
g &&
|
|
7586
|
-
}, f.raiseCommonCheck = function(s, a,
|
|
7587
|
-
return a === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : P.prototype.raise.call(this, s, a) :
|
|
7582
|
+
Ct(this.type) ? (g = !0, x = L, p = a ? this.parseIdent() : this.parseModuleExportName(), _ = !1) : (p = V, _ = !1);
|
|
7583
|
+
} else Ct(this.type) ? (_ = !1, p = a ? this.parseIdent() : this.parseModuleExportName()) : (g = !0, x = L);
|
|
7584
|
+
} else Ct(this.type) && (g = !0, a ? (x = P.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(x)) : x = this.parseModuleExportName());
|
|
7585
|
+
g && c && this.raise(T, a ? N.TypeModifierIsUsedInTypeImports : N.TypeModifierIsUsedInTypeExports), s[m] = x, s[v] = p, s[a ? "importKind" : "exportKind"] = g ? "type" : "value", _ && this.eatContextual("as") && (s[v] = a ? this.parseIdent() : this.parseModuleExportName()), s[v] || (s[v] = this.copyNode(s[m])), a && this.checkLValSimple(s[v], 2);
|
|
7586
|
+
}, f.raiseCommonCheck = function(s, a, c) {
|
|
7587
|
+
return a === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : P.prototype.raise.call(this, s, a) : c ? P.prototype.raiseRecoverable.call(this, s, a) : P.prototype.raise.call(this, s, a);
|
|
7588
7588
|
}, f.raiseRecoverable = function(s, a) {
|
|
7589
7589
|
return this.raiseCommonCheck(s, a, !0);
|
|
7590
7590
|
}, f.raise = function(s, a) {
|
|
@@ -7592,17 +7592,17 @@ function Fh(e) {
|
|
|
7592
7592
|
}, f.updateContext = function(s) {
|
|
7593
7593
|
var a = this.type;
|
|
7594
7594
|
if (a == o.braceL) {
|
|
7595
|
-
var
|
|
7596
|
-
|
|
7595
|
+
var c = this.curContext();
|
|
7596
|
+
c == se.tc_oTag ? this.context.push(Z.b_expr) : c == se.tc_expr ? this.context.push(Z.b_tmpl) : P.prototype.updateContext.call(this, s), this.exprAllowed = !0;
|
|
7597
7597
|
} else {
|
|
7598
7598
|
if (a !== o.slash || s !== D.jsxTagStart) return P.prototype.updateContext.call(this, s);
|
|
7599
|
-
this.context.length -= 2, this.context.push(
|
|
7599
|
+
this.context.length -= 2, this.context.push(se.tc_cTag), this.exprAllowed = !1;
|
|
7600
7600
|
}
|
|
7601
7601
|
}, f.jsx_parseOpeningElementAt = function(s, a) {
|
|
7602
|
-
var
|
|
7602
|
+
var c = this, p = this.startNodeAt(s, a), m = this.jsx_parseElementName();
|
|
7603
7603
|
if (m && (p.name = m), this.match(o.relational) || this.match(o.bitShift)) {
|
|
7604
7604
|
var v = this.tsTryParseAndCatch(function() {
|
|
7605
|
-
return
|
|
7605
|
+
return c.tsParseTypeArgumentsInExpression();
|
|
7606
7606
|
});
|
|
7607
7607
|
v && (p.typeParameters = v);
|
|
7608
7608
|
}
|
|
@@ -7615,28 +7615,28 @@ function Fh(e) {
|
|
|
7615
7615
|
}, f.exitScope = function() {
|
|
7616
7616
|
P.prototype.currentScope.call(this).flags === yt && this.importsStack.pop(), P.prototype.exitScope.call(this);
|
|
7617
7617
|
}, f.hasImport = function(s, a) {
|
|
7618
|
-
var
|
|
7619
|
-
if (this.importsStack[
|
|
7620
|
-
if (!a &&
|
|
7621
|
-
for (var p = 0; p <
|
|
7618
|
+
var c = this.importsStack.length;
|
|
7619
|
+
if (this.importsStack[c - 1].indexOf(s) > -1) return !0;
|
|
7620
|
+
if (!a && c > 1) {
|
|
7621
|
+
for (var p = 0; p < c - 1; p++) if (this.importsStack[p].indexOf(s) > -1) return !0;
|
|
7622
7622
|
}
|
|
7623
7623
|
return !1;
|
|
7624
7624
|
}, f.maybeExportDefined = function(s, a) {
|
|
7625
7625
|
this.inModule && 1 & s.flags && this.undefinedExports.delete(a);
|
|
7626
|
-
}, f.isRedeclaredInScope = function(s, a,
|
|
7627
|
-
return !!(0 &
|
|
7628
|
-
}, f.checkRedeclarationInScope = function(s, a,
|
|
7629
|
-
this.isRedeclaredInScope(s, a,
|
|
7630
|
-
}, f.declareName = function(s, a,
|
|
7631
|
-
if (4096 & a) return this.hasImport(s, !0) && this.raise(
|
|
7626
|
+
}, f.isRedeclaredInScope = function(s, a, c) {
|
|
7627
|
+
return !!(0 & c) && (2 & c ? s.lexical.indexOf(a) > -1 || s.functions.indexOf(a) > -1 || s.var.indexOf(a) > -1 : 3 & c ? s.lexical.indexOf(a) > -1 || !P.prototype.treatFunctionsAsVarInScope.call(this, s) && s.var.indexOf(a) > -1 : s.lexical.indexOf(a) > -1 && !(32 & s.flags && s.lexical[0] === a) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(a) > -1);
|
|
7628
|
+
}, f.checkRedeclarationInScope = function(s, a, c, p) {
|
|
7629
|
+
this.isRedeclaredInScope(s, a, c) && this.raise(p, "Identifier '" + a + "' has already been declared.");
|
|
7630
|
+
}, f.declareName = function(s, a, c) {
|
|
7631
|
+
if (4096 & a) return this.hasImport(s, !0) && this.raise(c, "Identifier '" + s + "' has already been declared."), void this.importsStack[this.importsStack.length - 1].push(s);
|
|
7632
7632
|
var p = this.currentScope();
|
|
7633
7633
|
if (1024 & a) return this.maybeExportDefined(p, s), void p.exportOnlyBindings.push(s);
|
|
7634
|
-
P.prototype.declareName.call(this, s, a,
|
|
7634
|
+
P.prototype.declareName.call(this, s, a, c), 0 & a && (0 & a || (this.checkRedeclarationInScope(p, s, a, c), this.maybeExportDefined(p, s)), p.types.push(s)), 256 & a && p.enums.push(s), 512 & a && p.constEnums.push(s), 128 & a && p.classes.push(s);
|
|
7635
7635
|
}, f.checkLocalExport = function(s) {
|
|
7636
7636
|
var a = s.name;
|
|
7637
7637
|
if (!this.hasImport(a)) {
|
|
7638
|
-
for (var
|
|
7639
|
-
var p = this.scopeStack[
|
|
7638
|
+
for (var c = this.scopeStack.length - 1; c >= 0; c--) {
|
|
7639
|
+
var p = this.scopeStack[c];
|
|
7640
7640
|
if (p.types.indexOf(a) > -1 || p.exportOnlyBindings.indexOf(a) > -1) return;
|
|
7641
7641
|
}
|
|
7642
7642
|
P.prototype.checkLocalExport.call(this, s);
|
|
@@ -7646,7 +7646,7 @@ function Fh(e) {
|
|
|
7646
7646
|
} }], (te = [{ key: "acornTypeScript", get: function() {
|
|
7647
7647
|
return y;
|
|
7648
7648
|
} }]) && mr(ue.prototype, te), B && mr(ue, B), Object.defineProperty(ue, "prototype", { writable: !1 }), fe;
|
|
7649
|
-
})(
|
|
7649
|
+
})(h);
|
|
7650
7650
|
return Ms;
|
|
7651
7651
|
};
|
|
7652
7652
|
}
|
|
@@ -7654,16 +7654,16 @@ const $h = js(Fs);
|
|
|
7654
7654
|
async function Bh(e) {
|
|
7655
7655
|
let t;
|
|
7656
7656
|
try {
|
|
7657
|
-
t = await
|
|
7657
|
+
t = await ae.readdir(e, { withFileTypes: !0 });
|
|
7658
7658
|
} catch (i) {
|
|
7659
7659
|
if (i.code === "ENOENT") return;
|
|
7660
7660
|
throw i;
|
|
7661
7661
|
}
|
|
7662
7662
|
await Promise.all(
|
|
7663
7663
|
t.map(async (i) => {
|
|
7664
|
-
const r =
|
|
7664
|
+
const r = Dt.join(e, i.name);
|
|
7665
7665
|
try {
|
|
7666
|
-
await
|
|
7666
|
+
await ae.rm(r, { recursive: !0, force: !0 });
|
|
7667
7667
|
} catch (n) {
|
|
7668
7668
|
if (n.code !== "ENOENT") throw n;
|
|
7669
7669
|
}
|
|
@@ -7678,20 +7678,20 @@ function Li(e) {
|
|
|
7678
7678
|
}), r = [];
|
|
7679
7679
|
return vi(i, (n) => {
|
|
7680
7680
|
if (n.type !== "MethodDefinition") return;
|
|
7681
|
-
const u = n,
|
|
7682
|
-
if (
|
|
7683
|
-
const d =
|
|
7681
|
+
const u = n, h = u.key;
|
|
7682
|
+
if (h.type !== "Identifier") return;
|
|
7683
|
+
const d = h.name;
|
|
7684
7684
|
d && d !== "constructor" && u.accessibility !== "private" && r.push(d);
|
|
7685
7685
|
}), r;
|
|
7686
7686
|
}
|
|
7687
7687
|
async function Te(e, t, i = [], r) {
|
|
7688
7688
|
const n = `${t} ${i.join(" ")}`;
|
|
7689
7689
|
e !== void 0 && ie(`${e} - exec(${n})`);
|
|
7690
|
-
const { stdout: u, stderr:
|
|
7691
|
-
r === void 0 ? u.trim() && console.log(u.trim()) : await
|
|
7690
|
+
const { stdout: u, stderr: h } = await $h(n);
|
|
7691
|
+
r === void 0 ? u.trim() && console.log(u.trim()) : await ae.writeFile(r, u.trim(), "utf8"), h.trim() && console.error(h.trim());
|
|
7692
7692
|
}
|
|
7693
7693
|
async function Zh(e, t) {
|
|
7694
|
-
return
|
|
7694
|
+
return ae.readdir(e, t);
|
|
7695
7695
|
}
|
|
7696
7696
|
async function Oi() {
|
|
7697
7697
|
ie("Load environment variables"), (await import("dotenv")).config();
|
|
@@ -7712,14 +7712,14 @@ ${e}
|
|
|
7712
7712
|
`);
|
|
7713
7713
|
}
|
|
7714
7714
|
async function me(e) {
|
|
7715
|
-
return JSON.parse(await
|
|
7715
|
+
return JSON.parse(await ae.readFile(e, "utf8"));
|
|
7716
7716
|
}
|
|
7717
|
-
async function
|
|
7718
|
-
return await
|
|
7717
|
+
async function Pt(e) {
|
|
7718
|
+
return await ae.readFile(e, "utf8");
|
|
7719
7719
|
}
|
|
7720
7720
|
async function Uh(e) {
|
|
7721
7721
|
try {
|
|
7722
|
-
await
|
|
7722
|
+
await ae.unlink(e);
|
|
7723
7723
|
} catch (t) {
|
|
7724
7724
|
if (t.code !== "ENOENT") throw t;
|
|
7725
7725
|
}
|
|
@@ -7733,37 +7733,20 @@ async function Le(e, t, i = [], r = !1) {
|
|
|
7733
7733
|
}
|
|
7734
7734
|
async function fl() {
|
|
7735
7735
|
Ne("Synchronise .editorconfig");
|
|
7736
|
-
const e =
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
await se.access(c), i = c;
|
|
7741
|
-
break;
|
|
7742
|
-
} catch (d) {
|
|
7743
|
-
if (d.code !== "ENOENT") throw d;
|
|
7744
|
-
}
|
|
7745
|
-
if (i === void 0)
|
|
7746
|
-
throw new Error("Unable to locate default.editorconfig template.");
|
|
7747
|
-
const r = xt.resolve(process.cwd(), ".editorconfig");
|
|
7748
|
-
ie(`Template: ${i}`), ie(`Destination: ${r}`);
|
|
7749
|
-
const n = await se.readFile(i, "utf8");
|
|
7750
|
-
let u;
|
|
7751
|
-
try {
|
|
7752
|
-
u = await se.readFile(r, "utf8");
|
|
7753
|
-
} catch (c) {
|
|
7754
|
-
if (c.code !== "ENOENT") throw c;
|
|
7755
|
-
}
|
|
7756
|
-
if (u === n) {
|
|
7736
|
+
const e = Dt.dirname(Pr(import.meta.url)), t = Dt.resolve(e, "../../.editorconfig"), i = Dt.resolve(process.cwd(), ".editorconfig");
|
|
7737
|
+
ie(`Template: ${t}`), ie(`Destination: ${i}`);
|
|
7738
|
+
const r = await ae.readFile(t, "utf8");
|
|
7739
|
+
if (await ae.readFile(i, "utf8") === r) {
|
|
7757
7740
|
Ie(".editorconfig already up to date.");
|
|
7758
7741
|
return;
|
|
7759
7742
|
}
|
|
7760
|
-
await
|
|
7743
|
+
await ae.writeFile(i, r, "utf8"), Ie(".editorconfig synchronised.");
|
|
7761
7744
|
}
|
|
7762
7745
|
async function ut(e, t) {
|
|
7763
|
-
await
|
|
7746
|
+
await ae.writeFile(e, JSON.stringify(t, void 0, 4), "utf8");
|
|
7764
7747
|
}
|
|
7765
7748
|
async function Ri(e, t) {
|
|
7766
|
-
await
|
|
7749
|
+
await ae.writeFile(e, t, "utf8");
|
|
7767
7750
|
}
|
|
7768
7751
|
function vi(e, t) {
|
|
7769
7752
|
t(e);
|
|
@@ -7772,8 +7755,8 @@ function vi(e, t) {
|
|
|
7772
7755
|
const n = r;
|
|
7773
7756
|
if (Array.isArray(n))
|
|
7774
7757
|
for (const u of n) {
|
|
7775
|
-
const
|
|
7776
|
-
|
|
7758
|
+
const h = u;
|
|
7759
|
+
h && typeof h.type == "string" && vi(h, t);
|
|
7777
7760
|
}
|
|
7778
7761
|
else n && typeof n == "object" && typeof n.type == "string" && vi(n, t);
|
|
7779
7762
|
}
|
|
@@ -7797,8 +7780,8 @@ async function kr(e) {
|
|
|
7797
7780
|
async function wr(e, t) {
|
|
7798
7781
|
const i = `v${e.version}`;
|
|
7799
7782
|
async function r(n, u = "") {
|
|
7800
|
-
const
|
|
7801
|
-
for (const d of
|
|
7783
|
+
const h = await Zh(n, { withFileTypes: !0 });
|
|
7784
|
+
for (const d of h) {
|
|
7802
7785
|
const y = `${n}/${d.name}`, o = u ? `${u}/${d.name}` : d.name;
|
|
7803
7786
|
if (d.isDirectory()) continue;
|
|
7804
7787
|
const w = `${t}_${i}/${o}`.replaceAll("\\", "/"), S = d.name.endsWith(".css") ? "text/css" : "application/octet-stream", A = d.name.endsWith(".js") ? "application/javascript" : S;
|
|
@@ -7897,17 +7880,17 @@ async function Gh(e, t) {
|
|
|
7897
7880
|
}
|
|
7898
7881
|
async function Wh(e, t) {
|
|
7899
7882
|
ie(`${e} Build connector project configuration`);
|
|
7900
|
-
const [i, r] = await Promise.all([me("config.json"),
|
|
7883
|
+
const [i, r] = await Promise.all([me("config.json"), Pt("src/index.ts")]), n = kc.safeParse(i);
|
|
7901
7884
|
if (!n.success) {
|
|
7902
7885
|
console.log("❌ Configuration is invalid:"), console.table(n.error.issues);
|
|
7903
7886
|
return;
|
|
7904
7887
|
}
|
|
7905
|
-
const u = Li(r),
|
|
7906
|
-
u.length > 0 ? (console.info(`ℹ️ Implements ${u.length} operations:`), console.table(u)) : console.warn("⚠️ Implements no operations."),
|
|
7888
|
+
const u = Li(r), h = Jh(u);
|
|
7889
|
+
u.length > 0 ? (console.info(`ℹ️ Implements ${u.length} operations:`), console.table(u)) : console.warn("⚠️ Implements no operations."), h === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${h}' usage.`), t.name != null && (i.id = t.name.replace("@datapos/", "").replace("@data-positioning/", "")), t.version != null && (i.version = t.version), i.operations = u, i.usageId = h, await ut("config.json", i);
|
|
7907
7890
|
}
|
|
7908
7891
|
async function Kh(e, t) {
|
|
7909
7892
|
ie(`${e} Build context project configuration`);
|
|
7910
|
-
const [i, r] = await Promise.all([me("config.json"),
|
|
7893
|
+
const [i, r] = await Promise.all([me("config.json"), Pt("src/index.ts")]), n = Lc.safeParse(i);
|
|
7911
7894
|
if (!n.success) {
|
|
7912
7895
|
console.log("❌ Configuration is invalid:"), console.table(n.error.issues);
|
|
7913
7896
|
return;
|
|
@@ -7917,7 +7900,7 @@ async function Kh(e, t) {
|
|
|
7917
7900
|
}
|
|
7918
7901
|
async function Xh(e, t) {
|
|
7919
7902
|
ie(`${e} Build presenter project configuration`);
|
|
7920
|
-
const [i, r] = await Promise.all([me("config.json"),
|
|
7903
|
+
const [i, r] = await Promise.all([me("config.json"), Pt("src/index.ts")]), n = Bc.safeParse(i);
|
|
7921
7904
|
if (!n.success) {
|
|
7922
7905
|
console.log("❌ Configuration is invalid:"), console.table(n.error.issues);
|
|
7923
7906
|
return;
|
|
@@ -7974,12 +7957,12 @@ async function el(e) {
|
|
|
7974
7957
|
const S = w.severity?.toLowerCase() ?? "unknown";
|
|
7975
7958
|
S in i ? i[S]++ : i.unknown++;
|
|
7976
7959
|
}
|
|
7977
|
-
const r = await tl(i), n = await
|
|
7978
|
-
if (u === -1 ||
|
|
7960
|
+
const r = await tl(i), n = await Pt("./README.md"), u = n.indexOf(Sr), h = n.indexOf(Qh);
|
|
7961
|
+
if (u === -1 || h === -1) {
|
|
7979
7962
|
console.error("❌ No OWASP badge markers found in 'README.md'.");
|
|
7980
7963
|
return;
|
|
7981
7964
|
}
|
|
7982
|
-
const d = r.join(" "), y = n.slice(0, Math.max(0, u + Sr.length)) + d + n.slice(Math.max(0,
|
|
7965
|
+
const d = r.join(" "), y = n.slice(0, Math.max(0, u + Sr.length)) + d + n.slice(Math.max(0, h));
|
|
7983
7966
|
await Ri("README.md", y), console.info("OWASP audit badge(s) inserted into 'README.md'");
|
|
7984
7967
|
}
|
|
7985
7968
|
async function tl(e) {
|
|
@@ -7988,9 +7971,9 @@ async function tl(e) {
|
|
|
7988
7971
|
console.info("No vulnerabilities found."), i.push(`[](https://data-positioning.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
7989
7972
|
else
|
|
7990
7973
|
for (const [n, u] of Object.entries(e)) {
|
|
7991
|
-
const
|
|
7992
|
-
if (console.warn(`⚠️ ${u} ${
|
|
7993
|
-
const d = `https://img.shields.io/badge/OWASP-${u}%20${
|
|
7974
|
+
const h = Yh[n];
|
|
7975
|
+
if (console.warn(`⚠️ ${u} ${h.label} vulnerability(ies) found.`), u === 0) continue;
|
|
7976
|
+
const d = `https://img.shields.io/badge/OWASP-${u}%20${h.label}-${h.color}`;
|
|
7994
7977
|
i.push(`[](https://data-positioning.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
7995
7978
|
}
|
|
7996
7979
|
return i;
|
|
@@ -8032,12 +8015,12 @@ async function bl(e = [], t = !0) {
|
|
|
8032
8015
|
}
|
|
8033
8016
|
async function rl(e, t) {
|
|
8034
8017
|
ie(`${e} Insert licenses into 'README.md'`);
|
|
8035
|
-
const i = await
|
|
8018
|
+
const i = await Pt("./README.md"), r = i.indexOf(Tr), n = i.indexOf(il);
|
|
8036
8019
|
if (r === -1 || n === -1) {
|
|
8037
8020
|
console.error("❌ No dependency license markers found in 'README.md'.");
|
|
8038
8021
|
return;
|
|
8039
8022
|
}
|
|
8040
|
-
const u = await me("licenses/licenses.json"),
|
|
8023
|
+
const u = await me("licenses/licenses.json"), h = await me("licenses/downloads/licenses.ext.json");
|
|
8041
8024
|
let d = [];
|
|
8042
8025
|
t && (d = await me("licenses/licenseTree.json"));
|
|
8043
8026
|
const y = [
|
|
@@ -8045,7 +8028,7 @@ async function rl(e, t) {
|
|
|
8045
8028
|
const S = /* @__PURE__ */ new Map();
|
|
8046
8029
|
for (const A of u)
|
|
8047
8030
|
S.set(A.name, { ...A });
|
|
8048
|
-
for (const A of
|
|
8031
|
+
for (const A of h) {
|
|
8049
8032
|
const F = S.get(A.name);
|
|
8050
8033
|
S.set(A.name, F ? { ...F, ...A } : { ...A });
|
|
8051
8034
|
}
|
|
@@ -8111,30 +8094,30 @@ async function Sl(e) {
|
|
|
8111
8094
|
const t = {};
|
|
8112
8095
|
async function i(n, u) {
|
|
8113
8096
|
console.info(`⚙️ Processing directory '${n}'...`);
|
|
8114
|
-
const
|
|
8115
|
-
t[d === "" ? "/" : d] =
|
|
8097
|
+
const h = [], d = n.slice(`public/${e}`.length);
|
|
8098
|
+
t[d === "" ? "/" : d] = h;
|
|
8116
8099
|
for (const y of u) {
|
|
8117
8100
|
const o = `${n}/${y}`;
|
|
8118
8101
|
try {
|
|
8119
|
-
const w = await
|
|
8102
|
+
const w = await ae.stat(o);
|
|
8120
8103
|
if (w.isDirectory()) {
|
|
8121
|
-
const S = await
|
|
8122
|
-
|
|
8104
|
+
const S = await ae.readdir(o), A = { childCount: S.length, name: y, typeId: "folder" };
|
|
8105
|
+
h.push(A), await i(o, S);
|
|
8123
8106
|
} else {
|
|
8124
8107
|
const S = { id: Vs(), lastModifiedAt: w.mtimeMs, name: y, size: w.size, typeId: "object" };
|
|
8125
|
-
|
|
8108
|
+
h.push(S);
|
|
8126
8109
|
}
|
|
8127
8110
|
} catch (w) {
|
|
8128
8111
|
throw new Error(`Unable to get information for '${y}' in 'buildPublicDirectoryIndex'. ${String(w)}`);
|
|
8129
8112
|
}
|
|
8130
8113
|
}
|
|
8131
|
-
|
|
8114
|
+
h.sort((y, o) => {
|
|
8132
8115
|
const w = y.typeId.localeCompare(o.typeId);
|
|
8133
8116
|
return w === 0 ? y.name.localeCompare(o.name) : w;
|
|
8134
8117
|
});
|
|
8135
8118
|
}
|
|
8136
|
-
const r = await
|
|
8137
|
-
await i(`public/${e}`, r), await
|
|
8119
|
+
const r = await ae.readdir(`public/${e}`);
|
|
8120
|
+
await i(`public/${e}`, r), await ae.writeFile(`./public/${e}Index.json`, JSON.stringify(t), "utf8"), console.info("✅ Public directory index built.");
|
|
8138
8121
|
} catch (t) {
|
|
8139
8122
|
console.error("❌ Error building public directory index.", t);
|
|
8140
8123
|
}
|