@datapos/datapos-development 0.3.310 → 0.3.311
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,4 +1,4 @@
|
|
|
1
|
-
import { promises as
|
|
1
|
+
import { promises as Ee } from "node:fs";
|
|
2
2
|
import { nanoid as Ds } from "nanoid";
|
|
3
3
|
import { promisify as Ms } from "node:util";
|
|
4
4
|
import { exec as Vs, spawn as zs } from "node:child_process";
|
|
@@ -103,7 +103,7 @@ function U(e, t, i) {
|
|
|
103
103
|
configurable: !0
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Xe(e, t, i) {
|
|
107
107
|
Object.defineProperty(e, t, {
|
|
108
108
|
value: i,
|
|
109
109
|
writable: !0,
|
|
@@ -111,7 +111,7 @@ function Je(e, t, i) {
|
|
|
111
111
|
configurable: !0
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Je(...e) {
|
|
115
115
|
const t = {};
|
|
116
116
|
for (const i of e) {
|
|
117
117
|
const r = Object.getOwnPropertyDescriptors(i);
|
|
@@ -183,8 +183,8 @@ const Gs = {
|
|
|
183
183
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
184
184
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
185
185
|
};
|
|
186
|
-
function
|
|
187
|
-
const i = e._zod.def, r =
|
|
186
|
+
function Xs(e, t) {
|
|
187
|
+
const i = e._zod.def, r = Je(e._zod.def, {
|
|
188
188
|
get shape() {
|
|
189
189
|
const n = {};
|
|
190
190
|
for (const u in t) {
|
|
@@ -192,14 +192,14 @@ function Js(e, t) {
|
|
|
192
192
|
throw new Error(`Unrecognized key: "${u}"`);
|
|
193
193
|
t[u] && (n[u] = i.shape[u]);
|
|
194
194
|
}
|
|
195
|
-
return
|
|
195
|
+
return Xe(this, "shape", n), n;
|
|
196
196
|
},
|
|
197
197
|
checks: []
|
|
198
198
|
});
|
|
199
199
|
return We(e, r);
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
const i = e._zod.def, r =
|
|
201
|
+
function Js(e, t) {
|
|
202
|
+
const i = e._zod.def, r = Je(e._zod.def, {
|
|
203
203
|
get shape() {
|
|
204
204
|
const n = { ...e._zod.def.shape };
|
|
205
205
|
for (const u in t) {
|
|
@@ -207,7 +207,7 @@ function Xs(e, t) {
|
|
|
207
207
|
throw new Error(`Unrecognized key: "${u}"`);
|
|
208
208
|
t[u] && delete n[u];
|
|
209
209
|
}
|
|
210
|
-
return
|
|
210
|
+
return Xe(this, "shape", n), n;
|
|
211
211
|
},
|
|
212
212
|
checks: []
|
|
213
213
|
});
|
|
@@ -219,10 +219,10 @@ function Ys(e, t) {
|
|
|
219
219
|
const i = e._zod.def.checks;
|
|
220
220
|
if (i && i.length > 0)
|
|
221
221
|
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
222
|
-
const n =
|
|
222
|
+
const n = Je(e._zod.def, {
|
|
223
223
|
get shape() {
|
|
224
224
|
const u = { ...e._zod.def.shape, ...t };
|
|
225
|
-
return
|
|
225
|
+
return Xe(this, "shape", u), u;
|
|
226
226
|
},
|
|
227
227
|
checks: []
|
|
228
228
|
});
|
|
@@ -235,17 +235,17 @@ function Qs(e, t) {
|
|
|
235
235
|
...e._zod.def,
|
|
236
236
|
get shape() {
|
|
237
237
|
const r = { ...e._zod.def.shape, ...t };
|
|
238
|
-
return
|
|
238
|
+
return Xe(this, "shape", r), r;
|
|
239
239
|
},
|
|
240
240
|
checks: e._zod.def.checks
|
|
241
241
|
};
|
|
242
242
|
return We(e, i);
|
|
243
243
|
}
|
|
244
244
|
function en(e, t) {
|
|
245
|
-
const i =
|
|
245
|
+
const i = Je(e._zod.def, {
|
|
246
246
|
get shape() {
|
|
247
247
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
248
|
-
return
|
|
248
|
+
return Xe(this, "shape", r), r;
|
|
249
249
|
},
|
|
250
250
|
get catchall() {
|
|
251
251
|
return t._zod.def.catchall;
|
|
@@ -256,7 +256,7 @@ function en(e, t) {
|
|
|
256
256
|
return We(e, i);
|
|
257
257
|
}
|
|
258
258
|
function tn(e, t, i) {
|
|
259
|
-
const r =
|
|
259
|
+
const r = Je(t._zod.def, {
|
|
260
260
|
get shape() {
|
|
261
261
|
const n = t._zod.def.shape, u = { ...n };
|
|
262
262
|
if (i)
|
|
@@ -274,14 +274,14 @@ function tn(e, t, i) {
|
|
|
274
274
|
type: "optional",
|
|
275
275
|
innerType: n[h]
|
|
276
276
|
}) : n[h];
|
|
277
|
-
return
|
|
277
|
+
return Xe(this, "shape", u), u;
|
|
278
278
|
},
|
|
279
279
|
checks: []
|
|
280
280
|
});
|
|
281
281
|
return We(t, r);
|
|
282
282
|
}
|
|
283
283
|
function rn(e, t, i) {
|
|
284
|
-
const r =
|
|
284
|
+
const r = Je(t._zod.def, {
|
|
285
285
|
get shape() {
|
|
286
286
|
const n = t._zod.def.shape, u = { ...n };
|
|
287
287
|
if (i)
|
|
@@ -299,7 +299,7 @@ function rn(e, t, i) {
|
|
|
299
299
|
type: "nonoptional",
|
|
300
300
|
innerType: n[h]
|
|
301
301
|
});
|
|
302
|
-
return
|
|
302
|
+
return Xe(this, "shape", u), u;
|
|
303
303
|
},
|
|
304
304
|
checks: []
|
|
305
305
|
});
|
|
@@ -662,7 +662,7 @@ const Mn = (e) => {
|
|
|
662
662
|
t.pattern ?? (t.pattern = $n), Ht.init(e, t);
|
|
663
663
|
}), Gn = /* @__PURE__ */ k("$ZodCheckUpperCase", (e, t) => {
|
|
664
664
|
t.pattern ?? (t.pattern = Fn), Ht.init(e, t);
|
|
665
|
-
}),
|
|
665
|
+
}), Xn = /* @__PURE__ */ k("$ZodCheckIncludes", (e, t) => {
|
|
666
666
|
me.init(e, t);
|
|
667
667
|
const i = nt(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${i}` : i);
|
|
668
668
|
t.pattern = r, e._zod.onattach.push((n) => {
|
|
@@ -679,7 +679,7 @@ const Mn = (e) => {
|
|
|
679
679
|
continue: !t.abort
|
|
680
680
|
});
|
|
681
681
|
};
|
|
682
|
-
}),
|
|
682
|
+
}), Jn = /* @__PURE__ */ k("$ZodCheckStartsWith", (e, t) => {
|
|
683
683
|
me.init(e, t);
|
|
684
684
|
const i = new RegExp(`^${nt(t.prefix)}.*`);
|
|
685
685
|
t.pattern ?? (t.pattern = i), e._zod.onattach.push((r) => {
|
|
@@ -1168,14 +1168,14 @@ const La = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1168
1168
|
const S = [], w = h.shape;
|
|
1169
1169
|
for (const C of h.keys) {
|
|
1170
1170
|
const Z = w[C]._zod.run({ value: o[C], issues: [] }, y);
|
|
1171
|
-
Z instanceof Promise ? S.push(Z.then((
|
|
1171
|
+
Z instanceof Promise ? S.push(Z.then((le) => Mt(le, d, C, o))) : Mt(Z, d, C, o);
|
|
1172
1172
|
}
|
|
1173
1173
|
return u ? jr(S, o, d, y, r.value, e) : S.length ? Promise.all(S).then(() => d) : d;
|
|
1174
1174
|
};
|
|
1175
1175
|
}), Oa = /* @__PURE__ */ k("$ZodObjectJIT", (e, t) => {
|
|
1176
1176
|
La.init(e, t);
|
|
1177
1177
|
const i = e._zod.parse, r = vi(() => zr(t)), n = (C) => {
|
|
1178
|
-
const j = new ea(["shape", "payload", "ctx"]), Z = r.value,
|
|
1178
|
+
const j = new ea(["shape", "payload", "ctx"]), Z = r.value, le = (Ce) => {
|
|
1179
1179
|
const be = zi(Ce);
|
|
1180
1180
|
return `shape[${be}]._zod.run({ value: input[${be}], issues: [] }, ctx)`;
|
|
1181
1181
|
};
|
|
@@ -1187,7 +1187,7 @@ const La = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1187
1187
|
j.write("const newResult = {};");
|
|
1188
1188
|
for (const Ce of Z.keys) {
|
|
1189
1189
|
const be = D[Ce], Ge = zi(Ce);
|
|
1190
|
-
j.write(`const ${be} = ${
|
|
1190
|
+
j.write(`const ${be} = ${le(Ce)};`), j.write(`
|
|
1191
1191
|
if (${be}.issues.length) {
|
|
1192
1192
|
payload.issues = payload.issues.concat(${be}.issues.map(iss => ({
|
|
1193
1193
|
...iss,
|
|
@@ -1563,12 +1563,12 @@ class Ga {
|
|
|
1563
1563
|
return this._map.has(t);
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function Xa() {
|
|
1567
1567
|
return new Ga();
|
|
1568
1568
|
}
|
|
1569
|
-
(Ki = globalThis).__zod_globalRegistry ?? (Ki.__zod_globalRegistry =
|
|
1569
|
+
(Ki = globalThis).__zod_globalRegistry ?? (Ki.__zod_globalRegistry = Xa());
|
|
1570
1570
|
const Lt = globalThis.__zod_globalRegistry;
|
|
1571
|
-
function
|
|
1571
|
+
function Ja(e, t) {
|
|
1572
1572
|
return new e({
|
|
1573
1573
|
type: "string",
|
|
1574
1574
|
...R(t)
|
|
@@ -1844,7 +1844,7 @@ function Ao(e, t) {
|
|
|
1844
1844
|
...R(t)
|
|
1845
1845
|
});
|
|
1846
1846
|
}
|
|
1847
|
-
function
|
|
1847
|
+
function Xi(e, t) {
|
|
1848
1848
|
return new Rr({
|
|
1849
1849
|
check: "less_than",
|
|
1850
1850
|
...R(t),
|
|
@@ -1860,7 +1860,7 @@ function ii(e, t) {
|
|
|
1860
1860
|
inclusive: !0
|
|
1861
1861
|
});
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1863
|
+
function Ji(e, t) {
|
|
1864
1864
|
return new Dr({
|
|
1865
1865
|
check: "greater_than",
|
|
1866
1866
|
...R(t),
|
|
@@ -1927,7 +1927,7 @@ function No(e) {
|
|
|
1927
1927
|
});
|
|
1928
1928
|
}
|
|
1929
1929
|
function Lo(e, t) {
|
|
1930
|
-
return new
|
|
1930
|
+
return new Xn({
|
|
1931
1931
|
check: "string_format",
|
|
1932
1932
|
format: "includes",
|
|
1933
1933
|
...R(t),
|
|
@@ -1935,7 +1935,7 @@ function Lo(e, t) {
|
|
|
1935
1935
|
});
|
|
1936
1936
|
}
|
|
1937
1937
|
function Oo(e, t) {
|
|
1938
|
-
return new
|
|
1938
|
+
return new Jn({
|
|
1939
1939
|
check: "string_format",
|
|
1940
1940
|
format: "starts_with",
|
|
1941
1941
|
...R(t),
|
|
@@ -2025,11 +2025,11 @@ const Ko = /* @__PURE__ */ k("ZodISOTime", (e, t) => {
|
|
|
2025
2025
|
function Go(e) {
|
|
2026
2026
|
return ko(Ko, e);
|
|
2027
2027
|
}
|
|
2028
|
-
const
|
|
2028
|
+
const Xo = /* @__PURE__ */ k("ZodISODuration", (e, t) => {
|
|
2029
2029
|
ya.init(e, t), Q.init(e, t);
|
|
2030
2030
|
});
|
|
2031
|
-
function
|
|
2032
|
-
return So(
|
|
2031
|
+
function Jo(e) {
|
|
2032
|
+
return So(Xo, e);
|
|
2033
2033
|
}
|
|
2034
2034
|
const Yo = (e, t) => {
|
|
2035
2035
|
Ar.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
@@ -2062,12 +2062,12 @@ const Yo = (e, t) => {
|
|
|
2062
2062
|
});
|
|
2063
2063
|
}, Te = k("ZodError", Yo, {
|
|
2064
2064
|
Parent: Error
|
|
2065
|
-
}), Qo = /* @__PURE__ */ _i(Te), eu = /* @__PURE__ */ ki(Te), tu = /* @__PURE__ */ Ut(Te), iu = /* @__PURE__ */ qt(Te), ru = /* @__PURE__ */ un(Te), su = /* @__PURE__ */ cn(Te), nu = /* @__PURE__ */ hn(Te), au = /* @__PURE__ */ ln(Te), ou = /* @__PURE__ */ pn(Te), uu = /* @__PURE__ */ fn(Te), cu = /* @__PURE__ */ dn(Te), hu = /* @__PURE__ */ mn(Te), ee = /* @__PURE__ */ k("ZodType", (e, t) => (Y.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...i) => e.clone(
|
|
2065
|
+
}), Qo = /* @__PURE__ */ _i(Te), eu = /* @__PURE__ */ ki(Te), tu = /* @__PURE__ */ Ut(Te), iu = /* @__PURE__ */ qt(Te), ru = /* @__PURE__ */ un(Te), su = /* @__PURE__ */ cn(Te), nu = /* @__PURE__ */ hn(Te), au = /* @__PURE__ */ ln(Te), ou = /* @__PURE__ */ pn(Te), uu = /* @__PURE__ */ fn(Te), cu = /* @__PURE__ */ dn(Te), hu = /* @__PURE__ */ mn(Te), ee = /* @__PURE__ */ k("ZodType", (e, t) => (Y.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...i) => e.clone(Je(t, {
|
|
2066
2066
|
checks: [
|
|
2067
2067
|
...t.checks ?? [],
|
|
2068
2068
|
...i.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2069
2069
|
]
|
|
2070
|
-
})), e.clone = (i, r) => We(e, i, r), e.brand = () => e, e.register = ((i, r) => (i.add(e, r), e)), e.parse = (i, r) => Qo(e, i, r, { callee: e.parse }), e.safeParse = (i, r) => tu(e, i, r), e.parseAsync = async (i, r) => eu(e, i, r, { callee: e.parseAsync }), e.safeParseAsync = async (i, r) => iu(e, i, r), e.spa = e.safeParseAsync, e.encode = (i, r) => ru(e, i, r), e.decode = (i, r) => su(e, i, r), e.encodeAsync = async (i, r) => nu(e, i, r), e.decodeAsync = async (i, r) => au(e, i, r), e.safeEncode = (i, r) => ou(e, i, r), e.safeDecode = (i, r) => uu(e, i, r), e.safeEncodeAsync = async (i, r) => cu(e, i, r), e.safeDecodeAsync = async (i, r) => hu(e, i, r), e.refine = (i, r) => e.check(ic(i, r)), e.superRefine = (i) => e.check(rc(i)), e.overwrite = (i) => e.check(ct(i)), e.optional = () => ir(e), e.nullable = () => rr(e), e.nullish = () => ir(rr(e)), e.nonoptional = (i) => Gu(e, i), e.array = () => He(e), e.or = (i) => ae([e, i]), e.and = (i) => ju(e, i), e.transform = (i) => sr(e, Zu(i)), e.default = (i) => Hu(e, i), e.prefault = (i) => Ku(e, i), e.catch = (i) =>
|
|
2070
|
+
})), e.clone = (i, r) => We(e, i, r), e.brand = () => e, e.register = ((i, r) => (i.add(e, r), e)), e.parse = (i, r) => Qo(e, i, r, { callee: e.parse }), e.safeParse = (i, r) => tu(e, i, r), e.parseAsync = async (i, r) => eu(e, i, r, { callee: e.parseAsync }), e.safeParseAsync = async (i, r) => iu(e, i, r), e.spa = e.safeParseAsync, e.encode = (i, r) => ru(e, i, r), e.decode = (i, r) => su(e, i, r), e.encodeAsync = async (i, r) => nu(e, i, r), e.decodeAsync = async (i, r) => au(e, i, r), e.safeEncode = (i, r) => ou(e, i, r), e.safeDecode = (i, r) => uu(e, i, r), e.safeEncodeAsync = async (i, r) => cu(e, i, r), e.safeDecodeAsync = async (i, r) => hu(e, i, r), e.refine = (i, r) => e.check(ic(i, r)), e.superRefine = (i) => e.check(rc(i)), e.overwrite = (i) => e.check(ct(i)), e.optional = () => ir(e), e.nullable = () => rr(e), e.nullish = () => ir(rr(e)), e.nonoptional = (i) => Gu(e, i), e.array = () => He(e), e.or = (i) => ae([e, i]), e.and = (i) => ju(e, i), e.transform = (i) => sr(e, Zu(i)), e.default = (i) => Hu(e, i), e.prefault = (i) => Ku(e, i), e.catch = (i) => Ju(e, i), e.pipe = (i) => sr(e, i), e.readonly = () => ec(e), e.describe = (i) => {
|
|
2071
2071
|
const r = e.clone();
|
|
2072
2072
|
return Lt.add(r, { description: i }), r;
|
|
2073
2073
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2085,10 +2085,10 @@ const Yo = (e, t) => {
|
|
|
2085
2085
|
const i = e._zod.bag;
|
|
2086
2086
|
e.format = i.format ?? null, e.minLength = i.minimum ?? null, e.maxLength = i.maximum ?? null, e.regex = (...r) => e.check(Eo(...r)), e.includes = (...r) => e.check(Lo(...r)), e.startsWith = (...r) => e.check(Oo(...r)), e.endsWith = (...r) => e.check(Ro(...r)), e.min = (...r) => e.check(Vt(...r)), e.max = (...r) => e.check($r(...r)), e.length = (...r) => e.check(Fr(...r)), e.nonempty = (...r) => e.check(Vt(1, ...r)), e.lowercase = (r) => e.check(Io(r)), e.uppercase = (r) => e.check(No(r)), e.trim = () => e.check(Mo()), e.normalize = (...r) => e.check(Do(...r)), e.toLowerCase = () => e.check(Vo()), e.toUpperCase = () => e.check(zo()), e.slugify = () => e.check(jo());
|
|
2087
2087
|
}), lu = /* @__PURE__ */ k("ZodString", (e, t) => {
|
|
2088
|
-
Si.init(e, t), Br.init(e, t), e.email = (i) => e.check(Ya(pu, i)), e.url = (i) => e.check(ro(fu, i)), e.jwt = (i) => e.check(go(Au, i)), e.emoji = (i) => e.check(so(du, i)), e.guid = (i) => e.check(Gi(Qi, i)), e.uuid = (i) => e.check(Qa(Ot, i)), e.uuidv4 = (i) => e.check(eo(Ot, i)), e.uuidv6 = (i) => e.check(to(Ot, i)), e.uuidv7 = (i) => e.check(io(Ot, i)), e.nanoid = (i) => e.check(no(mu, i)), e.guid = (i) => e.check(Gi(Qi, i)), e.cuid = (i) => e.check(ao(yu, i)), e.cuid2 = (i) => e.check(oo(vu, i)), e.ulid = (i) => e.check(uo(xu, i)), e.base64 = (i) => e.check(yo(Tu, i)), e.base64url = (i) => e.check(vo(Pu, i)), e.xid = (i) => e.check(co(gu, i)), e.ksuid = (i) => e.check(ho(bu, i)), e.ipv4 = (i) => e.check(lo(_u, i)), e.ipv6 = (i) => e.check(po(ku, i)), e.cidrv4 = (i) => e.check(fo(Su, i)), e.cidrv6 = (i) => e.check(mo(wu, i)), e.e164 = (i) => e.check(xo(Cu, i)), e.datetime = (i) => e.check(qo(i)), e.date = (i) => e.check(Wo(i)), e.time = (i) => e.check(Go(i)), e.duration = (i) => e.check(
|
|
2088
|
+
Si.init(e, t), Br.init(e, t), e.email = (i) => e.check(Ya(pu, i)), e.url = (i) => e.check(ro(fu, i)), e.jwt = (i) => e.check(go(Au, i)), e.emoji = (i) => e.check(so(du, i)), e.guid = (i) => e.check(Gi(Qi, i)), e.uuid = (i) => e.check(Qa(Ot, i)), e.uuidv4 = (i) => e.check(eo(Ot, i)), e.uuidv6 = (i) => e.check(to(Ot, i)), e.uuidv7 = (i) => e.check(io(Ot, i)), e.nanoid = (i) => e.check(no(mu, i)), e.guid = (i) => e.check(Gi(Qi, i)), e.cuid = (i) => e.check(ao(yu, i)), e.cuid2 = (i) => e.check(oo(vu, i)), e.ulid = (i) => e.check(uo(xu, i)), e.base64 = (i) => e.check(yo(Tu, i)), e.base64url = (i) => e.check(vo(Pu, i)), e.xid = (i) => e.check(co(gu, i)), e.ksuid = (i) => e.check(ho(bu, i)), e.ipv4 = (i) => e.check(lo(_u, i)), e.ipv6 = (i) => e.check(po(ku, i)), e.cidrv4 = (i) => e.check(fo(Su, i)), e.cidrv6 = (i) => e.check(mo(wu, i)), e.e164 = (i) => e.check(xo(Cu, i)), e.datetime = (i) => e.check(qo(i)), e.date = (i) => e.check(Wo(i)), e.time = (i) => e.check(Go(i)), e.duration = (i) => e.check(Jo(i));
|
|
2089
2089
|
});
|
|
2090
2090
|
function O(e) {
|
|
2091
|
-
return
|
|
2091
|
+
return Ja(lu, e);
|
|
2092
2092
|
}
|
|
2093
2093
|
const Q = /* @__PURE__ */ k("ZodStringFormat", (e, t) => {
|
|
2094
2094
|
K.init(e, t), Br.init(e, t);
|
|
@@ -2131,7 +2131,7 @@ const Q = /* @__PURE__ */ k("ZodStringFormat", (e, t) => {
|
|
|
2131
2131
|
}), Au = /* @__PURE__ */ k("ZodJWT", (e, t) => {
|
|
2132
2132
|
Pa.init(e, t), Q.init(e, t);
|
|
2133
2133
|
}), Zr = /* @__PURE__ */ k("ZodNumber", (e, t) => {
|
|
2134
|
-
Vr.init(e, t), ee.init(e, t), e.gt = (r, n) => e.check(
|
|
2134
|
+
Vr.init(e, t), ee.init(e, t), e.gt = (r, n) => e.check(Ji(r, n)), e.gte = (r, n) => e.check(ri(r, n)), e.min = (r, n) => e.check(ri(r, n)), e.lt = (r, n) => e.check(Xi(r, n)), e.lte = (r, n) => e.check(ii(r, n)), e.max = (r, n) => e.check(ii(r, n)), e.int = (r) => e.check(er(r)), e.safe = (r) => e.check(er(r)), e.positive = (r) => e.check(Ji(0, r)), e.nonnegative = (r) => e.check(ri(0, r)), e.negative = (r) => e.check(Xi(0, r)), e.nonpositive = (r) => e.check(ii(0, r)), e.multipleOf = (r, n) => e.check(Yi(r, n)), e.step = (r, n) => e.check(Yi(r, n)), e.finite = () => e;
|
|
2135
2135
|
const i = e._zod.bag;
|
|
2136
2136
|
e.minValue = Math.max(i.minimum ?? Number.NEGATIVE_INFINITY, i.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(i.maximum ?? Number.POSITIVE_INFINITY, i.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (i.format ?? "").includes("int") || Number.isSafeInteger(i.multipleOf ?? 0.5), e.isFinite = !0, e.format = i.format ?? null;
|
|
2137
2137
|
});
|
|
@@ -2169,7 +2169,7 @@ function He(e, t) {
|
|
|
2169
2169
|
return $o(Du, e, t);
|
|
2170
2170
|
}
|
|
2171
2171
|
const Mu = /* @__PURE__ */ k("ZodObject", (e, t) => {
|
|
2172
|
-
Oa.init(e, t), ee.init(e, t), U(e, "shape", () => t.shape), e.keyof = () => Wt(Object.keys(e._zod.def.shape)), e.catchall = (i) => e.clone({ ...e._zod.def, catchall: i }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: tr() }), e.loose = () => e.clone({ ...e._zod.def, catchall: tr() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Ru() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (i) => Ys(e, i), e.safeExtend = (i) => Qs(e, i), e.merge = (i) => en(e, i), e.pick = (i) =>
|
|
2172
|
+
Oa.init(e, t), ee.init(e, t), U(e, "shape", () => t.shape), e.keyof = () => Wt(Object.keys(e._zod.def.shape)), e.catchall = (i) => e.clone({ ...e._zod.def, catchall: i }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: tr() }), e.loose = () => e.clone({ ...e._zod.def, catchall: tr() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Ru() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (i) => Ys(e, i), e.safeExtend = (i) => Qs(e, i), e.merge = (i) => en(e, i), e.pick = (i) => Xs(e, i), e.omit = (i) => Js(e, i), e.partial = (...i) => tn(Ur, e, i[0]), e.required = (...i) => rn(qr, e, i[0]);
|
|
2173
2173
|
});
|
|
2174
2174
|
function Ne(e, t) {
|
|
2175
2175
|
const i = {
|
|
@@ -2339,11 +2339,11 @@ function Gu(e, t) {
|
|
|
2339
2339
|
...R(t)
|
|
2340
2340
|
});
|
|
2341
2341
|
}
|
|
2342
|
-
const
|
|
2342
|
+
const Xu = /* @__PURE__ */ k("ZodCatch", (e, t) => {
|
|
2343
2343
|
qa.init(e, t), ee.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2344
2344
|
});
|
|
2345
|
-
function
|
|
2346
|
-
return new
|
|
2345
|
+
function Ju(e, t) {
|
|
2346
|
+
return new Xu({
|
|
2347
2347
|
type: "catch",
|
|
2348
2348
|
innerType: e,
|
|
2349
2349
|
catchValue: typeof t == "function" ? t : () => t
|
|
@@ -2606,7 +2606,7 @@ function pi(e, t) {
|
|
|
2606
2606
|
}
|
|
2607
2607
|
return !1;
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2609
|
+
function Ae(e, t) {
|
|
2610
2610
|
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Hc.test(String.fromCharCode(e)) : t === !1 ? !1 : pi(e, Wr);
|
|
2611
2611
|
}
|
|
2612
2612
|
function Me(e, t) {
|
|
@@ -2618,16 +2618,16 @@ var z = function(t, i) {
|
|
|
2618
2618
|
function _e(e, t) {
|
|
2619
2619
|
return new z(e, { beforeExpr: !0, binop: t });
|
|
2620
2620
|
}
|
|
2621
|
-
var ke = { beforeExpr: !0 },
|
|
2621
|
+
var ke = { beforeExpr: !0 }, fe = { startsExpr: !0 }, at = {};
|
|
2622
2622
|
function F(e, t) {
|
|
2623
2623
|
return t === void 0 && (t = {}), t.keyword = e, at[e] = new z(e, t);
|
|
2624
2624
|
}
|
|
2625
2625
|
var l = {
|
|
2626
|
-
num: new z("num",
|
|
2627
|
-
regexp: new z("regexp",
|
|
2628
|
-
string: new z("string",
|
|
2629
|
-
name: new z("name",
|
|
2630
|
-
privateId: new z("privateId",
|
|
2626
|
+
num: new z("num", fe),
|
|
2627
|
+
regexp: new z("regexp", fe),
|
|
2628
|
+
string: new z("string", fe),
|
|
2629
|
+
name: new z("name", fe),
|
|
2630
|
+
privateId: new z("privateId", fe),
|
|
2631
2631
|
eof: new z("eof"),
|
|
2632
2632
|
// Punctuation token types.
|
|
2633
2633
|
bracketL: new z("[", { beforeExpr: !0, startsExpr: !0 }),
|
|
@@ -2646,7 +2646,7 @@ var l = {
|
|
|
2646
2646
|
template: new z("template"),
|
|
2647
2647
|
invalidTemplate: new z("invalidTemplate"),
|
|
2648
2648
|
ellipsis: new z("...", ke),
|
|
2649
|
-
backQuote: new z("`",
|
|
2649
|
+
backQuote: new z("`", fe),
|
|
2650
2650
|
dollarBraceL: new z("${", { beforeExpr: !0, startsExpr: !0 }),
|
|
2651
2651
|
// Operators. These carry several kinds of properties to help the
|
|
2652
2652
|
// parser use them properly (the presence of these properties is
|
|
@@ -2690,7 +2690,7 @@ var l = {
|
|
|
2690
2690
|
_else: F("else", ke),
|
|
2691
2691
|
_finally: F("finally"),
|
|
2692
2692
|
_for: F("for", { isLoop: !0 }),
|
|
2693
|
-
_function: F("function",
|
|
2693
|
+
_function: F("function", fe),
|
|
2694
2694
|
_if: F("if"),
|
|
2695
2695
|
_return: F("return", ke),
|
|
2696
2696
|
_switch: F("switch"),
|
|
@@ -2701,25 +2701,25 @@ var l = {
|
|
|
2701
2701
|
_while: F("while", { isLoop: !0 }),
|
|
2702
2702
|
_with: F("with"),
|
|
2703
2703
|
_new: F("new", { beforeExpr: !0, startsExpr: !0 }),
|
|
2704
|
-
_this: F("this",
|
|
2705
|
-
_super: F("super",
|
|
2706
|
-
_class: F("class",
|
|
2704
|
+
_this: F("this", fe),
|
|
2705
|
+
_super: F("super", fe),
|
|
2706
|
+
_class: F("class", fe),
|
|
2707
2707
|
_extends: F("extends", ke),
|
|
2708
2708
|
_export: F("export"),
|
|
2709
|
-
_import: F("import",
|
|
2710
|
-
_null: F("null",
|
|
2711
|
-
_true: F("true",
|
|
2712
|
-
_false: F("false",
|
|
2709
|
+
_import: F("import", fe),
|
|
2710
|
+
_null: F("null", fe),
|
|
2711
|
+
_true: F("true", fe),
|
|
2712
|
+
_false: F("false", fe),
|
|
2713
2713
|
_in: F("in", { beforeExpr: !0, binop: 7 }),
|
|
2714
2714
|
_instanceof: F("instanceof", { beforeExpr: !0, binop: 7 }),
|
|
2715
2715
|
_typeof: F("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
2716
2716
|
_void: F("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
2717
2717
|
_delete: F("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 })
|
|
2718
|
-
},
|
|
2718
|
+
}, ce = /\r\n?|\n|\u2028|\u2029/, Gr = new RegExp(ce.source, "g");
|
|
2719
2719
|
function Ye(e) {
|
|
2720
2720
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
2721
2721
|
}
|
|
2722
|
-
function
|
|
2722
|
+
function Xr(e, t, i) {
|
|
2723
2723
|
i === void 0 && (i = e.length);
|
|
2724
2724
|
for (var r = t; r < i; r++) {
|
|
2725
2725
|
var n = e.charCodeAt(r);
|
|
@@ -2728,7 +2728,7 @@ function Jr(e, t, i) {
|
|
|
2728
2728
|
}
|
|
2729
2729
|
return -1;
|
|
2730
2730
|
}
|
|
2731
|
-
var wi = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, ne = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,
|
|
2731
|
+
var wi = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, ne = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, Jr = Object.prototype, Kc = Jr.hasOwnProperty, Gc = Jr.toString, ht = Object.hasOwn || (function(e, t) {
|
|
2732
2732
|
return Kc.call(e, t);
|
|
2733
2733
|
}), or = Array.isArray || (function(e) {
|
|
2734
2734
|
return Gc.call(e) === "[object Array]";
|
|
@@ -2739,7 +2739,7 @@ function Ze(e) {
|
|
|
2739
2739
|
function Ve(e) {
|
|
2740
2740
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
2741
2741
|
}
|
|
2742
|
-
var
|
|
2742
|
+
var Xc = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, ot = function(t, i) {
|
|
2743
2743
|
this.line = t, this.column = i;
|
|
2744
2744
|
};
|
|
2745
2745
|
ot.prototype.offset = function(t) {
|
|
@@ -2750,7 +2750,7 @@ var kt = function(t, i, r) {
|
|
|
2750
2750
|
};
|
|
2751
2751
|
function Ti(e, t) {
|
|
2752
2752
|
for (var i = 1, r = 0; ; ) {
|
|
2753
|
-
var n =
|
|
2753
|
+
var n = Xr(e, r, t);
|
|
2754
2754
|
if (n < 0)
|
|
2755
2755
|
return new ot(i, t - r);
|
|
2756
2756
|
++i, r = n;
|
|
@@ -2853,7 +2853,7 @@ var zt = {
|
|
|
2853
2853
|
// (non-standard) ParenthesizedExpression nodes
|
|
2854
2854
|
preserveParens: !1
|
|
2855
2855
|
}, cr = !1;
|
|
2856
|
-
function
|
|
2856
|
+
function Jc(e) {
|
|
2857
2857
|
var t = {};
|
|
2858
2858
|
for (var i in zt)
|
|
2859
2859
|
t[i] = e && ht(e, i) ? e[i] : zt[i];
|
|
@@ -2881,15 +2881,15 @@ var _t = 1, lt = 2, Pi = 4, Yr = 8, Ci = 16, Qr = 32, Kt = 64, es = 128, Qe = 25
|
|
|
2881
2881
|
function Ai(e, t) {
|
|
2882
2882
|
return lt | (e ? Pi : 0) | (t ? Yr : 0);
|
|
2883
2883
|
}
|
|
2884
|
-
var jt = 0, Ei = 1, je = 2, ts = 3, is = 4, rs = 5,
|
|
2885
|
-
this.options = t =
|
|
2884
|
+
var jt = 0, Ei = 1, je = 2, ts = 3, is = 4, rs = 5, J = function(t, i, r) {
|
|
2885
|
+
this.options = t = Jc(t), this.sourceFile = t.sourceFile, this.keywords = Ze(Uc[t.ecmaVersion >= 6 ? 6 : t.sourceType === "module" ? "5module" : 5]);
|
|
2886
2886
|
var n = "";
|
|
2887
2887
|
t.allowReserved !== !0 && (n = si[t.ecmaVersion >= 6 ? 6 : t.ecmaVersion === 5 ? 5 : 3], t.sourceType === "module" && (n += " await")), this.reservedWords = Ze(n);
|
|
2888
2888
|
var u = (n ? n + " " : "") + si.strict;
|
|
2889
2889
|
this.reservedWordsStrict = Ze(u), this.reservedWordsStrictBind = Ze(u + " " + si.strictBind), this.input = String(i), this.containsEsc = !1, r ? (this.pos = r, this.lineStart = this.input.lastIndexOf(`
|
|
2890
|
-
`, r - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(
|
|
2890
|
+
`, r - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(ce).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 = [];
|
|
2891
2891
|
}, Le = { 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 } };
|
|
2892
|
-
|
|
2892
|
+
J.prototype.parse = function() {
|
|
2893
2893
|
var t = this.options.program || this.startNode();
|
|
2894
2894
|
return this.nextToken(), this.parseTopLevel(t);
|
|
2895
2895
|
};
|
|
@@ -2933,25 +2933,25 @@ Le.allowNewDotTarget.get = function() {
|
|
|
2933
2933
|
Le.inClassStaticBlock.get = function() {
|
|
2934
2934
|
return (this.currentVarScope().flags & Qe) > 0;
|
|
2935
2935
|
};
|
|
2936
|
-
|
|
2936
|
+
J.extend = function() {
|
|
2937
2937
|
for (var t = [], i = arguments.length; i--; ) t[i] = arguments[i];
|
|
2938
2938
|
for (var r = this, n = 0; n < t.length; n++)
|
|
2939
2939
|
r = t[n](r);
|
|
2940
2940
|
return r;
|
|
2941
2941
|
};
|
|
2942
|
-
|
|
2942
|
+
J.parse = function(t, i) {
|
|
2943
2943
|
return new this(i, t).parse();
|
|
2944
2944
|
};
|
|
2945
|
-
|
|
2945
|
+
J.parseExpressionAt = function(t, i, r) {
|
|
2946
2946
|
var n = new this(r, t, i);
|
|
2947
2947
|
return n.nextToken(), n.parseExpression();
|
|
2948
2948
|
};
|
|
2949
|
-
|
|
2949
|
+
J.tokenizer = function(t, i) {
|
|
2950
2950
|
return new this(i, t);
|
|
2951
2951
|
};
|
|
2952
|
-
Object.defineProperties(
|
|
2953
|
-
var
|
|
2954
|
-
|
|
2952
|
+
Object.defineProperties(J.prototype, Le);
|
|
2953
|
+
var he = J.prototype, Qc = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
2954
|
+
he.strictDirective = function(e) {
|
|
2955
2955
|
if (this.options.ecmaVersion < 5)
|
|
2956
2956
|
return !1;
|
|
2957
2957
|
for (; ; ) {
|
|
@@ -2962,54 +2962,54 @@ le.strictDirective = function(e) {
|
|
|
2962
2962
|
if ((t[1] || t[2]) === "use strict") {
|
|
2963
2963
|
ne.lastIndex = e + t[0].length;
|
|
2964
2964
|
var i = ne.exec(this.input), r = i.index + i[0].length, n = this.input.charAt(r);
|
|
2965
|
-
return n === ";" || n === "}" ||
|
|
2965
|
+
return n === ";" || n === "}" || ce.test(i[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(n) || n === "!" && this.input.charAt(r + 1) === "=");
|
|
2966
2966
|
}
|
|
2967
2967
|
e += t[0].length, ne.lastIndex = e, e += ne.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
2968
2968
|
}
|
|
2969
2969
|
};
|
|
2970
|
-
|
|
2970
|
+
he.eat = function(e) {
|
|
2971
2971
|
return this.type === e ? (this.next(), !0) : !1;
|
|
2972
2972
|
};
|
|
2973
|
-
|
|
2973
|
+
he.isContextual = function(e) {
|
|
2974
2974
|
return this.type === l.name && this.value === e && !this.containsEsc;
|
|
2975
2975
|
};
|
|
2976
|
-
|
|
2976
|
+
he.eatContextual = function(e) {
|
|
2977
2977
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
2978
2978
|
};
|
|
2979
|
-
|
|
2979
|
+
he.expectContextual = function(e) {
|
|
2980
2980
|
this.eatContextual(e) || this.unexpected();
|
|
2981
2981
|
};
|
|
2982
|
-
|
|
2983
|
-
return this.type === l.eof || this.type === l.braceR ||
|
|
2982
|
+
he.canInsertSemicolon = function() {
|
|
2983
|
+
return this.type === l.eof || this.type === l.braceR || ce.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2984
2984
|
};
|
|
2985
|
-
|
|
2985
|
+
he.insertSemicolon = function() {
|
|
2986
2986
|
if (this.canInsertSemicolon())
|
|
2987
2987
|
return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
2988
2988
|
};
|
|
2989
|
-
|
|
2989
|
+
he.semicolon = function() {
|
|
2990
2990
|
!this.eat(l.semi) && !this.insertSemicolon() && this.unexpected();
|
|
2991
2991
|
};
|
|
2992
|
-
|
|
2992
|
+
he.afterTrailingComma = function(e, t) {
|
|
2993
2993
|
if (this.type === e)
|
|
2994
2994
|
return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
2995
2995
|
};
|
|
2996
|
-
|
|
2996
|
+
he.expect = function(e) {
|
|
2997
2997
|
this.eat(e) || this.unexpected();
|
|
2998
2998
|
};
|
|
2999
|
-
|
|
2999
|
+
he.unexpected = function(e) {
|
|
3000
3000
|
this.raise(e ?? this.start, "Unexpected token");
|
|
3001
3001
|
};
|
|
3002
|
-
var
|
|
3002
|
+
var Xt = function() {
|
|
3003
3003
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
3004
3004
|
};
|
|
3005
|
-
|
|
3005
|
+
he.checkPatternErrors = function(e, t) {
|
|
3006
3006
|
if (e) {
|
|
3007
3007
|
e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
|
|
3008
3008
|
var i = t ? e.parenthesizedAssign : e.parenthesizedBind;
|
|
3009
3009
|
i > -1 && this.raiseRecoverable(i, t ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
3010
3010
|
}
|
|
3011
3011
|
};
|
|
3012
|
-
|
|
3012
|
+
he.checkExpressionErrors = function(e, t) {
|
|
3013
3013
|
if (!e)
|
|
3014
3014
|
return !1;
|
|
3015
3015
|
var i = e.shorthandAssign, r = e.doubleProto;
|
|
@@ -3017,13 +3017,13 @@ le.checkExpressionErrors = function(e, t) {
|
|
|
3017
3017
|
return i >= 0 || r >= 0;
|
|
3018
3018
|
i >= 0 && this.raise(i, "Shorthand property assignments are valid only in destructuring patterns"), r >= 0 && this.raiseRecoverable(r, "Redefinition of __proto__ property");
|
|
3019
3019
|
};
|
|
3020
|
-
|
|
3020
|
+
he.checkYieldAwaitInDefaultParams = function() {
|
|
3021
3021
|
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
3022
3022
|
};
|
|
3023
|
-
|
|
3023
|
+
he.isSimpleAssignTarget = function(e) {
|
|
3024
3024
|
return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
|
|
3025
3025
|
};
|
|
3026
|
-
var I =
|
|
3026
|
+
var I = J.prototype;
|
|
3027
3027
|
I.parseTopLevel = function(e) {
|
|
3028
3028
|
var t = /* @__PURE__ */ Object.create(null);
|
|
3029
3029
|
for (e.body || (e.body = []); this.type !== l.eof; ) {
|
|
@@ -3049,7 +3049,7 @@ I.isLet = function(e) {
|
|
|
3049
3049
|
return !1;
|
|
3050
3050
|
if (r === 123 || r > 55295 && r < 56320)
|
|
3051
3051
|
return !0;
|
|
3052
|
-
if (
|
|
3052
|
+
if (Ae(r, !0)) {
|
|
3053
3053
|
for (var n = i + 1; Me(r = this.input.charCodeAt(n), !0); )
|
|
3054
3054
|
++n;
|
|
3055
3055
|
if (r === 92 || r > 55295 && r < 56320)
|
|
@@ -3065,14 +3065,14 @@ I.isAsyncFunction = function() {
|
|
|
3065
3065
|
return !1;
|
|
3066
3066
|
ne.lastIndex = this.pos;
|
|
3067
3067
|
var e = ne.exec(this.input), t = this.pos + e[0].length, i;
|
|
3068
|
-
return !
|
|
3068
|
+
return !ce.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(Me(i = this.input.charCodeAt(t + 8)) || i > 55295 && i < 56320));
|
|
3069
3069
|
};
|
|
3070
3070
|
I.isUsingKeyword = function(e, t) {
|
|
3071
3071
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using"))
|
|
3072
3072
|
return !1;
|
|
3073
3073
|
ne.lastIndex = this.pos;
|
|
3074
3074
|
var i = ne.exec(this.input), r = this.pos + i[0].length;
|
|
3075
|
-
if (
|
|
3075
|
+
if (ce.test(this.input.slice(this.pos, r)))
|
|
3076
3076
|
return !1;
|
|
3077
3077
|
if (e) {
|
|
3078
3078
|
var n = r + 5, u;
|
|
@@ -3080,7 +3080,7 @@ I.isUsingKeyword = function(e, t) {
|
|
|
3080
3080
|
return !1;
|
|
3081
3081
|
ne.lastIndex = n;
|
|
3082
3082
|
var h = ne.exec(this.input);
|
|
3083
|
-
if (h &&
|
|
3083
|
+
if (h && ce.test(this.input.slice(n, n + h[0].length)))
|
|
3084
3084
|
return !1;
|
|
3085
3085
|
}
|
|
3086
3086
|
if (t) {
|
|
@@ -3089,7 +3089,7 @@ I.isUsingKeyword = function(e, t) {
|
|
|
3089
3089
|
return !1;
|
|
3090
3090
|
}
|
|
3091
3091
|
var o = this.input.charCodeAt(r);
|
|
3092
|
-
return
|
|
3092
|
+
return Ae(o, !0) || o === 92;
|
|
3093
3093
|
};
|
|
3094
3094
|
I.isAwaitUsing = function(e) {
|
|
3095
3095
|
return this.isUsingKeyword(!0, e);
|
|
@@ -3189,7 +3189,7 @@ I.parseForStatement = function(e) {
|
|
|
3189
3189
|
var y = this.startNode();
|
|
3190
3190
|
return this.next(), d === "await using" && this.next(), this.parseVar(y, !0, d), this.finishNode(y, "VariableDeclaration"), this.parseForAfterInit(e, y, t);
|
|
3191
3191
|
}
|
|
3192
|
-
var o = this.containsEsc, S = new
|
|
3192
|
+
var o = this.containsEsc, S = new Xt(), w = this.start, C = t > -1 ? this.parseExprSubscripts(S, "await") : this.parseExpression(!0, S);
|
|
3193
3193
|
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 && (C.start === w && !o && C.type === "Identifier" && C.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), u && h && this.raise(C.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(C, !1, S), this.checkLValPattern(C), this.parseForIn(e, C)) : (this.checkExpressionErrors(S, !0), t > -1 && this.unexpected(t), this.parseFor(e, C));
|
|
3194
3194
|
};
|
|
3195
3195
|
I.parseForAfterInit = function(e, t, i) {
|
|
@@ -3215,7 +3215,7 @@ I.parseSwitchStatement = function(e) {
|
|
|
3215
3215
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
3216
3216
|
};
|
|
3217
3217
|
I.parseThrowStatement = function(e) {
|
|
3218
|
-
return this.next(),
|
|
3218
|
+
return this.next(), ce.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
3219
3219
|
};
|
|
3220
3220
|
var th = [];
|
|
3221
3221
|
I.parseCatchClauseParam = function() {
|
|
@@ -3516,7 +3516,7 @@ I.parseImportAttribute = function() {
|
|
|
3516
3516
|
I.parseModuleExportName = function() {
|
|
3517
3517
|
if (this.options.ecmaVersion >= 13 && this.type === l.string) {
|
|
3518
3518
|
var e = this.parseLiteral(this.value);
|
|
3519
|
-
return
|
|
3519
|
+
return Xc.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
3520
3520
|
}
|
|
3521
3521
|
return this.parseIdent(!0);
|
|
3522
3522
|
};
|
|
@@ -3528,7 +3528,7 @@ I.isDirectiveCandidate = function(e) {
|
|
|
3528
3528
|
return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && // Reject parenthesized strings.
|
|
3529
3529
|
(this.input[e.start] === '"' || this.input[e.start] === "'");
|
|
3530
3530
|
};
|
|
3531
|
-
var Pe =
|
|
3531
|
+
var Pe = J.prototype;
|
|
3532
3532
|
Pe.toAssignable = function(e, t, i) {
|
|
3533
3533
|
if (this.options.ecmaVersion >= 6 && e)
|
|
3534
3534
|
switch (e.type) {
|
|
@@ -3700,7 +3700,7 @@ var ue = function(t, i, r, n, u) {
|
|
|
3700
3700
|
f_expr: new ue("function", !0),
|
|
3701
3701
|
f_expr_gen: new ue("function", !0, !1, null, !0),
|
|
3702
3702
|
f_gen: new ue("function", !1, !1, null, !0)
|
|
3703
|
-
}, pt =
|
|
3703
|
+
}, pt = J.prototype;
|
|
3704
3704
|
pt.initialContext = function() {
|
|
3705
3705
|
return [H.b_stat];
|
|
3706
3706
|
};
|
|
@@ -3709,7 +3709,7 @@ pt.curContext = function() {
|
|
|
3709
3709
|
};
|
|
3710
3710
|
pt.braceIsBlock = function(e) {
|
|
3711
3711
|
var t = this.curContext();
|
|
3712
|
-
return t === H.f_expr || t === H.f_stat ? !0 : e === l.colon && (t === H.b_stat || t === H.b_expr) ? !t.isExpr : e === l._return || e === l.name && this.exprAllowed ?
|
|
3712
|
+
return t === H.f_expr || t === H.f_stat ? !0 : e === l.colon && (t === H.b_stat || t === H.b_expr) ? !t.isExpr : e === l._return || e === l.name && this.exprAllowed ? ce.test(this.input.slice(this.lastTokEnd, this.start)) : e === l._else || e === l.semi || e === l.eof || e === l.parenR || e === l.arrow ? !0 : e === l.braceL ? t === H.b_stat : e === l._var || e === l._const || e === l.name ? !1 : !this.exprAllowed;
|
|
3713
3713
|
};
|
|
3714
3714
|
pt.inGeneratorContext = function() {
|
|
3715
3715
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
@@ -3747,7 +3747,7 @@ l.parenL.updateContext = function(e) {
|
|
|
3747
3747
|
l.incDec.updateContext = function() {
|
|
3748
3748
|
};
|
|
3749
3749
|
l._function.updateContext = l._class.updateContext = function(e) {
|
|
3750
|
-
e.beforeExpr && e !== l._else && !(e === l.semi && this.curContext() !== H.p_stat) && !(e === l._return &&
|
|
3750
|
+
e.beforeExpr && e !== l._else && !(e === l.semi && this.curContext() !== H.p_stat) && !(e === l._return && ce.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === l.colon || e === l.braceL) && this.curContext() === H.b_stat) ? this.context.push(H.f_expr) : this.context.push(H.f_stat), this.exprAllowed = !1;
|
|
3751
3751
|
};
|
|
3752
3752
|
l.colon.updateContext = function() {
|
|
3753
3753
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
@@ -3766,7 +3766,7 @@ l.name.updateContext = function(e) {
|
|
|
3766
3766
|
var t = !1;
|
|
3767
3767
|
this.options.ecmaVersion >= 6 && e !== l.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
3768
3768
|
};
|
|
3769
|
-
var M =
|
|
3769
|
+
var M = J.prototype;
|
|
3770
3770
|
M.checkPropClash = function(e, t, i) {
|
|
3771
3771
|
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
3772
3772
|
var r = e.key, n;
|
|
@@ -3816,7 +3816,7 @@ M.parseMaybeAssign = function(e, t, i) {
|
|
|
3816
3816
|
this.exprAllowed = !1;
|
|
3817
3817
|
}
|
|
3818
3818
|
var r = !1, n = -1, u = -1, h = -1;
|
|
3819
|
-
t ? (n = t.parenthesizedAssign, u = t.trailingComma, h = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
3819
|
+
t ? (n = t.parenthesizedAssign, u = t.trailingComma, h = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Xt(), r = !0);
|
|
3820
3820
|
var d = this.start, y = this.startLoc;
|
|
3821
3821
|
(this.type === l.parenL || this.type === l.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
3822
3822
|
var o = this.parseMaybeConditional(e, t);
|
|
@@ -3923,14 +3923,14 @@ M.parseSubscript = function(e, t, i, r, n, u, h) {
|
|
|
3923
3923
|
var S = this.startNodeAt(t, i);
|
|
3924
3924
|
S.object = e, o ? (S.property = this.parseExpression(), this.expect(l.bracketR)) : this.type === l.privateId && e.type !== "Super" ? S.property = this.parsePrivateIdent() : S.property = this.parseIdent(this.options.allowReserved !== "never"), S.computed = !!o, d && (S.optional = y), e = this.finishNode(S, "MemberExpression");
|
|
3925
3925
|
} else if (!r && this.eat(l.parenL)) {
|
|
3926
|
-
var w = new
|
|
3926
|
+
var w = new Xt(), C = this.yieldPos, j = this.awaitPos, Z = this.awaitIdentPos;
|
|
3927
3927
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
3928
|
-
var
|
|
3928
|
+
var le = this.parseExprList(l.parenR, this.options.ecmaVersion >= 8, !1, w);
|
|
3929
3929
|
if (n && !y && this.shouldParseAsyncArrow())
|
|
3930
|
-
return this.checkPatternErrors(w, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = C, this.awaitPos = j, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i,
|
|
3930
|
+
return this.checkPatternErrors(w, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = C, this.awaitPos = j, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i, le, h);
|
|
3931
3931
|
this.checkExpressionErrors(w, !0), this.yieldPos = C || this.yieldPos, this.awaitPos = j || this.awaitPos, this.awaitIdentPos = Z || this.awaitIdentPos;
|
|
3932
3932
|
var D = this.startNodeAt(t, i);
|
|
3933
|
-
D.callee = e, D.arguments =
|
|
3933
|
+
D.callee = e, D.arguments = le, d && (D.optional = y), e = this.finishNode(D, "CallExpression");
|
|
3934
3934
|
} else if (this.type === l.backQuote) {
|
|
3935
3935
|
(y || u) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
3936
3936
|
var se = this.startNodeAt(t, i);
|
|
@@ -4031,7 +4031,7 @@ M.parseParenAndDistinguishExpression = function(e, t) {
|
|
|
4031
4031
|
var i = this.start, r = this.startLoc, n, u = this.options.ecmaVersion >= 8;
|
|
4032
4032
|
if (this.options.ecmaVersion >= 6) {
|
|
4033
4033
|
this.next();
|
|
4034
|
-
var h = this.start, d = this.startLoc, y = [], o = !0, S = !1, w = new
|
|
4034
|
+
var h = this.start, d = this.startLoc, y = [], o = !0, S = !1, w = new Xt(), C = this.yieldPos, j = this.awaitPos, Z;
|
|
4035
4035
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== l.parenR; )
|
|
4036
4036
|
if (o ? o = !1 : this.expect(l.comma), u && this.afterTrailingComma(l.parenR, !0)) {
|
|
4037
4037
|
S = !0;
|
|
@@ -4044,10 +4044,10 @@ M.parseParenAndDistinguishExpression = function(e, t) {
|
|
|
4044
4044
|
break;
|
|
4045
4045
|
} else
|
|
4046
4046
|
y.push(this.parseMaybeAssign(!1, w, this.parseParenItem));
|
|
4047
|
-
var
|
|
4047
|
+
var le = this.lastTokEnd, D = this.lastTokEndLoc;
|
|
4048
4048
|
if (this.expect(l.parenR), e && this.shouldParseArrow(y) && this.eat(l.arrow))
|
|
4049
4049
|
return this.checkPatternErrors(w, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = C, this.awaitPos = j, this.parseParenArrowList(i, r, y, t);
|
|
4050
|
-
(!y.length || S) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(w, !0), this.yieldPos = C || this.yieldPos, this.awaitPos = j || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(h, d), n.expressions = y, this.finishNodeAt(n, "SequenceExpression",
|
|
4050
|
+
(!y.length || S) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(w, !0), this.yieldPos = C || this.yieldPos, this.awaitPos = j || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(h, d), n.expressions = y, this.finishNodeAt(n, "SequenceExpression", le, D)) : n = y[0];
|
|
4051
4051
|
} else
|
|
4052
4052
|
n = this.parseParenExpression();
|
|
4053
4053
|
if (this.options.preserveParens) {
|
|
@@ -4099,7 +4099,7 @@ M.parseTemplate = function(e) {
|
|
|
4099
4099
|
return this.next(), this.finishNode(i, "TemplateLiteral");
|
|
4100
4100
|
};
|
|
4101
4101
|
M.isAsyncProp = function(e) {
|
|
4102
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === l.name || this.type === l.num || this.type === l.string || this.type === l.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === l.star) && !
|
|
4102
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === l.name || this.type === l.num || this.type === l.string || this.type === l.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === l.star) && !ce.test(this.input.slice(this.lastTokEnd, this.start));
|
|
4103
4103
|
};
|
|
4104
4104
|
M.parseObj = function(e, t) {
|
|
4105
4105
|
var i = this.startNode(), r = !0, n = {};
|
|
@@ -4219,7 +4219,7 @@ M.parseAwait = function(e) {
|
|
|
4219
4219
|
var t = this.startNode();
|
|
4220
4220
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
4221
4221
|
};
|
|
4222
|
-
var Ft =
|
|
4222
|
+
var Ft = J.prototype;
|
|
4223
4223
|
Ft.raise = function(e, t) {
|
|
4224
4224
|
var i = Ti(this.input, e);
|
|
4225
4225
|
t += " (" + i.line + ":" + i.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
@@ -4231,7 +4231,7 @@ Ft.curPosition = function() {
|
|
|
4231
4231
|
if (this.options.locations)
|
|
4232
4232
|
return new ot(this.curLine, this.pos - this.lineStart);
|
|
4233
4233
|
};
|
|
4234
|
-
var Ke =
|
|
4234
|
+
var Ke = J.prototype, sh = function(t) {
|
|
4235
4235
|
this.flags = t, this.var = [], this.lexical = [], this.functions = [];
|
|
4236
4236
|
};
|
|
4237
4237
|
Ke.enterScope = function(e) {
|
|
@@ -4288,7 +4288,7 @@ Ke.currentThisScope = function() {
|
|
|
4288
4288
|
};
|
|
4289
4289
|
var wt = function(t, i, r) {
|
|
4290
4290
|
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]);
|
|
4291
|
-
}, Tt =
|
|
4291
|
+
}, Tt = J.prototype;
|
|
4292
4292
|
Tt.startNode = function() {
|
|
4293
4293
|
return new wt(this, this.start, this.startLoc);
|
|
4294
4294
|
};
|
|
@@ -4347,7 +4347,7 @@ for (var ai = 0, lr = [9, 10, 11, 12, 13, 14]; ai < lr.length; ai += 1) {
|
|
|
4347
4347
|
var fh = lr[ai];
|
|
4348
4348
|
ph(fh);
|
|
4349
4349
|
}
|
|
4350
|
-
var A =
|
|
4350
|
+
var A = J.prototype, Bt = function(t, i) {
|
|
4351
4351
|
this.parent = t, this.base = i || this;
|
|
4352
4352
|
};
|
|
4353
4353
|
Bt.prototype.separatedFrom = function(t) {
|
|
@@ -4703,7 +4703,7 @@ A.regexp_eatRegExpIdentifierStart = function(e) {
|
|
|
4703
4703
|
return e.advance(i), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, i) && (r = e.lastIntValue), yh(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
4704
4704
|
};
|
|
4705
4705
|
function yh(e) {
|
|
4706
|
-
return
|
|
4706
|
+
return Ae(e, !0) || e === 36 || e === 95;
|
|
4707
4707
|
}
|
|
4708
4708
|
A.regexp_eatRegExpIdentifierPart = function(e) {
|
|
4709
4709
|
var t = e.pos, i = this.options.ecmaVersion >= 11, r = e.current(i);
|
|
@@ -4754,7 +4754,7 @@ A.regexp_eatCControlLetter = function(e) {
|
|
|
4754
4754
|
return !1;
|
|
4755
4755
|
};
|
|
4756
4756
|
A.regexp_eatZero = function(e) {
|
|
4757
|
-
return e.current() === 48 && !
|
|
4757
|
+
return e.current() === 48 && !Jt(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), !0) : !1;
|
|
4758
4758
|
};
|
|
4759
4759
|
A.regexp_eatControlEscape = function(e) {
|
|
4760
4760
|
var t = e.current();
|
|
@@ -4896,7 +4896,7 @@ A.regexp_eatUnicodePropertyValue = function(e) {
|
|
|
4896
4896
|
return e.lastStringValue !== "";
|
|
4897
4897
|
};
|
|
4898
4898
|
function bh(e) {
|
|
4899
|
-
return _s(e) ||
|
|
4899
|
+
return _s(e) || Jt(e);
|
|
4900
4900
|
}
|
|
4901
4901
|
A.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
4902
4902
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
@@ -5112,7 +5112,7 @@ function Sh(e) {
|
|
|
5112
5112
|
}
|
|
5113
5113
|
A.regexp_eatClassControlLetter = function(e) {
|
|
5114
5114
|
var t = e.current();
|
|
5115
|
-
return
|
|
5115
|
+
return Jt(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
5116
5116
|
};
|
|
5117
5117
|
A.regexp_eatHexEscapeSequence = function(e) {
|
|
5118
5118
|
var t = e.pos;
|
|
@@ -5128,11 +5128,11 @@ A.regexp_eatHexEscapeSequence = function(e) {
|
|
|
5128
5128
|
};
|
|
5129
5129
|
A.regexp_eatDecimalDigits = function(e) {
|
|
5130
5130
|
var t = e.pos, i = 0;
|
|
5131
|
-
for (e.lastIntValue = 0;
|
|
5131
|
+
for (e.lastIntValue = 0; Jt(i = e.current()); )
|
|
5132
5132
|
e.lastIntValue = 10 * e.lastIntValue + (i - 48), e.advance();
|
|
5133
5133
|
return e.pos !== t;
|
|
5134
5134
|
};
|
|
5135
|
-
function
|
|
5135
|
+
function Jt(e) {
|
|
5136
5136
|
return e >= 48 && e <= 57;
|
|
5137
5137
|
}
|
|
5138
5138
|
A.regexp_eatHexDigits = function(e) {
|
|
@@ -5179,7 +5179,7 @@ A.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
5179
5179
|
};
|
|
5180
5180
|
var Yt = function(t) {
|
|
5181
5181
|
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]);
|
|
5182
|
-
}, $ =
|
|
5182
|
+
}, $ = J.prototype;
|
|
5183
5183
|
$.next = function(e) {
|
|
5184
5184
|
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Yt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
5185
5185
|
};
|
|
@@ -5207,7 +5207,7 @@ $.nextToken = function() {
|
|
|
5207
5207
|
this.readToken(this.fullCharCodeAtPos());
|
|
5208
5208
|
};
|
|
5209
5209
|
$.readToken = function(e) {
|
|
5210
|
-
return
|
|
5210
|
+
return Ae(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
5211
5211
|
};
|
|
5212
5212
|
$.fullCharCodeAtPos = function() {
|
|
5213
5213
|
var e = this.input.charCodeAt(this.pos);
|
|
@@ -5219,7 +5219,7 @@ $.fullCharCodeAtPos = function() {
|
|
|
5219
5219
|
$.skipBlockComment = function() {
|
|
5220
5220
|
var e = this.options.onComment && this.curPosition(), t = this.pos, i = this.input.indexOf("*/", this.pos += 2);
|
|
5221
5221
|
if (i === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = i + 2, this.options.locations)
|
|
5222
|
-
for (var r = void 0, n = t; (r =
|
|
5222
|
+
for (var r = void 0, n = t; (r = Xr(this.input, n, this.pos)) > -1; )
|
|
5223
5223
|
++this.curLine, n = this.lineStart = r;
|
|
5224
5224
|
this.options.onComment && this.options.onComment(
|
|
5225
5225
|
!0,
|
|
@@ -5315,7 +5315,7 @@ $.readToken_caret = function() {
|
|
|
5315
5315
|
};
|
|
5316
5316
|
$.readToken_plus_min = function(e) {
|
|
5317
5317
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
5318
|
-
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 ||
|
|
5318
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || ce.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(l.incDec, 2) : t === 61 ? this.finishOp(l.assign, 2) : this.finishOp(l.plusMin, 1);
|
|
5319
5319
|
};
|
|
5320
5320
|
$.readToken_lt_gt = function(e) {
|
|
5321
5321
|
var t = this.input.charCodeAt(this.pos + 1), i = 1;
|
|
@@ -5347,7 +5347,7 @@ $.readToken_question = function() {
|
|
|
5347
5347
|
};
|
|
5348
5348
|
$.readToken_numberSign = function() {
|
|
5349
5349
|
var e = this.options.ecmaVersion, t = 35;
|
|
5350
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(),
|
|
5350
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), Ae(t, !0) || t === 92))
|
|
5351
5351
|
return this.finishToken(l.privateId, this.readWord1());
|
|
5352
5352
|
this.raise(this.pos, "Unexpected character '" + Ve(t) + "'");
|
|
5353
5353
|
};
|
|
@@ -5446,7 +5446,7 @@ $.readRegexp = function() {
|
|
|
5446
5446
|
for (var e, t, i = this.pos; ; ) {
|
|
5447
5447
|
this.pos >= this.input.length && this.raise(i, "Unterminated regular expression");
|
|
5448
5448
|
var r = this.input.charAt(this.pos);
|
|
5449
|
-
if (
|
|
5449
|
+
if (ce.test(r) && this.raise(i, "Unterminated regular expression"), e)
|
|
5450
5450
|
e = !1;
|
|
5451
5451
|
else {
|
|
5452
5452
|
if (r === "[")
|
|
@@ -5495,7 +5495,7 @@ $.readRadixNumber = function(e) {
|
|
|
5495
5495
|
var t = this.pos;
|
|
5496
5496
|
this.pos += 2;
|
|
5497
5497
|
var i = this.readInt(e);
|
|
5498
|
-
return i == null && this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (i = Ts(this.input.slice(t, this.pos)), ++this.pos) :
|
|
5498
|
+
return i == null && this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (i = Ts(this.input.slice(t, this.pos)), ++this.pos) : Ae(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(l.num, i);
|
|
5499
5499
|
};
|
|
5500
5500
|
$.readNumber = function(e) {
|
|
5501
5501
|
var t = this.pos;
|
|
@@ -5505,9 +5505,9 @@ $.readNumber = function(e) {
|
|
|
5505
5505
|
var r = this.input.charCodeAt(this.pos);
|
|
5506
5506
|
if (!i && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
5507
5507
|
var n = Ts(this.input.slice(t, this.pos));
|
|
5508
|
-
return ++this.pos,
|
|
5508
|
+
return ++this.pos, Ae(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(l.num, n);
|
|
5509
5509
|
}
|
|
5510
|
-
i && /[89]/.test(this.input.slice(t, this.pos)) && (i = !1), r === 46 && !i && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !i && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")),
|
|
5510
|
+
i && /[89]/.test(this.input.slice(t, this.pos)) && (i = !1), r === 46 && !i && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !i && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), Ae(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
5511
5511
|
var u = wh(this.input.slice(t, this.pos), i);
|
|
5512
5512
|
return this.finishToken(l.num, u);
|
|
5513
5513
|
};
|
|
@@ -5670,7 +5670,7 @@ $.readWord1 = function() {
|
|
|
5670
5670
|
var u = this.pos;
|
|
5671
5671
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
5672
5672
|
var h = this.readCodePoint();
|
|
5673
|
-
(t ?
|
|
5673
|
+
(t ? Ae : Me)(h, r) || this.invalidStringToken(u, "Invalid Unicode escape"), e += Ve(h), i = this.pos;
|
|
5674
5674
|
} else
|
|
5675
5675
|
break;
|
|
5676
5676
|
t = !1;
|
|
@@ -5682,8 +5682,8 @@ $.readWord = function() {
|
|
|
5682
5682
|
return this.keywords.test(e) && (t = at[e]), this.finishToken(t, e);
|
|
5683
5683
|
};
|
|
5684
5684
|
var Cs = "8.15.0";
|
|
5685
|
-
|
|
5686
|
-
Parser:
|
|
5685
|
+
J.acorn = {
|
|
5686
|
+
Parser: J,
|
|
5687
5687
|
version: Cs,
|
|
5688
5688
|
defaultOptions: zt,
|
|
5689
5689
|
Position: ot,
|
|
@@ -5696,26 +5696,26 @@ X.acorn = {
|
|
|
5696
5696
|
TokContext: ue,
|
|
5697
5697
|
tokContexts: H,
|
|
5698
5698
|
isIdentifierChar: Me,
|
|
5699
|
-
isIdentifierStart:
|
|
5699
|
+
isIdentifierStart: Ae,
|
|
5700
5700
|
Token: Yt,
|
|
5701
5701
|
isNewLine: Ye,
|
|
5702
|
-
lineBreak:
|
|
5702
|
+
lineBreak: ce,
|
|
5703
5703
|
lineBreakG: Gr,
|
|
5704
5704
|
nonASCIIwhitespace: wi
|
|
5705
5705
|
};
|
|
5706
5706
|
function Th(e, t) {
|
|
5707
|
-
return
|
|
5707
|
+
return J.parse(e, t);
|
|
5708
5708
|
}
|
|
5709
5709
|
function Ph(e, t, i) {
|
|
5710
|
-
return
|
|
5710
|
+
return J.parseExpressionAt(e, t, i);
|
|
5711
5711
|
}
|
|
5712
5712
|
function Ch(e, t) {
|
|
5713
|
-
return
|
|
5713
|
+
return J.tokenizer(e, t);
|
|
5714
5714
|
}
|
|
5715
5715
|
const Ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5716
5716
|
__proto__: null,
|
|
5717
5717
|
Node: wt,
|
|
5718
|
-
Parser:
|
|
5718
|
+
Parser: J,
|
|
5719
5719
|
Position: ot,
|
|
5720
5720
|
SourceLocation: kt,
|
|
5721
5721
|
TokContext: ue,
|
|
@@ -5724,10 +5724,10 @@ const Ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5724
5724
|
defaultOptions: zt,
|
|
5725
5725
|
getLineInfo: Ti,
|
|
5726
5726
|
isIdentifierChar: Me,
|
|
5727
|
-
isIdentifierStart:
|
|
5727
|
+
isIdentifierStart: Ae,
|
|
5728
5728
|
isNewLine: Ye,
|
|
5729
5729
|
keywordTypes: at,
|
|
5730
|
-
lineBreak:
|
|
5730
|
+
lineBreak: ce,
|
|
5731
5731
|
lineBreakG: Gr,
|
|
5732
5732
|
nonASCIIwhitespace: wi,
|
|
5733
5733
|
parse: Th,
|
|
@@ -5903,17 +5903,17 @@ function xr(e) {
|
|
|
5903
5903
|
function jh(e) {
|
|
5904
5904
|
var t = {}, i = t.dts, r = i !== void 0 && i, n = t.allowSatisfies, u = n !== void 0 && n;
|
|
5905
5905
|
return function(h) {
|
|
5906
|
-
var d = h.acorn || Ah, y = Ih(d), o = d.tokTypes, S = d.keywordTypes, w = d.isIdentifierStart, C = d.lineBreak, j = d.isNewLine, Z = d.tokContexts,
|
|
5907
|
-
function Os(P,
|
|
5906
|
+
var d = h.acorn || Ah, y = Ih(d), o = d.tokTypes, S = d.keywordTypes, w = d.isIdentifierStart, C = d.lineBreak, j = d.isNewLine, Z = d.tokContexts, le = d.isIdentifierChar, D = y.tokTypes, se = y.tokContexts, ft = y.keywordsRegExp, Ce = y.tokenIsLiteralPropertyName, be = y.tokenIsTemplate, Ge = y.tokenIsTSDeclarationStart, q = y.tokenIsIdentifier, Ct = y.tokenIsKeywordOrIdentifier, Ls = y.tokenIsTSTypeOperator;
|
|
5907
|
+
function Os(P, pe, oe) {
|
|
5908
5908
|
oe === void 0 && (oe = P.length);
|
|
5909
|
-
for (var te =
|
|
5909
|
+
for (var te = pe; te < oe; te++) {
|
|
5910
5910
|
var B = P.charCodeAt(te);
|
|
5911
5911
|
if (j(B)) return te < oe - 1 && B === 13 && P.charCodeAt(te + 1) === 10 ? te + 2 : te + 1;
|
|
5912
5912
|
}
|
|
5913
5913
|
return -1;
|
|
5914
5914
|
}
|
|
5915
|
-
h = (function(P,
|
|
5916
|
-
var te = oe.tokTypes, B =
|
|
5915
|
+
h = (function(P, pe, oe) {
|
|
5916
|
+
var te = oe.tokTypes, B = pe.tokTypes;
|
|
5917
5917
|
return (function(f) {
|
|
5918
5918
|
function s() {
|
|
5919
5919
|
return f.apply(this, arguments) || this;
|
|
@@ -5952,8 +5952,8 @@ function jh(e) {
|
|
|
5952
5952
|
return c;
|
|
5953
5953
|
}, s;
|
|
5954
5954
|
})(P);
|
|
5955
|
-
})(h, y, d), h = (function(P,
|
|
5956
|
-
var B = P.tokTypes, f =
|
|
5955
|
+
})(h, y, d), h = (function(P, pe, oe, te) {
|
|
5956
|
+
var B = P.tokTypes, f = pe.tokTypes, s = P.isNewLine, a = P.isIdentifierChar, c = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
5957
5957
|
return (function(p) {
|
|
5958
5958
|
function m() {
|
|
5959
5959
|
return p.apply(this, arguments) || this;
|
|
@@ -6085,8 +6085,8 @@ function jh(e) {
|
|
|
6085
6085
|
return this.next(), this.jsx_parseElementAt(x, g);
|
|
6086
6086
|
}, m;
|
|
6087
6087
|
})(oe);
|
|
6088
|
-
})(d, y, h), h = (function(P,
|
|
6089
|
-
var te =
|
|
6088
|
+
})(d, y, h), h = (function(P, pe, oe) {
|
|
6089
|
+
var te = pe.tokTypes, B = oe.tokTypes;
|
|
6090
6090
|
return (function(f) {
|
|
6091
6091
|
function s() {
|
|
6092
6092
|
return f.apply(this, arguments) || this;
|
|
@@ -6115,15 +6115,15 @@ function jh(e) {
|
|
|
6115
6115
|
})(P);
|
|
6116
6116
|
})(h, y, d);
|
|
6117
6117
|
var Rs = /* @__PURE__ */ (function(P) {
|
|
6118
|
-
function
|
|
6118
|
+
function pe(s, a, c) {
|
|
6119
6119
|
var p;
|
|
6120
6120
|
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) {
|
|
6121
6121
|
if (m === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
6122
6122
|
return m;
|
|
6123
6123
|
})(p), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: N.InvalidModifierOnTypeParameterPositions }), p;
|
|
6124
6124
|
}
|
|
6125
|
-
Rt(
|
|
6126
|
-
var oe, te, B, f =
|
|
6125
|
+
Rt(pe, P);
|
|
6126
|
+
var oe, te, B, f = pe.prototype;
|
|
6127
6127
|
return f.getTokenFromCodeInType = function(s) {
|
|
6128
6128
|
return s === 62 || s === 60 ? this.finishOp(o.relational, 1) : P.prototype.getTokenFromCode.call(this, s);
|
|
6129
6129
|
}, f.readToken = function(s) {
|
|
@@ -6215,7 +6215,7 @@ function jh(e) {
|
|
|
6215
6215
|
var c = s + a.length;
|
|
6216
6216
|
if (this.input.slice(s, c) === a) {
|
|
6217
6217
|
var p = this.input.charCodeAt(c);
|
|
6218
|
-
return !(
|
|
6218
|
+
return !(le(p) || (64512 & p) == 55296);
|
|
6219
6219
|
}
|
|
6220
6220
|
return !1;
|
|
6221
6221
|
}, f.isAbstractConstructorSignature = function() {
|
|
@@ -6762,10 +6762,10 @@ function jh(e) {
|
|
|
6762
6762
|
a[v] = c[v];
|
|
6763
6763
|
}
|
|
6764
6764
|
}, f.tsParseModifiers = function(s) {
|
|
6765
|
-
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(G, W,
|
|
6766
|
-
W ===
|
|
6767
|
-
}, L = function(G, W,
|
|
6768
|
-
(c[
|
|
6765
|
+
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(G, W, X, ie) {
|
|
6766
|
+
W === X && c[ie] && a.raise(G.column, N.InvalidModifiersOrder({ orderedModifiers: [X, ie] }));
|
|
6767
|
+
}, L = function(G, W, X, ie) {
|
|
6768
|
+
(c[X] && W === ie || c[ie] && W === X) && a.raise(G.column, N.IncompatibleModifiers({ modifiers: [X, ie] }));
|
|
6769
6769
|
}; ; ) {
|
|
6770
6770
|
var V = this.startLoc, E = this.tsParseModifier(p.concat(m ?? []), v);
|
|
6771
6771
|
if (!E) break;
|
|
@@ -7208,8 +7208,8 @@ function jh(e) {
|
|
|
7208
7208
|
(a.eatContextual("get") || a.eatContextual("set")) && (a.isClassElementNameStart() ? _ = G : v = G);
|
|
7209
7209
|
}
|
|
7210
7210
|
if (v ? (m.computed = !1, m.key = a.startNodeAt(a.lastTokStart, a.lastTokStartLoc), m.key.name = v, a.finishNode(m.key, "Identifier")) : a.parseClassElementName(m), a.parsePostMemberNameModifiers(m), a.isClassMethod() || p < 13 || a.type === o.parenL || _ !== "method" || x || g) {
|
|
7211
|
-
var W = !m.static && yr(m, "constructor"),
|
|
7212
|
-
W && _ !== "method" && a.raise(m.key.start, "Constructor can't have get/set modifier"), m.kind = W ? "constructor" : _, a.parseClassMethod(m, x, g,
|
|
7211
|
+
var W = !m.static && yr(m, "constructor"), X = W && s;
|
|
7212
|
+
W && _ !== "method" && a.raise(m.key.start, "Constructor can't have get/set modifier"), m.kind = W ? "constructor" : _, a.parseClassMethod(m, x, g, X);
|
|
7213
7213
|
} else a.parseClassField(m);
|
|
7214
7214
|
return m;
|
|
7215
7215
|
}
|
|
@@ -7254,8 +7254,8 @@ function jh(e) {
|
|
|
7254
7254
|
if (L = this.cloneCurLookaheadState(), !(V = this.tryParse(function() {
|
|
7255
7255
|
return W.parseMaybeAssignOrigin(s, a, c);
|
|
7256
7256
|
}, L)).error) return V.node;
|
|
7257
|
-
var
|
|
7258
|
-
ie === y.tokContexts.tc_oTag &&
|
|
7257
|
+
var X = this.context, ie = X[X.length - 1];
|
|
7258
|
+
ie === y.tokContexts.tc_oTag && X[X.length - 2] === y.tokContexts.tc_expr ? (X.pop(), X.pop()) : ie !== y.tokContexts.tc_oTag && ie !== y.tokContexts.tc_expr || X.pop();
|
|
7259
7259
|
}
|
|
7260
7260
|
if (!((p = V) != null && p.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(s, a, c);
|
|
7261
7261
|
L && !this.compareLookaheadState(L, this.getCurLookaheadState()) || (L = this.cloneCurLookaheadState());
|
|
@@ -7396,7 +7396,7 @@ function jh(e) {
|
|
|
7396
7396
|
if (this.options.ecmaVersion >= 6) {
|
|
7397
7397
|
var x = this.maybeInArrowParameters;
|
|
7398
7398
|
this.maybeInArrowParameters = !0, this.next();
|
|
7399
|
-
var g, _ = this.start, T = this.startLoc, L = [], V = !0, E = !1, G = new vt(), W = this.yieldPos,
|
|
7399
|
+
var g, _ = this.start, T = this.startLoc, L = [], V = !0, E = !1, G = new vt(), W = this.yieldPos, X = this.awaitPos;
|
|
7400
7400
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== o.parenR; ) {
|
|
7401
7401
|
if (V ? V = !1 : this.expect(o.comma), v && this.afterTrailingComma(o.parenR, !0)) {
|
|
7402
7402
|
E = !0;
|
|
@@ -7409,8 +7409,8 @@ function jh(e) {
|
|
|
7409
7409
|
L.push(this.parseMaybeAssign(a, G, this.parseParenItem));
|
|
7410
7410
|
}
|
|
7411
7411
|
var ie = this.lastTokEnd, ye = this.lastTokEndLoc;
|
|
7412
|
-
if (this.expect(o.parenR), this.maybeInArrowParameters = x, s && this.shouldParseArrow(L) && this.eat(o.arrow)) return this.checkPatternErrors(G, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = W, this.awaitPos =
|
|
7413
|
-
L.length && !E || this.unexpected(this.lastTokStart), g && this.unexpected(g), this.checkExpressionErrors(G, !0), this.yieldPos = W || this.yieldPos, this.awaitPos =
|
|
7412
|
+
if (this.expect(o.parenR), this.maybeInArrowParameters = x, s && this.shouldParseArrow(L) && this.eat(o.arrow)) return this.checkPatternErrors(G, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = W, this.awaitPos = X, this.parseParenArrowList(p, m, L, a);
|
|
7413
|
+
L.length && !E || this.unexpected(this.lastTokStart), g && this.unexpected(g), this.checkExpressionErrors(G, !0), this.yieldPos = W || this.yieldPos, this.awaitPos = X || this.awaitPos, L.length > 1 ? ((c = this.startNodeAt(_, T)).expressions = L, this.finishNodeAt(c, "SequenceExpression", ie, ye)) : c = L[0];
|
|
7414
7414
|
} else c = this.parseParenExpression();
|
|
7415
7415
|
if (this.options.preserveParens) {
|
|
7416
7416
|
var Fe = this.startNodeAt(p, m);
|
|
@@ -7478,10 +7478,10 @@ function jh(e) {
|
|
|
7478
7478
|
}
|
|
7479
7479
|
var G = this.options.ecmaVersion >= 11, W = G && this.eat(o.questionDot);
|
|
7480
7480
|
p && W && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
7481
|
-
var
|
|
7482
|
-
if (
|
|
7481
|
+
var X = this.eat(o.bracketL);
|
|
7482
|
+
if (X || W && this.type !== o.parenL && this.type !== o.backQuote || this.eat(o.dot)) {
|
|
7483
7483
|
var ie = this.startNodeAt(a, c);
|
|
7484
|
-
ie.object = s,
|
|
7484
|
+
ie.object = s, X ? (ie.property = this.parseExpression(), this.expect(o.bracketR)) : ie.property = this.type === o.privateId && s.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), ie.computed = !!X, G && (ie.optional = W), s = this.finishNode(ie, "MemberExpression");
|
|
7485
7485
|
} else if (!p && this.eat(o.parenL)) {
|
|
7486
7486
|
var ye = this.maybeInArrowParameters;
|
|
7487
7487
|
this.maybeInArrowParameters = !0;
|
|
@@ -7547,12 +7547,12 @@ function jh(e) {
|
|
|
7547
7547
|
this.raise(m.start, N.AbstractMethodHasImplementation({ methodName: T.type !== "Identifier" || m.computed ? "[" + this.input.slice(T.start, T.end) + "]" : T.name }));
|
|
7548
7548
|
}
|
|
7549
7549
|
return this.finishNode(v, "FunctionExpression");
|
|
7550
|
-
},
|
|
7550
|
+
}, pe.parse = function(s, a) {
|
|
7551
7551
|
if (a.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
7552
7552
|
a.locations = !0;
|
|
7553
7553
|
var c = new this(a, s);
|
|
7554
7554
|
return r && (c.isAmbientContext = !0), c.parse();
|
|
7555
|
-
},
|
|
7555
|
+
}, pe.parseExpressionAt = function(s, a, c) {
|
|
7556
7556
|
if (c.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
7557
7557
|
c.locations = !0;
|
|
7558
7558
|
var p = new this(c, s, a);
|
|
@@ -7640,18 +7640,18 @@ function jh(e) {
|
|
|
7640
7640
|
}
|
|
7641
7641
|
P.prototype.checkLocalExport.call(this, s);
|
|
7642
7642
|
}
|
|
7643
|
-
}, oe =
|
|
7643
|
+
}, oe = pe, B = [{ key: "acornTypeScript", get: function() {
|
|
7644
7644
|
return y;
|
|
7645
7645
|
} }], (te = [{ key: "acornTypeScript", get: function() {
|
|
7646
7646
|
return y;
|
|
7647
|
-
} }]) && pr(oe.prototype, te), B && pr(oe, B), Object.defineProperty(oe, "prototype", { writable: !1 }),
|
|
7647
|
+
} }]) && pr(oe.prototype, te), B && pr(oe, B), Object.defineProperty(oe, "prototype", { writable: !1 }), pe;
|
|
7648
7648
|
})(h);
|
|
7649
7649
|
return Rs;
|
|
7650
7650
|
};
|
|
7651
7651
|
}
|
|
7652
7652
|
const $h = Ms(Vs);
|
|
7653
7653
|
function Ni(e) {
|
|
7654
|
-
const i =
|
|
7654
|
+
const i = J.extend(jh()).parse(e, {
|
|
7655
7655
|
ecmaVersion: "latest",
|
|
7656
7656
|
sourceType: "module",
|
|
7657
7657
|
locations: !0
|
|
@@ -7668,10 +7668,10 @@ async function we(e, t, i = [], r) {
|
|
|
7668
7668
|
const n = `${t} ${i.join(" ")}`;
|
|
7669
7669
|
e !== void 0 && re(`${e} - exec(${n})`);
|
|
7670
7670
|
const { stdout: u, stderr: h } = await $h(n);
|
|
7671
|
-
r === void 0 ? u.trim() && console.log(u.trim()) : await
|
|
7671
|
+
r === void 0 ? u.trim() && console.log(u.trim()) : await Ee.writeFile(r, u.trim(), "utf8"), h.trim() && console.error(h.trim());
|
|
7672
7672
|
}
|
|
7673
7673
|
async function Fh(e, t) {
|
|
7674
|
-
return
|
|
7674
|
+
return Ee.readdir(e, t);
|
|
7675
7675
|
}
|
|
7676
7676
|
async function Es() {
|
|
7677
7677
|
re("Load environment variables"), (await import("dotenv")).config();
|
|
@@ -7691,11 +7691,11 @@ function re(e) {
|
|
|
7691
7691
|
${e}
|
|
7692
7692
|
`);
|
|
7693
7693
|
}
|
|
7694
|
-
async function
|
|
7695
|
-
return JSON.parse(await
|
|
7694
|
+
async function de(e) {
|
|
7695
|
+
return JSON.parse(await Ee.readFile(e, "utf8"));
|
|
7696
7696
|
}
|
|
7697
7697
|
async function Pt(e) {
|
|
7698
|
-
return await
|
|
7698
|
+
return await Ee.readFile(e, "utf8");
|
|
7699
7699
|
}
|
|
7700
7700
|
async function Ie(e, t, i = [], r = !1) {
|
|
7701
7701
|
return re(`${e} - spawn(${t} ${i.join(" ")})`), new Promise((n, u) => {
|
|
@@ -7705,10 +7705,10 @@ async function Ie(e, t, i = [], r = !1) {
|
|
|
7705
7705
|
});
|
|
7706
7706
|
}
|
|
7707
7707
|
async function ut(e, t) {
|
|
7708
|
-
await
|
|
7708
|
+
await Ee.writeFile(e, JSON.stringify(t, void 0, 4), "utf8");
|
|
7709
7709
|
}
|
|
7710
7710
|
async function Is(e, t) {
|
|
7711
|
-
await
|
|
7711
|
+
await Ee.writeFile(e, t, "utf8");
|
|
7712
7712
|
}
|
|
7713
7713
|
function yi(e, t) {
|
|
7714
7714
|
t(e);
|
|
@@ -7724,29 +7724,29 @@ function yi(e, t) {
|
|
|
7724
7724
|
}
|
|
7725
7725
|
}
|
|
7726
7726
|
async function Bh() {
|
|
7727
|
-
const e = await
|
|
7727
|
+
const e = await de("config.json"), t = {
|
|
7728
7728
|
body: JSON.stringify(e),
|
|
7729
7729
|
headers: { "Content-Type": "application/json" },
|
|
7730
7730
|
method: "PUT"
|
|
7731
7731
|
}, i = await fetch(`https://api.datapos.app/states/${e.id}`, t);
|
|
7732
7732
|
if (!i.ok) throw new Error(await i.text());
|
|
7733
7733
|
}
|
|
7734
|
-
async function gr() {
|
|
7735
|
-
const
|
|
7734
|
+
async function gr(e) {
|
|
7735
|
+
const t = e.id, i = {
|
|
7736
7736
|
body: JSON.stringify(e),
|
|
7737
7737
|
headers: { "Content-Type": "application/json" },
|
|
7738
7738
|
method: "PUT"
|
|
7739
7739
|
}, r = await fetch(`https://api.datapos.app/states/${t}`, i);
|
|
7740
7740
|
if (!r.ok) throw new Error(await r.text());
|
|
7741
7741
|
}
|
|
7742
|
-
async function br(e) {
|
|
7743
|
-
const i = `v${
|
|
7742
|
+
async function br(e, t) {
|
|
7743
|
+
const i = `v${e.version}`;
|
|
7744
7744
|
async function r(n, u = "") {
|
|
7745
7745
|
const h = await Fh(n, { withFileTypes: !0 });
|
|
7746
7746
|
for (const d of h) {
|
|
7747
7747
|
const y = `${n}/${d.name}`, o = u ? `${u}/${d.name}` : d.name;
|
|
7748
7748
|
if (d.isDirectory()) continue;
|
|
7749
|
-
const S = `${
|
|
7749
|
+
const S = `${t}_${i}/${o}`.replaceAll("\\", "/"), w = d.name.endsWith(".css") ? "text/css" : "application/octet-stream", C = d.name.endsWith(".js") ? "application/javascript" : w;
|
|
7750
7750
|
console.info(`⚙️ Uploading '${o}' → '${S}'...`), await we(void 0, `wrangler r2 object put "${S}" --file="${y}" --content-type ${C} --jurisdiction=eu --remote`);
|
|
7751
7751
|
}
|
|
7752
7752
|
}
|
|
@@ -7762,7 +7762,7 @@ async function ll() {
|
|
|
7762
7762
|
async function pl() {
|
|
7763
7763
|
try {
|
|
7764
7764
|
Re("Release Project");
|
|
7765
|
-
const e = await
|
|
7765
|
+
const e = await de("package.json"), t = await de("config.json");
|
|
7766
7766
|
await Ns("1️⃣", e);
|
|
7767
7767
|
const i = Gh(e);
|
|
7768
7768
|
switch (i) {
|
|
@@ -7783,13 +7783,13 @@ async function pl() {
|
|
|
7783
7783
|
if (i === "app")
|
|
7784
7784
|
re("7️⃣ Register module"), await Bh();
|
|
7785
7785
|
else if (i === "engine")
|
|
7786
|
-
re("7️⃣ Register module"), await gr(), await br(`datapos-engine-eu/${r}`);
|
|
7786
|
+
re("7️⃣ Register module"), await gr(t), await br(e, `datapos-engine-eu/${r}`);
|
|
7787
7787
|
else if (r === void 0)
|
|
7788
7788
|
re("7️⃣ Registration NOT required.");
|
|
7789
7789
|
else {
|
|
7790
|
-
re("7️⃣ Register module"), await gr();
|
|
7790
|
+
re("7️⃣ Register module"), await gr(t);
|
|
7791
7791
|
const n = t.id.split("-").slice(2).join("-");
|
|
7792
|
-
await br(`datapos-engine-eu/${r}/${n}`);
|
|
7792
|
+
await br(e, `datapos-engine-eu/${r}/${n}`);
|
|
7793
7793
|
}
|
|
7794
7794
|
i === "connector" || i === "context" || i === "dev" || i === "presenter" || i === "shared" || i === "tool" ? await Ie("8️⃣ Publish to npm", "npm", ["publish", "--access", "public"]) : re(`8️⃣ Publishing NOT required for package with type identifier of '${i}'.`), $e(`Project version '${e.version}' released.`);
|
|
7795
7795
|
} catch (e) {
|
|
@@ -7799,7 +7799,7 @@ async function pl() {
|
|
|
7799
7799
|
async function fl() {
|
|
7800
7800
|
try {
|
|
7801
7801
|
Re("Synchronise Project with GitHub");
|
|
7802
|
-
const e = await
|
|
7802
|
+
const e = await de("package.json");
|
|
7803
7803
|
re("Bump project version"), await Ns("1️⃣", e), await we("2️⃣ Stage changes", "git", ["add", "."]), await we("3️⃣ Commit changes", "git", ["commit", "-m", `"v${e.version}"`]), await we("4️⃣ Push changes", "git", ["push", "origin", "main:main"]), $e(`Project version '${e.version}' synchronised with GitHub.`);
|
|
7804
7804
|
} catch (e) {
|
|
7805
7805
|
console.error("❌ Error synchronising project with GitHub.", e), process.exit(1);
|
|
@@ -7816,12 +7816,12 @@ function dl() {
|
|
|
7816
7816
|
}
|
|
7817
7817
|
async function Zh(e, t) {
|
|
7818
7818
|
re(`${e} Build project configuration`);
|
|
7819
|
-
const i = await
|
|
7819
|
+
const i = await de("config.json");
|
|
7820
7820
|
t.name != null && (i.id = t.name.replace("@datapos/", "").replace("@data-positioning/", "")), t.version != null && (i.version = t.version), await ut("config.json", i);
|
|
7821
7821
|
}
|
|
7822
7822
|
async function Uh(e, t) {
|
|
7823
7823
|
re(`${e} Build connector project configuration`);
|
|
7824
|
-
const [i, r] = await Promise.all([
|
|
7824
|
+
const [i, r] = await Promise.all([de("config.json"), Pt("src/index.ts")]), n = _c.safeParse(i);
|
|
7825
7825
|
if (!n.success) {
|
|
7826
7826
|
console.log("❌ Configuration is invalid:"), console.table(n.error.issues);
|
|
7827
7827
|
return;
|
|
@@ -7831,7 +7831,7 @@ async function Uh(e, t) {
|
|
|
7831
7831
|
}
|
|
7832
7832
|
async function qh(e, t) {
|
|
7833
7833
|
re(`${e} Build context project configuration`);
|
|
7834
|
-
const [i, r] = await Promise.all([
|
|
7834
|
+
const [i, r] = await Promise.all([de("config.json"), Pt("src/index.ts")]), n = Nc.safeParse(i);
|
|
7835
7835
|
if (!n.success) {
|
|
7836
7836
|
console.log("❌ Configuration is invalid:"), console.table(n.error.issues);
|
|
7837
7837
|
return;
|
|
@@ -7841,7 +7841,7 @@ async function qh(e, t) {
|
|
|
7841
7841
|
}
|
|
7842
7842
|
async function Hh(e, t) {
|
|
7843
7843
|
re(`${e} Build presenter project configuration`);
|
|
7844
|
-
const [i, r] = await Promise.all([
|
|
7844
|
+
const [i, r] = await Promise.all([de("config.json"), Pt("src/index.ts")]), n = Fc.safeParse(i);
|
|
7845
7845
|
if (!n.success) {
|
|
7846
7846
|
console.log("❌ Configuration is invalid:"), console.table(n.error.issues);
|
|
7847
7847
|
return;
|
|
@@ -7881,9 +7881,22 @@ function Kh(e) {
|
|
|
7881
7881
|
}
|
|
7882
7882
|
function Gh(e) {
|
|
7883
7883
|
const t = e.name ?? "";
|
|
7884
|
-
|
|
7884
|
+
switch (t) {
|
|
7885
|
+
case "datapos-app":
|
|
7886
|
+
return "app";
|
|
7887
|
+
case "datapos-api":
|
|
7888
|
+
return "api";
|
|
7889
|
+
case "datapos-engine":
|
|
7890
|
+
return "engine";
|
|
7891
|
+
case "@datapos/datapos-shared":
|
|
7892
|
+
return "shared";
|
|
7893
|
+
case "@datapos/datapos-development":
|
|
7894
|
+
return "dev";
|
|
7895
|
+
default:
|
|
7896
|
+
return t.includes("datapos-connector") ? "connector" : t.includes("datapos-context") ? "context" : t.includes("datapos-presenter") ? "presenter" : t.includes("datapos-tool") ? "tool" : "other";
|
|
7897
|
+
}
|
|
7885
7898
|
}
|
|
7886
|
-
const
|
|
7899
|
+
const Xh = ["critical", "high", "moderate", "low", "unknown"], Jh = {
|
|
7887
7900
|
critical: { color: "D32F2F", label: "critical" },
|
|
7888
7901
|
high: { color: "EF6C00", label: "high" },
|
|
7889
7902
|
moderate: { color: "FBC02D", label: "moderate" },
|
|
@@ -7894,12 +7907,14 @@ const Jh = ["critical", "high", "moderate", "low", "unknown"], Xh = {
|
|
|
7894
7907
|
async function ml() {
|
|
7895
7908
|
try {
|
|
7896
7909
|
Re("Audit Dependencies"), await Es();
|
|
7897
|
-
const e =
|
|
7910
|
+
const e = process.env.OWASP_NVD_API_KEY;
|
|
7911
|
+
console.log(1111, e === "90134b27-b657-4a99-8685-c3fc3e8e28fc");
|
|
7912
|
+
const t = await de("package.json");
|
|
7898
7913
|
await Ie("1️⃣", "owasp-dependency-check", [
|
|
7899
7914
|
"--out",
|
|
7900
7915
|
"dependency-check-reports",
|
|
7901
7916
|
"--project",
|
|
7902
|
-
|
|
7917
|
+
t.name ?? "unknown",
|
|
7903
7918
|
"--enableRetired",
|
|
7904
7919
|
"--nodePackageSkipDevDependencies",
|
|
7905
7920
|
"--nvdApiKey",
|
|
@@ -7911,13 +7926,13 @@ async function ml() {
|
|
|
7911
7926
|
}
|
|
7912
7927
|
async function Qh(e) {
|
|
7913
7928
|
re(`${e} Insert OWASP Badge(s) into 'README.md'`);
|
|
7914
|
-
const t = await
|
|
7929
|
+
const t = await de("dependency-check-reports/dependency-check-report.json"), i = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
7915
7930
|
for (const o of t.dependencies)
|
|
7916
7931
|
if (o.vulnerabilities != null)
|
|
7917
7932
|
for (const S of o.vulnerabilities) {
|
|
7918
7933
|
const w = S.severity?.toLowerCase() ?? "unknown";
|
|
7919
7934
|
if (w in i) {
|
|
7920
|
-
const C =
|
|
7935
|
+
const C = Xh.find((j) => j === w);
|
|
7921
7936
|
i[C ?? "unknown"]++;
|
|
7922
7937
|
} else
|
|
7923
7938
|
i.unknown++;
|
|
@@ -7931,12 +7946,12 @@ async function Qh(e) {
|
|
|
7931
7946
|
await Is("README.md", y), console.info("OWASP audit badge(s) inserted into 'README.md'");
|
|
7932
7947
|
}
|
|
7933
7948
|
async function el(e) {
|
|
7934
|
-
const t = await
|
|
7949
|
+
const t = await de("config.json"), i = [];
|
|
7935
7950
|
if (Object.values(e).reduce((n, u) => n + u, 0) === 0)
|
|
7936
7951
|
console.info("No vulnerabilities found."), i.push(`[](https://data-positioning.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
7937
7952
|
else
|
|
7938
7953
|
for (const [n, u] of Object.entries(e)) {
|
|
7939
|
-
const h =
|
|
7954
|
+
const h = Jh[n];
|
|
7940
7955
|
if (console.warn(`⚠️ ${u} ${h.label} vulnerability(ies) found.`), u === 0) continue;
|
|
7941
7956
|
const d = `https://img.shields.io/badge/OWASP-${u}%20${h.label}-${h.color}`;
|
|
7942
7957
|
i.push(`[](https://data-positioning.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
@@ -7977,9 +7992,9 @@ async function il(e, t) {
|
|
|
7977
7992
|
console.error("❌ No dependency license markers found in 'README.md'.");
|
|
7978
7993
|
return;
|
|
7979
7994
|
}
|
|
7980
|
-
const u = await
|
|
7995
|
+
const u = await de("licenses/licenses.json"), h = await de("licenses/downloads/licenses.ext.json");
|
|
7981
7996
|
let d = [];
|
|
7982
|
-
t && (d = await
|
|
7997
|
+
t && (d = await de("licenses/licenseTree.json"));
|
|
7983
7998
|
const y = [
|
|
7984
7999
|
...(() => {
|
|
7985
8000
|
const w = /* @__PURE__ */ new Map();
|
|
@@ -8001,8 +8016,8 @@ async function il(e, t) {
|
|
|
8001
8016
|
`;
|
|
8002
8017
|
for (const w of y) {
|
|
8003
8018
|
const C = w.installedVersion === w.remoteVersion ? w.installedVersion : `${w.installedVersion} ⚠️`, j = w.latestRemoteModified ? rl(w.latestRemoteModified.split("T")[0]) : "n/a", Z = w.dependencyCount != null && w.dependencyCount >= 0 ? w.dependencyCount : "n/a";
|
|
8004
|
-
let
|
|
8005
|
-
w.licenseFileLink == null || w.licenseFileLink == "" ?
|
|
8019
|
+
let le;
|
|
8020
|
+
w.licenseFileLink == null || w.licenseFileLink == "" ? le = "⚠️ No license file" : le = `[${w.licenseFileLink.slice(Math.max(0, w.licenseFileLink.lastIndexOf("/") + 1))}](${w.licenseFileLink})`, o += `|${w.name}|${w.licenseType}|${C}|${w.remoteVersion}|${j}|${Z}|${le}|
|
|
8006
8021
|
`;
|
|
8007
8022
|
}
|
|
8008
8023
|
const S = `${i.slice(0, Math.max(0, r + kr.length))}
|
|
@@ -8056,9 +8071,9 @@ async function _l(e) {
|
|
|
8056
8071
|
for (const y of u) {
|
|
8057
8072
|
const o = `${n}/${y}`;
|
|
8058
8073
|
try {
|
|
8059
|
-
const S = await
|
|
8074
|
+
const S = await Ee.stat(o);
|
|
8060
8075
|
if (S.isDirectory()) {
|
|
8061
|
-
const w = await
|
|
8076
|
+
const w = await Ee.readdir(o), C = { childCount: w.length, name: y, typeId: "folder" };
|
|
8062
8077
|
h.push(C), await i(o, w);
|
|
8063
8078
|
} else {
|
|
8064
8079
|
const w = { id: Ds(), lastModifiedAt: S.mtimeMs, name: y, size: S.size, typeId: "object" };
|
|
@@ -8073,8 +8088,8 @@ async function _l(e) {
|
|
|
8073
8088
|
return S === 0 ? y.name.localeCompare(o.name) : S;
|
|
8074
8089
|
});
|
|
8075
8090
|
}
|
|
8076
|
-
const r = await
|
|
8077
|
-
await i(`public/${e}`, r), await
|
|
8091
|
+
const r = await Ee.readdir(`public/${e}`);
|
|
8092
|
+
await i(`public/${e}`, r), await Ee.writeFile(`./public/${e}Index.json`, JSON.stringify(t), "utf8"), console.info("✅ Public directory index built.");
|
|
8078
8093
|
} catch (t) {
|
|
8079
8094
|
console.error("❌ Error building public directory index.", t);
|
|
8080
8095
|
}
|