@stryke/prisma-trpc-generator 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -8
- package/dist/generator.cjs +37 -3962
- package/dist/generator.js +37 -3962
- package/dist/index.cjs +37 -3962
- package/dist/index.js +37 -3962
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,9 +34,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
mod
|
|
35
35
|
));
|
|
36
36
|
|
|
37
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@
|
|
37
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@24.0.3__@swc+core@1.11.9_@swc+he_84b5ca65b673a98125863760c0a2754a/node_modules/tsup/assets/esm_shims.js
|
|
38
38
|
var init_esm_shims = __esm({
|
|
39
|
-
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@
|
|
39
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@24.0.3__@swc+core@1.11.9_@swc+he_84b5ca65b673a98125863760c0a2754a/node_modules/tsup/assets/esm_shims.js"() {
|
|
40
40
|
"use strict";
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -672,84 +672,6 @@ var require_pluralize = __commonJS({
|
|
|
672
672
|
}
|
|
673
673
|
});
|
|
674
674
|
|
|
675
|
-
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
676
|
-
function isPlainObject(value) {
|
|
677
|
-
if (value === null || typeof value !== "object") {
|
|
678
|
-
return false;
|
|
679
|
-
}
|
|
680
|
-
const prototype = Object.getPrototypeOf(value);
|
|
681
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
682
|
-
return false;
|
|
683
|
-
}
|
|
684
|
-
if (Symbol.iterator in value) {
|
|
685
|
-
return false;
|
|
686
|
-
}
|
|
687
|
-
if (Symbol.toStringTag in value) {
|
|
688
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
689
|
-
}
|
|
690
|
-
return true;
|
|
691
|
-
}
|
|
692
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
693
|
-
if (!isPlainObject(defaults)) {
|
|
694
|
-
return _defu(baseObject, {}, namespace, merger);
|
|
695
|
-
}
|
|
696
|
-
const object = Object.assign({}, defaults);
|
|
697
|
-
for (const key in baseObject) {
|
|
698
|
-
if (key === "__proto__" || key === "constructor") {
|
|
699
|
-
continue;
|
|
700
|
-
}
|
|
701
|
-
const value = baseObject[key];
|
|
702
|
-
if (value === null || value === void 0) {
|
|
703
|
-
continue;
|
|
704
|
-
}
|
|
705
|
-
if (merger && merger(object, key, value, namespace)) {
|
|
706
|
-
continue;
|
|
707
|
-
}
|
|
708
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
709
|
-
object[key] = [...value, ...object[key]];
|
|
710
|
-
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
711
|
-
object[key] = _defu(
|
|
712
|
-
value,
|
|
713
|
-
object[key],
|
|
714
|
-
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
715
|
-
merger
|
|
716
|
-
);
|
|
717
|
-
} else {
|
|
718
|
-
object[key] = value;
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
return object;
|
|
722
|
-
}
|
|
723
|
-
function createDefu(merger) {
|
|
724
|
-
return (...arguments_) => (
|
|
725
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
726
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
727
|
-
);
|
|
728
|
-
}
|
|
729
|
-
var defu, defuFn, defuArrayFn;
|
|
730
|
-
var init_defu = __esm({
|
|
731
|
-
"../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs"() {
|
|
732
|
-
"use strict";
|
|
733
|
-
init_esm_shims();
|
|
734
|
-
__name(isPlainObject, "isPlainObject");
|
|
735
|
-
__name(_defu, "_defu");
|
|
736
|
-
__name(createDefu, "createDefu");
|
|
737
|
-
defu = createDefu();
|
|
738
|
-
defuFn = createDefu((object, key, currentValue) => {
|
|
739
|
-
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
740
|
-
object[key] = currentValue(object[key]);
|
|
741
|
-
return true;
|
|
742
|
-
}
|
|
743
|
-
});
|
|
744
|
-
defuArrayFn = createDefu((object, key, currentValue) => {
|
|
745
|
-
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
746
|
-
object[key] = currentValue(object[key]);
|
|
747
|
-
return true;
|
|
748
|
-
}
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
|
|
753
675
|
// src/index.ts
|
|
754
676
|
init_esm_shims();
|
|
755
677
|
|
|
@@ -968,13 +890,13 @@ var util;
|
|
|
968
890
|
});
|
|
969
891
|
};
|
|
970
892
|
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
971
|
-
const
|
|
893
|
+
const keys = [];
|
|
972
894
|
for (const key in object) {
|
|
973
895
|
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
974
|
-
|
|
896
|
+
keys.push(key);
|
|
975
897
|
}
|
|
976
898
|
}
|
|
977
|
-
return
|
|
899
|
+
return keys;
|
|
978
900
|
};
|
|
979
901
|
util2.find = (arr, checker) => {
|
|
980
902
|
for (const item of arr) {
|
|
@@ -1366,9 +1288,9 @@ var ParseStatus = class _ParseStatus {
|
|
|
1366
1288
|
}
|
|
1367
1289
|
return { status: status.value, value: arrayValue };
|
|
1368
1290
|
}
|
|
1369
|
-
static async mergeObjectAsync(status,
|
|
1291
|
+
static async mergeObjectAsync(status, pairs) {
|
|
1370
1292
|
const syncPairs = [];
|
|
1371
|
-
for (const pair of
|
|
1293
|
+
for (const pair of pairs) {
|
|
1372
1294
|
const key = await pair.key;
|
|
1373
1295
|
const value = await pair.value;
|
|
1374
1296
|
syncPairs.push({
|
|
@@ -1378,9 +1300,9 @@ var ParseStatus = class _ParseStatus {
|
|
|
1378
1300
|
}
|
|
1379
1301
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
|
1380
1302
|
}
|
|
1381
|
-
static mergeObjectSync(status,
|
|
1303
|
+
static mergeObjectSync(status, pairs) {
|
|
1382
1304
|
const finalObject = {};
|
|
1383
|
-
for (const pair of
|
|
1305
|
+
for (const pair of pairs) {
|
|
1384
1306
|
const { key, value } = pair;
|
|
1385
1307
|
if (key.status === "aborted")
|
|
1386
1308
|
return INVALID;
|
|
@@ -3268,8 +3190,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3268
3190
|
if (this._cached !== null)
|
|
3269
3191
|
return this._cached;
|
|
3270
3192
|
const shape = this._def.shape();
|
|
3271
|
-
const
|
|
3272
|
-
return this._cached = { shape, keys
|
|
3193
|
+
const keys = util.objectKeys(shape);
|
|
3194
|
+
return this._cached = { shape, keys };
|
|
3273
3195
|
}
|
|
3274
3196
|
_parse(input) {
|
|
3275
3197
|
const parsedType = this._getType(input);
|
|
@@ -3292,11 +3214,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3292
3214
|
}
|
|
3293
3215
|
}
|
|
3294
3216
|
}
|
|
3295
|
-
const
|
|
3217
|
+
const pairs = [];
|
|
3296
3218
|
for (const key of shapeKeys) {
|
|
3297
3219
|
const keyValidator = shape[key];
|
|
3298
3220
|
const value = ctx.data[key];
|
|
3299
|
-
|
|
3221
|
+
pairs.push({
|
|
3300
3222
|
key: { status: "valid", value: key },
|
|
3301
3223
|
value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
|
|
3302
3224
|
alwaysSet: key in ctx.data
|
|
@@ -3306,7 +3228,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3306
3228
|
const unknownKeys = this._def.unknownKeys;
|
|
3307
3229
|
if (unknownKeys === "passthrough") {
|
|
3308
3230
|
for (const key of extraKeys) {
|
|
3309
|
-
|
|
3231
|
+
pairs.push({
|
|
3310
3232
|
key: { status: "valid", value: key },
|
|
3311
3233
|
value: { status: "valid", value: ctx.data[key] }
|
|
3312
3234
|
});
|
|
@@ -3327,7 +3249,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3327
3249
|
const catchall = this._def.catchall;
|
|
3328
3250
|
for (const key of extraKeys) {
|
|
3329
3251
|
const value = ctx.data[key];
|
|
3330
|
-
|
|
3252
|
+
pairs.push({
|
|
3331
3253
|
key: { status: "valid", value: key },
|
|
3332
3254
|
value: catchall._parse(
|
|
3333
3255
|
new ParseInputLazyPath(ctx, value, ctx.path, key)
|
|
@@ -3340,7 +3262,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3340
3262
|
if (ctx.common.async) {
|
|
3341
3263
|
return Promise.resolve().then(async () => {
|
|
3342
3264
|
const syncPairs = [];
|
|
3343
|
-
for (const pair of
|
|
3265
|
+
for (const pair of pairs) {
|
|
3344
3266
|
const key = await pair.key;
|
|
3345
3267
|
const value = await pair.value;
|
|
3346
3268
|
syncPairs.push({
|
|
@@ -3354,7 +3276,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3354
3276
|
return ParseStatus.mergeObjectSync(status, syncPairs);
|
|
3355
3277
|
});
|
|
3356
3278
|
} else {
|
|
3357
|
-
return ParseStatus.mergeObjectSync(status,
|
|
3279
|
+
return ParseStatus.mergeObjectSync(status, pairs);
|
|
3358
3280
|
}
|
|
3359
3281
|
}
|
|
3360
3282
|
get shape() {
|
|
@@ -3985,20 +3907,20 @@ var ZodRecord = class _ZodRecord extends ZodType {
|
|
|
3985
3907
|
});
|
|
3986
3908
|
return INVALID;
|
|
3987
3909
|
}
|
|
3988
|
-
const
|
|
3910
|
+
const pairs = [];
|
|
3989
3911
|
const keyType = this._def.keyType;
|
|
3990
3912
|
const valueType = this._def.valueType;
|
|
3991
3913
|
for (const key in ctx.data) {
|
|
3992
|
-
|
|
3914
|
+
pairs.push({
|
|
3993
3915
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
3994
3916
|
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
3995
3917
|
alwaysSet: key in ctx.data
|
|
3996
3918
|
});
|
|
3997
3919
|
}
|
|
3998
3920
|
if (ctx.common.async) {
|
|
3999
|
-
return ParseStatus.mergeObjectAsync(status,
|
|
3921
|
+
return ParseStatus.mergeObjectAsync(status, pairs);
|
|
4000
3922
|
} else {
|
|
4001
|
-
return ParseStatus.mergeObjectSync(status,
|
|
3923
|
+
return ParseStatus.mergeObjectSync(status, pairs);
|
|
4002
3924
|
}
|
|
4003
3925
|
}
|
|
4004
3926
|
get element() {
|
|
@@ -4043,7 +3965,7 @@ var ZodMap = class extends ZodType {
|
|
|
4043
3965
|
}
|
|
4044
3966
|
const keyType = this._def.keyType;
|
|
4045
3967
|
const valueType = this._def.valueType;
|
|
4046
|
-
const
|
|
3968
|
+
const pairs = [...ctx.data.entries()].map(([key, value], index) => {
|
|
4047
3969
|
return {
|
|
4048
3970
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
|
|
4049
3971
|
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
|
|
@@ -4052,7 +3974,7 @@ var ZodMap = class extends ZodType {
|
|
|
4052
3974
|
if (ctx.common.async) {
|
|
4053
3975
|
const finalMap = /* @__PURE__ */ new Map();
|
|
4054
3976
|
return Promise.resolve().then(async () => {
|
|
4055
|
-
for (const pair of
|
|
3977
|
+
for (const pair of pairs) {
|
|
4056
3978
|
const key = await pair.key;
|
|
4057
3979
|
const value = await pair.value;
|
|
4058
3980
|
if (key.status === "aborted" || value.status === "aborted") {
|
|
@@ -4067,7 +3989,7 @@ var ZodMap = class extends ZodType {
|
|
|
4067
3989
|
});
|
|
4068
3990
|
} else {
|
|
4069
3991
|
const finalMap = /* @__PURE__ */ new Map();
|
|
4070
|
-
for (const pair of
|
|
3992
|
+
for (const pair of pairs) {
|
|
4071
3993
|
const key = pair.key;
|
|
4072
3994
|
const value = pair.value;
|
|
4073
3995
|
if (key.status === "aborted" || value.status === "aborted") {
|
|
@@ -4879,13 +4801,13 @@ var ZodReadonly = class extends ZodType {
|
|
|
4879
4801
|
}
|
|
4880
4802
|
_parse(input) {
|
|
4881
4803
|
const result = this._def.innerType._parse(input);
|
|
4882
|
-
const
|
|
4804
|
+
const freeze = /* @__PURE__ */ __name((data) => {
|
|
4883
4805
|
if (isValid(data)) {
|
|
4884
4806
|
data.value = Object.freeze(data.value);
|
|
4885
4807
|
}
|
|
4886
4808
|
return data;
|
|
4887
4809
|
}, "freeze");
|
|
4888
|
-
return isAsync(result) ? result.then((data) =>
|
|
4810
|
+
return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
|
|
4889
4811
|
}
|
|
4890
4812
|
unwrap() {
|
|
4891
4813
|
return this._def.innerType;
|
|
@@ -5347,13 +5269,13 @@ __name(normalizeString2, "normalizeString");
|
|
|
5347
5269
|
// ../path/src/get-workspace-root.ts
|
|
5348
5270
|
init_esm_shims();
|
|
5349
5271
|
|
|
5350
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.
|
|
5272
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/index.js
|
|
5351
5273
|
init_esm_shims();
|
|
5352
5274
|
|
|
5353
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.
|
|
5275
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-PTHGOJU6.js
|
|
5354
5276
|
init_esm_shims();
|
|
5355
5277
|
|
|
5356
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.
|
|
5278
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-6JBGUE4A.js
|
|
5357
5279
|
init_esm_shims();
|
|
5358
5280
|
import { existsSync as existsSync2 } from "node:fs";
|
|
5359
5281
|
import { join } from "node:path";
|
|
@@ -5375,7 +5297,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
5375
5297
|
}
|
|
5376
5298
|
__name(findFolderUp, "findFolderUp");
|
|
5377
5299
|
|
|
5378
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.
|
|
5300
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-7IMLZPZF.js
|
|
5379
5301
|
init_esm_shims();
|
|
5380
5302
|
var _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
|
|
5381
5303
|
function normalizeWindowsPath3(input = "") {
|
|
@@ -5482,7 +5404,7 @@ var isAbsolute2 = /* @__PURE__ */ __name(function(p) {
|
|
|
5482
5404
|
return _IS_ABSOLUTE_RE2.test(p);
|
|
5483
5405
|
}, "isAbsolute");
|
|
5484
5406
|
|
|
5485
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.
|
|
5407
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-PTHGOJU6.js
|
|
5486
5408
|
var rootFiles = [
|
|
5487
5409
|
"storm-workspace.json",
|
|
5488
5410
|
"storm-workspace.json",
|
|
@@ -5533,1414 +5455,6 @@ function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
|
5533
5455
|
}
|
|
5534
5456
|
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
5535
5457
|
|
|
5536
|
-
// ../../node_modules/.pnpm/@ltd+j-toml@1.38.0/node_modules/@ltd/j-toml/index.mjs
|
|
5537
|
-
init_esm_shims();
|
|
5538
|
-
var SyntaxError$1 = SyntaxError;
|
|
5539
|
-
var RangeError$1 = RangeError;
|
|
5540
|
-
var TypeError$1 = TypeError;
|
|
5541
|
-
var Error$1 = { if: Error }.if;
|
|
5542
|
-
var undefined$1 = void 0;
|
|
5543
|
-
var BigInt$1 = typeof BigInt === "undefined" ? undefined$1 : BigInt;
|
|
5544
|
-
var RegExp$1 = RegExp;
|
|
5545
|
-
var WeakMap$1 = WeakMap;
|
|
5546
|
-
var get = WeakMap.prototype.get;
|
|
5547
|
-
var set = WeakMap.prototype.set;
|
|
5548
|
-
var create$1 = Object.create;
|
|
5549
|
-
var isSafeInteger = Number.isSafeInteger;
|
|
5550
|
-
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
5551
|
-
var freeze = Object.freeze;
|
|
5552
|
-
var isPrototypeOf = Object.prototype.isPrototypeOf;
|
|
5553
|
-
var NULL = (
|
|
5554
|
-
/* j-globals: null.prototype (internal) */
|
|
5555
|
-
Object.seal ? /* @__PURE__ */ Object.preventExtensions(/* @__PURE__ */ Object.create(null)) : null
|
|
5556
|
-
);
|
|
5557
|
-
var bind = Function.prototype.bind;
|
|
5558
|
-
var test = RegExp.prototype.test;
|
|
5559
|
-
var exec = RegExp.prototype.exec;
|
|
5560
|
-
var apply$1 = Reflect.apply;
|
|
5561
|
-
var Proxy$1 = Proxy;
|
|
5562
|
-
var assign$1 = Object.assign;
|
|
5563
|
-
var Object$1 = Object;
|
|
5564
|
-
var floor = Math.floor;
|
|
5565
|
-
var isArray$1 = Array.isArray;
|
|
5566
|
-
var Infinity2 = 1 / 0;
|
|
5567
|
-
var fromCharCode = String.fromCharCode;
|
|
5568
|
-
var Array$1 = Array;
|
|
5569
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
5570
|
-
var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
5571
|
-
var apply = Function.prototype.apply;
|
|
5572
|
-
var isEnum = /* @__PURE__ */ propertyIsEnumerable.call.bind(propertyIsEnumerable);
|
|
5573
|
-
var hasOwn = (
|
|
5574
|
-
/* j-globals: Object.hasOwn (polyfill) */
|
|
5575
|
-
Object$1.hasOwn || /* @__PURE__ */ function() {
|
|
5576
|
-
return hasOwnProperty.bind ? hasOwnProperty.call.bind(hasOwnProperty) : /* @__PURE__ */ __name(function hasOwn2(object, key) {
|
|
5577
|
-
return hasOwnProperty.call(object, key);
|
|
5578
|
-
}, "hasOwn");
|
|
5579
|
-
}()
|
|
5580
|
-
);
|
|
5581
|
-
var create = Object$1.create;
|
|
5582
|
-
function Descriptor(source) {
|
|
5583
|
-
var target = create(NULL);
|
|
5584
|
-
if (hasOwn(source, "value")) {
|
|
5585
|
-
target.value = source.value;
|
|
5586
|
-
}
|
|
5587
|
-
if (hasOwn(source, "writable")) {
|
|
5588
|
-
target.writable = source.writable;
|
|
5589
|
-
}
|
|
5590
|
-
if (hasOwn(source, "get")) {
|
|
5591
|
-
target.get = source.get;
|
|
5592
|
-
}
|
|
5593
|
-
if (hasOwn(source, "set")) {
|
|
5594
|
-
target.set = source.set;
|
|
5595
|
-
}
|
|
5596
|
-
if (hasOwn(source, "enumerable")) {
|
|
5597
|
-
target.enumerable = source.enumerable;
|
|
5598
|
-
}
|
|
5599
|
-
if (hasOwn(source, "configurable")) {
|
|
5600
|
-
target.configurable = source.configurable;
|
|
5601
|
-
}
|
|
5602
|
-
return target;
|
|
5603
|
-
}
|
|
5604
|
-
__name(Descriptor, "Descriptor");
|
|
5605
|
-
var Test = bind ? /* @__PURE__ */ bind.bind(test) : function(re) {
|
|
5606
|
-
return function(string) {
|
|
5607
|
-
return test.call(re, string);
|
|
5608
|
-
};
|
|
5609
|
-
};
|
|
5610
|
-
var Exec = bind ? /* @__PURE__ */ bind.bind(exec) : function(re) {
|
|
5611
|
-
return function(string) {
|
|
5612
|
-
return exec.call(re, string);
|
|
5613
|
-
};
|
|
5614
|
-
};
|
|
5615
|
-
function __PURE__(re) {
|
|
5616
|
-
var test2 = re.test = Test(re);
|
|
5617
|
-
var exec2 = re.exec = Exec(re);
|
|
5618
|
-
var source = test2.source = exec2.source = re.source;
|
|
5619
|
-
test2.unicode = exec2.unicode = re.unicode;
|
|
5620
|
-
test2.ignoreCase = exec2.ignoreCase = re.ignoreCase;
|
|
5621
|
-
test2.multiline = exec2.multiline = source.indexOf("^") < 0 && source.indexOf("$") < 0 ? null : re.multiline;
|
|
5622
|
-
test2.dotAll = exec2.dotAll = source.indexOf(".") < 0 ? null : re.dotAll;
|
|
5623
|
-
return re;
|
|
5624
|
-
}
|
|
5625
|
-
__name(__PURE__, "__PURE__");
|
|
5626
|
-
function theRegExp(re) {
|
|
5627
|
-
return /* @__PURE__ */ __PURE__(re);
|
|
5628
|
-
}
|
|
5629
|
-
__name(theRegExp, "theRegExp");
|
|
5630
|
-
var NT = /[\n\t]+/g;
|
|
5631
|
-
var ESCAPE = /\\./g;
|
|
5632
|
-
function graveAccentReplacer($$) {
|
|
5633
|
-
return $$ === "\\`" ? "`" : $$;
|
|
5634
|
-
}
|
|
5635
|
-
__name(graveAccentReplacer, "graveAccentReplacer");
|
|
5636
|
-
var includes = "".includes ? function(that, searchString) {
|
|
5637
|
-
return that.includes(searchString);
|
|
5638
|
-
} : function(that, searchString) {
|
|
5639
|
-
return that.indexOf(searchString) > -1;
|
|
5640
|
-
};
|
|
5641
|
-
function RE(template) {
|
|
5642
|
-
var U = this.U;
|
|
5643
|
-
var I = this.I;
|
|
5644
|
-
var M = this.M;
|
|
5645
|
-
var S = this.S;
|
|
5646
|
-
var raw = template.raw;
|
|
5647
|
-
var source = raw[0].replace(NT, "");
|
|
5648
|
-
var index = 1;
|
|
5649
|
-
var length = arguments.length;
|
|
5650
|
-
while (index !== length) {
|
|
5651
|
-
var value = arguments[index];
|
|
5652
|
-
if (typeof value === "string") {
|
|
5653
|
-
source += value;
|
|
5654
|
-
} else {
|
|
5655
|
-
var value_source = value.source;
|
|
5656
|
-
if (typeof value_source !== "string") {
|
|
5657
|
-
throw TypeError$1("source");
|
|
5658
|
-
}
|
|
5659
|
-
if (value.unicode === U) {
|
|
5660
|
-
throw SyntaxError$1("unicode");
|
|
5661
|
-
}
|
|
5662
|
-
if (value.ignoreCase === I) {
|
|
5663
|
-
throw SyntaxError$1("ignoreCase");
|
|
5664
|
-
}
|
|
5665
|
-
if (value.multiline === M && (includes(value_source, "^") || includes(value_source, "$"))) {
|
|
5666
|
-
throw SyntaxError$1("multiline");
|
|
5667
|
-
}
|
|
5668
|
-
if (value.dotAll === S && includes(value_source, ".")) {
|
|
5669
|
-
throw SyntaxError$1("dotAll");
|
|
5670
|
-
}
|
|
5671
|
-
source += value_source;
|
|
5672
|
-
}
|
|
5673
|
-
source += raw[index++].replace(NT, "");
|
|
5674
|
-
}
|
|
5675
|
-
var re = RegExp$1(U ? source = source.replace(ESCAPE, graveAccentReplacer) : source, this.flags);
|
|
5676
|
-
var test2 = re.test = Test(re);
|
|
5677
|
-
var exec2 = re.exec = Exec(re);
|
|
5678
|
-
test2.source = exec2.source = source;
|
|
5679
|
-
test2.unicode = exec2.unicode = !U;
|
|
5680
|
-
test2.ignoreCase = exec2.ignoreCase = !I;
|
|
5681
|
-
test2.multiline = exec2.multiline = includes(source, "^") || includes(source, "$") ? !M : null;
|
|
5682
|
-
test2.dotAll = exec2.dotAll = includes(source, ".") ? !S : null;
|
|
5683
|
-
return re;
|
|
5684
|
-
}
|
|
5685
|
-
__name(RE, "RE");
|
|
5686
|
-
var RE_bind = bind && /* @__PURE__ */ bind.bind(RE);
|
|
5687
|
-
function Context(flags) {
|
|
5688
|
-
return {
|
|
5689
|
-
U: !includes(flags, "u"),
|
|
5690
|
-
I: !includes(flags, "i"),
|
|
5691
|
-
M: !includes(flags, "m"),
|
|
5692
|
-
S: !includes(flags, "s"),
|
|
5693
|
-
flags
|
|
5694
|
-
};
|
|
5695
|
-
}
|
|
5696
|
-
__name(Context, "Context");
|
|
5697
|
-
var CONTEXT = /* @__PURE__ */ Context("");
|
|
5698
|
-
var newRegExp = Proxy$1 ? /* @__PURE__ */ new Proxy$1(RE, {
|
|
5699
|
-
apply: /* @__PURE__ */ __name(function(RE2, thisArg, args) {
|
|
5700
|
-
return apply$1(RE2, CONTEXT, args);
|
|
5701
|
-
}, "apply"),
|
|
5702
|
-
get: /* @__PURE__ */ __name(function(RE2, flags) {
|
|
5703
|
-
return RE_bind(Context(flags));
|
|
5704
|
-
}, "get"),
|
|
5705
|
-
defineProperty: /* @__PURE__ */ __name(function() {
|
|
5706
|
-
return false;
|
|
5707
|
-
}, "defineProperty"),
|
|
5708
|
-
preventExtensions: /* @__PURE__ */ __name(function() {
|
|
5709
|
-
return false;
|
|
5710
|
-
}, "preventExtensions")
|
|
5711
|
-
}) : /* @__PURE__ */ function() {
|
|
5712
|
-
RE.apply = RE.apply;
|
|
5713
|
-
var newRegExp2 = /* @__PURE__ */ __name(function() {
|
|
5714
|
-
return RE.apply(CONTEXT, arguments);
|
|
5715
|
-
}, "newRegExp");
|
|
5716
|
-
var d2 = 1;
|
|
5717
|
-
var g = d2 * 2;
|
|
5718
|
-
var i = g * 2;
|
|
5719
|
-
var m = i * 2;
|
|
5720
|
-
var s = i * 2;
|
|
5721
|
-
var u = s * 2;
|
|
5722
|
-
var y = u * 2;
|
|
5723
|
-
var flags = y * 2 - 1;
|
|
5724
|
-
while (flags--) {
|
|
5725
|
-
(function(context) {
|
|
5726
|
-
newRegExp2[context.flags] = function() {
|
|
5727
|
-
return RE.apply(context, arguments);
|
|
5728
|
-
};
|
|
5729
|
-
})(Context(
|
|
5730
|
-
(flags & d2 ? "" : "d") + (flags & g ? "" : "g") + (flags & i ? "" : "i") + (flags & m ? "" : "m") + (flags & s ? "" : "s") + (flags & u ? "" : "u") + (flags & y ? "" : "y")
|
|
5731
|
-
));
|
|
5732
|
-
}
|
|
5733
|
-
return freeze ? freeze(newRegExp2) : newRegExp2;
|
|
5734
|
-
}();
|
|
5735
|
-
var clearRegExp = "$_" in RegExp$1 ? /* @__PURE__ */ function() {
|
|
5736
|
-
var REGEXP = /^/;
|
|
5737
|
-
REGEXP.test = REGEXP.test;
|
|
5738
|
-
return /* @__PURE__ */ __name(function clearRegExp3(value) {
|
|
5739
|
-
REGEXP.test("");
|
|
5740
|
-
return value;
|
|
5741
|
-
}, "clearRegExp");
|
|
5742
|
-
}() : /* @__PURE__ */ __name(function clearRegExp2(value) {
|
|
5743
|
-
return value;
|
|
5744
|
-
}, "clearRegExp");
|
|
5745
|
-
var NEED_TO_ESCAPE_IN_REGEXP = /^[$()*+\-.?[\\\]^{|]/;
|
|
5746
|
-
var SURROGATE_PAIR = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/;
|
|
5747
|
-
var GROUP = /* @__PURE__ */ create$1(NULL);
|
|
5748
|
-
function groupify(branches, uFlag, noEscape) {
|
|
5749
|
-
var group = create$1(NULL);
|
|
5750
|
-
var appendBranch = uFlag ? appendPointBranch : appendCodeBranch;
|
|
5751
|
-
for (var length = branches.length, index = 0; index < length; ++index) {
|
|
5752
|
-
appendBranch(group, branches[index]);
|
|
5753
|
-
}
|
|
5754
|
-
return sourcify(group, !noEscape);
|
|
5755
|
-
}
|
|
5756
|
-
__name(groupify, "groupify");
|
|
5757
|
-
function appendPointBranch(group, branch) {
|
|
5758
|
-
if (branch) {
|
|
5759
|
-
var character = SURROGATE_PAIR.test(branch) ? branch.slice(0, 2) : branch.charAt(0);
|
|
5760
|
-
appendPointBranch(group[character] || (group[character] = create$1(NULL)), branch.slice(character.length));
|
|
5761
|
-
} else {
|
|
5762
|
-
group[""] = GROUP;
|
|
5763
|
-
}
|
|
5764
|
-
}
|
|
5765
|
-
__name(appendPointBranch, "appendPointBranch");
|
|
5766
|
-
function appendCodeBranch(group, branch) {
|
|
5767
|
-
if (branch) {
|
|
5768
|
-
var character = branch.charAt(0);
|
|
5769
|
-
appendCodeBranch(group[character] || (group[character] = create$1(NULL)), branch.slice(1));
|
|
5770
|
-
} else {
|
|
5771
|
-
group[""] = GROUP;
|
|
5772
|
-
}
|
|
5773
|
-
}
|
|
5774
|
-
__name(appendCodeBranch, "appendCodeBranch");
|
|
5775
|
-
function sourcify(group, needEscape) {
|
|
5776
|
-
var branches = [];
|
|
5777
|
-
var singleCharactersBranch = [];
|
|
5778
|
-
var noEmptyBranch = true;
|
|
5779
|
-
for (var character in group) {
|
|
5780
|
-
if (character) {
|
|
5781
|
-
var sub_branches = sourcify(group[character], needEscape);
|
|
5782
|
-
if (needEscape && NEED_TO_ESCAPE_IN_REGEXP.test(character)) {
|
|
5783
|
-
character = "\\" + character;
|
|
5784
|
-
}
|
|
5785
|
-
sub_branches ? branches.push(character + sub_branches) : singleCharactersBranch.push(character);
|
|
5786
|
-
} else {
|
|
5787
|
-
noEmptyBranch = false;
|
|
5788
|
-
}
|
|
5789
|
-
}
|
|
5790
|
-
singleCharactersBranch.length && branches.unshift(singleCharactersBranch.length === 1 ? singleCharactersBranch[0] : "[" + singleCharactersBranch.join("") + "]");
|
|
5791
|
-
return branches.length === 0 ? "" : (branches.length === 1 && (singleCharactersBranch.length || noEmptyBranch) ? branches[0] : "(?:" + branches.join("|") + ")") + (noEmptyBranch ? "" : "?");
|
|
5792
|
-
}
|
|
5793
|
-
__name(sourcify, "sourcify");
|
|
5794
|
-
var WeakSet$1 = WeakSet;
|
|
5795
|
-
var has = WeakSet.prototype.has;
|
|
5796
|
-
var add = WeakSet.prototype.add;
|
|
5797
|
-
var del = WeakSet.prototype["delete"];
|
|
5798
|
-
var keys = Object.keys;
|
|
5799
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
5800
|
-
var Null$1 = (
|
|
5801
|
-
/* j-globals: null (internal) */
|
|
5802
|
-
/* @__PURE__ */ function() {
|
|
5803
|
-
var assign = Object.assign || /* @__PURE__ */ __name(function assign2(target, source) {
|
|
5804
|
-
var keys$1, index, key;
|
|
5805
|
-
for (keys$1 = keys(source), index = 0; index < keys$1.length; ++index) {
|
|
5806
|
-
key = keys$1[index];
|
|
5807
|
-
target[key] = source[key];
|
|
5808
|
-
}
|
|
5809
|
-
if (getOwnPropertySymbols) {
|
|
5810
|
-
for (keys$1 = getOwnPropertySymbols(source), index = 0; index < keys$1.length; ++index) {
|
|
5811
|
-
key = keys$1[index];
|
|
5812
|
-
if (isEnum(source, key)) {
|
|
5813
|
-
target[key] = source[key];
|
|
5814
|
-
}
|
|
5815
|
-
}
|
|
5816
|
-
}
|
|
5817
|
-
return target;
|
|
5818
|
-
}, "assign");
|
|
5819
|
-
function Nullify(constructor) {
|
|
5820
|
-
delete constructor.prototype.constructor;
|
|
5821
|
-
freeze(constructor.prototype);
|
|
5822
|
-
return constructor;
|
|
5823
|
-
}
|
|
5824
|
-
__name(Nullify, "Nullify");
|
|
5825
|
-
function Null(origin) {
|
|
5826
|
-
return origin === undefined$1 ? this : typeof origin === "function" ? /* @__PURE__ */ Nullify(origin) : /* @__PURE__ */ assign(/* @__PURE__ */ create(NULL), origin);
|
|
5827
|
-
}
|
|
5828
|
-
__name(Null, "Null");
|
|
5829
|
-
delete Null.name;
|
|
5830
|
-
Null.prototype = null;
|
|
5831
|
-
freeze(Null);
|
|
5832
|
-
return Null;
|
|
5833
|
-
}()
|
|
5834
|
-
);
|
|
5835
|
-
var is = Object.is;
|
|
5836
|
-
var Object_defineProperties = Object.defineProperties;
|
|
5837
|
-
var fromEntries = Object.fromEntries;
|
|
5838
|
-
var Reflect_construct = Reflect.construct;
|
|
5839
|
-
var Reflect_defineProperty = Reflect.defineProperty;
|
|
5840
|
-
var Reflect_deleteProperty = Reflect.deleteProperty;
|
|
5841
|
-
var ownKeys = Reflect.ownKeys;
|
|
5842
|
-
var Keeper = /* @__PURE__ */ __name(() => [], "Keeper");
|
|
5843
|
-
var newWeakMap = /* @__PURE__ */ __name(() => {
|
|
5844
|
-
const weakMap = new WeakMap$1();
|
|
5845
|
-
weakMap.has = weakMap.has;
|
|
5846
|
-
weakMap.get = weakMap.get;
|
|
5847
|
-
weakMap.set = weakMap.set;
|
|
5848
|
-
return weakMap;
|
|
5849
|
-
}, "newWeakMap");
|
|
5850
|
-
var target2keeper = /* @__PURE__ */ newWeakMap();
|
|
5851
|
-
var proxy2target = /* @__PURE__ */ newWeakMap();
|
|
5852
|
-
var target2proxy = /* @__PURE__ */ newWeakMap();
|
|
5853
|
-
var handlers = /* @__PURE__ */ assign$1(create$1(NULL), {
|
|
5854
|
-
defineProperty: /* @__PURE__ */ __name((target, key, descriptor) => {
|
|
5855
|
-
if (hasOwn(target, key)) {
|
|
5856
|
-
return Reflect_defineProperty(target, key, assign$1(create$1(NULL), descriptor));
|
|
5857
|
-
}
|
|
5858
|
-
if (Reflect_defineProperty(target, key, assign$1(create$1(NULL), descriptor))) {
|
|
5859
|
-
const keeper = target2keeper.get(target);
|
|
5860
|
-
keeper[keeper.length] = key;
|
|
5861
|
-
return true;
|
|
5862
|
-
}
|
|
5863
|
-
return false;
|
|
5864
|
-
}, "defineProperty"),
|
|
5865
|
-
deleteProperty: /* @__PURE__ */ __name((target, key) => {
|
|
5866
|
-
if (Reflect_deleteProperty(target, key)) {
|
|
5867
|
-
const keeper = target2keeper.get(target);
|
|
5868
|
-
const index = keeper.indexOf(key);
|
|
5869
|
-
index < 0 || --keeper.copyWithin(index, index + 1).length;
|
|
5870
|
-
return true;
|
|
5871
|
-
}
|
|
5872
|
-
return false;
|
|
5873
|
-
}, "deleteProperty"),
|
|
5874
|
-
ownKeys: /* @__PURE__ */ __name((target) => target2keeper.get(target), "ownKeys"),
|
|
5875
|
-
construct: /* @__PURE__ */ __name((target, args, newTarget) => orderify(Reflect_construct(target, args, newTarget)), "construct"),
|
|
5876
|
-
apply: /* @__PURE__ */ __name((target, thisArg, args) => orderify(apply$1(target, thisArg, args)), "apply")
|
|
5877
|
-
});
|
|
5878
|
-
var newProxy = /* @__PURE__ */ __name((target, keeper) => {
|
|
5879
|
-
target2keeper.set(target, keeper);
|
|
5880
|
-
const proxy = new Proxy$1(target, handlers);
|
|
5881
|
-
proxy2target.set(proxy, target);
|
|
5882
|
-
return proxy;
|
|
5883
|
-
}, "newProxy");
|
|
5884
|
-
var orderify = /* @__PURE__ */ __name((object) => {
|
|
5885
|
-
if (proxy2target.has(object)) {
|
|
5886
|
-
return object;
|
|
5887
|
-
}
|
|
5888
|
-
let proxy = target2proxy.get(object);
|
|
5889
|
-
if (proxy) {
|
|
5890
|
-
return proxy;
|
|
5891
|
-
}
|
|
5892
|
-
proxy = newProxy(object, assign$1(Keeper(), ownKeys(object)));
|
|
5893
|
-
target2proxy.set(object, proxy);
|
|
5894
|
-
return proxy;
|
|
5895
|
-
}, "orderify");
|
|
5896
|
-
var map_has = WeakMap.prototype.has;
|
|
5897
|
-
var map_del = WeakMap.prototype["delete"];
|
|
5898
|
-
var INLINES = new WeakMap$1();
|
|
5899
|
-
var SECTIONS = new WeakSet$1();
|
|
5900
|
-
var ofInline = /* @__PURE__ */ get.bind(INLINES);
|
|
5901
|
-
var isSection = /* @__PURE__ */ has.bind(SECTIONS);
|
|
5902
|
-
var tables = new WeakSet$1();
|
|
5903
|
-
var implicitTables = new WeakSet$1();
|
|
5904
|
-
var pairs = new WeakSet$1();
|
|
5905
|
-
var NONE = [];
|
|
5906
|
-
var sourcePath = "";
|
|
5907
|
-
var sourceLines = NONE;
|
|
5908
|
-
var lineIndex = -1;
|
|
5909
|
-
var throws = /* @__PURE__ */ __name((error) => {
|
|
5910
|
-
throw error;
|
|
5911
|
-
}, "throws");
|
|
5912
|
-
var where = /* @__PURE__ */ __name((pre, rowIndex = lineIndex, columnNumber = 0) => sourceLines === NONE ? "" : sourcePath ? `
|
|
5913
|
-
at (${sourcePath}:${rowIndex + 1}:${columnNumber})` : `${pre}line ${rowIndex + 1}: ${sourceLines[rowIndex]}`, "where");
|
|
5914
|
-
var Whitespace = /[ \t]/;
|
|
5915
|
-
var { exec: VALUE_REST_exec } = /* @__PURE__ */ newRegExp.s`
|
|
5916
|
-
^
|
|
5917
|
-
(
|
|
5918
|
-
(?:\d\d\d\d-\d\d-\d\d \d)?
|
|
5919
|
-
[\w\-+.:]+
|
|
5920
|
-
)
|
|
5921
|
-
${Whitespace}*
|
|
5922
|
-
(.*)
|
|
5923
|
-
$`.valueOf();
|
|
5924
|
-
var { exec: LITERAL_STRING_exec } = /* @__PURE__ */ newRegExp.s`
|
|
5925
|
-
^
|
|
5926
|
-
'([^']*)'
|
|
5927
|
-
${Whitespace}*
|
|
5928
|
-
(.*)`.valueOf();
|
|
5929
|
-
var { exec: MULTI_LINE_LITERAL_STRING_0_1_2 } = /* @__PURE__ */ newRegExp.s`
|
|
5930
|
-
^
|
|
5931
|
-
(.*?)
|
|
5932
|
-
'''('{0,2})
|
|
5933
|
-
${Whitespace}*
|
|
5934
|
-
(.*)`.valueOf();
|
|
5935
|
-
var { exec: MULTI_LINE_LITERAL_STRING_0 } = /* @__PURE__ */ newRegExp.s`
|
|
5936
|
-
^
|
|
5937
|
-
(.*?)
|
|
5938
|
-
'''()
|
|
5939
|
-
${Whitespace}*
|
|
5940
|
-
(.*)`.valueOf();
|
|
5941
|
-
var Tag = /[^\x00-\x1F"#'()<>[\\\]`{}\x7F]+/;
|
|
5942
|
-
var { exec: KEY_VALUE_PAIR_exec } = /* @__PURE__ */ newRegExp.s`
|
|
5943
|
-
^
|
|
5944
|
-
${Whitespace}*
|
|
5945
|
-
=
|
|
5946
|
-
${Whitespace}*
|
|
5947
|
-
(?:
|
|
5948
|
-
<(${Tag})>
|
|
5949
|
-
${Whitespace}*
|
|
5950
|
-
)?
|
|
5951
|
-
(.*)
|
|
5952
|
-
$`.valueOf();
|
|
5953
|
-
var { exec: _VALUE_PAIR_exec } = /* @__PURE__ */ newRegExp.s`
|
|
5954
|
-
^
|
|
5955
|
-
<(${Tag})>
|
|
5956
|
-
${Whitespace}*
|
|
5957
|
-
(.*)
|
|
5958
|
-
$`.valueOf();
|
|
5959
|
-
var { exec: TAG_REST_exec } = /* @__PURE__ */ newRegExp.s`
|
|
5960
|
-
^
|
|
5961
|
-
<(${Tag})>
|
|
5962
|
-
${Whitespace}*
|
|
5963
|
-
(.*)
|
|
5964
|
-
$`.valueOf();
|
|
5965
|
-
var MULTI_LINE_BASIC_STRING = theRegExp(/[^\\"]+|\\.?|"(?!"")"?/sy);
|
|
5966
|
-
var BASIC_STRING_TAB______ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
5967
|
-
var BASIC_STRING__________ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
5968
|
-
var BASIC_STRING_DEL______ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
5969
|
-
var BASIC_STRING_DEL_SLASH = theRegExp(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\/]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
|
|
5970
|
-
var { test: IS_DOT_KEY } = theRegExp(/^[ \t]*\./);
|
|
5971
|
-
var { exec: BARE_KEY_STRICT } = theRegExp(/^[\w-]+/);
|
|
5972
|
-
var { exec: BARE_KEY_FREE } = theRegExp(/^[^ \t#=[\]'".]+(?:[ \t]+[^ \t#=[\]'".]+)*/);
|
|
5973
|
-
var { exec: LITERAL_KEY____ } = theRegExp(/^'[^'\x00-\x08\x0B-\x1F\x7F]*'/);
|
|
5974
|
-
var { exec: LITERAL_KEY_DEL } = theRegExp(/^'[^'\x00-\x08\x0B-\x1F]*'/);
|
|
5975
|
-
var { test: CONTROL_CHARACTER_EXCLUDE_TAB____ } = theRegExp(/[\x00-\x08\x0B-\x1F\x7F]/);
|
|
5976
|
-
var { test: CONTROL_CHARACTER_EXCLUDE_TAB_DEL } = theRegExp(/[\x00-\x08\x0B-\x1F]/);
|
|
5977
|
-
var NUM = /* @__PURE__ */ newRegExp`
|
|
5978
|
-
(?:
|
|
5979
|
-
0
|
|
5980
|
-
(?:
|
|
5981
|
-
b[01][_01]*
|
|
5982
|
-
|
|
|
5983
|
-
o[0-7][_0-7]*
|
|
5984
|
-
|
|
|
5985
|
-
x[\dA-Fa-f][_\dA-Fa-f]*
|
|
5986
|
-
|
|
|
5987
|
-
(?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
|
|
5988
|
-
)
|
|
5989
|
-
|
|
|
5990
|
-
[1-9][_\d]*
|
|
5991
|
-
(?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
|
|
5992
|
-
|
|
|
5993
|
-
inf
|
|
5994
|
-
|
|
|
5995
|
-
nan
|
|
5996
|
-
)
|
|
5997
|
-
`.valueOf();
|
|
5998
|
-
var { test: IS_AMAZING } = /* @__PURE__ */ newRegExp`
|
|
5999
|
-
^(?:
|
|
6000
|
-
-?${NUM}
|
|
6001
|
-
(?:-${NUM})*
|
|
6002
|
-
|
|
|
6003
|
-
true
|
|
6004
|
-
|
|
|
6005
|
-
false
|
|
6006
|
-
)$
|
|
6007
|
-
`.valueOf();
|
|
6008
|
-
var { test: BAD_DXOB } = /* @__PURE__ */ newRegExp`_(?![\dA-Fa-f])`.valueOf();
|
|
6009
|
-
var isAmazing = /* @__PURE__ */ __name((keys2) => IS_AMAZING(keys2) && !BAD_DXOB(keys2), "isAmazing");
|
|
6010
|
-
var Keys = class KeysRegExp extends RegExp$1 {
|
|
6011
|
-
static {
|
|
6012
|
-
__name(this, "KeysRegExp");
|
|
6013
|
-
}
|
|
6014
|
-
constructor(keys2) {
|
|
6015
|
-
super(`^${groupify(keys2)}$`);
|
|
6016
|
-
let maxLength = -1;
|
|
6017
|
-
for (let index = keys2.length; index; ) {
|
|
6018
|
-
const { length } = keys2[--index];
|
|
6019
|
-
if (length > maxLength) {
|
|
6020
|
-
maxLength = length;
|
|
6021
|
-
}
|
|
6022
|
-
}
|
|
6023
|
-
this.lastIndex = maxLength + 1;
|
|
6024
|
-
return this;
|
|
6025
|
-
}
|
|
6026
|
-
test(key) {
|
|
6027
|
-
return key.length < this.lastIndex && super.test(key);
|
|
6028
|
-
}
|
|
6029
|
-
};
|
|
6030
|
-
var isKeys = /* @__PURE__ */ isPrototypeOf.bind(/* @__PURE__ */ freeze(Keys.prototype));
|
|
6031
|
-
var zeroDatetime;
|
|
6032
|
-
var arrayTypes = new WeakMap$1();
|
|
6033
|
-
var arrayTypes_get = /* @__PURE__ */ get.bind(arrayTypes);
|
|
6034
|
-
var arrayTypes_set = /* @__PURE__ */ set.bind(arrayTypes);
|
|
6035
|
-
var As = /* @__PURE__ */ __name(() => {
|
|
6036
|
-
const as = /* @__PURE__ */ __name((array) => {
|
|
6037
|
-
const got = arrayTypes_get(array);
|
|
6038
|
-
got ? got === as || throws(TypeError$1(`Types in Array must be same` + where(". Check "))) : arrayTypes_set(array, as);
|
|
6039
|
-
return array;
|
|
6040
|
-
}, "as");
|
|
6041
|
-
return as;
|
|
6042
|
-
}, "As");
|
|
6043
|
-
var AS_TYPED = {
|
|
6044
|
-
asNulls: As(),
|
|
6045
|
-
asStrings: As(),
|
|
6046
|
-
asTables: As(),
|
|
6047
|
-
asArrays: As(),
|
|
6048
|
-
asBooleans: As(),
|
|
6049
|
-
asFloats: As(),
|
|
6050
|
-
asIntegers: As(),
|
|
6051
|
-
asOffsetDateTimes: As(),
|
|
6052
|
-
asLocalDateTimes: As(),
|
|
6053
|
-
asLocalDates: As(),
|
|
6054
|
-
asLocalTimes: As()
|
|
6055
|
-
};
|
|
6056
|
-
var isView = ArrayBuffer.isView;
|
|
6057
|
-
var TextDecoder$1 = TextDecoder;
|
|
6058
|
-
var Symbol$1 = Symbol;
|
|
6059
|
-
var previous = Symbol$1("previous");
|
|
6060
|
-
var _literal = Symbol$1("_literal");
|
|
6061
|
-
var arrays = new WeakSet$1();
|
|
6062
|
-
var staticalArrays = new WeakSet$1();
|
|
6063
|
-
var NativeDate = Date;
|
|
6064
|
-
var parse$2 = Date.parse;
|
|
6065
|
-
var preventExtensions = Object.preventExtensions;
|
|
6066
|
-
var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
|
|
6067
|
-
var defineProperties = (
|
|
6068
|
-
/* j-globals: null.defineProperties (internal) */
|
|
6069
|
-
/* @__PURE__ */ __name(function defineProperties2(object, descriptorMap) {
|
|
6070
|
-
var created = create$1(NULL);
|
|
6071
|
-
var names = keys(descriptorMap);
|
|
6072
|
-
for (var length = names.length, index = 0; index < length; ++index) {
|
|
6073
|
-
var name = names[index];
|
|
6074
|
-
created[name] = Descriptor(descriptorMap[name]);
|
|
6075
|
-
}
|
|
6076
|
-
if (getOwnPropertySymbols) {
|
|
6077
|
-
var symbols = getOwnPropertySymbols(descriptorMap);
|
|
6078
|
-
for (length = symbols.length, index = 0; index < length; ++index) {
|
|
6079
|
-
var symbol = symbols[index];
|
|
6080
|
-
if (isEnum(descriptorMap, symbol)) {
|
|
6081
|
-
created[symbol] = Descriptor(descriptorMap[symbol]);
|
|
6082
|
-
}
|
|
6083
|
-
}
|
|
6084
|
-
}
|
|
6085
|
-
return Object_defineProperties(object, created);
|
|
6086
|
-
}, "defineProperties")
|
|
6087
|
-
);
|
|
6088
|
-
var fpc = /* @__PURE__ */ __name((c) => {
|
|
6089
|
-
freeze(freeze(c).prototype);
|
|
6090
|
-
return c;
|
|
6091
|
-
}, "fpc");
|
|
6092
|
-
var _29_ = /(?:0[1-9]|1\d|2\d)/;
|
|
6093
|
-
var _30_ = /(?:0[1-9]|[12]\d|30)/;
|
|
6094
|
-
var _31_ = /(?:0[1-9]|[12]\d|3[01])/;
|
|
6095
|
-
var _23_ = /(?:[01]\d|2[0-3])/;
|
|
6096
|
-
var _59_ = /[0-5]\d/;
|
|
6097
|
-
var YMD = /* @__PURE__ */ newRegExp`
|
|
6098
|
-
\d\d\d\d-
|
|
6099
|
-
(?:
|
|
6100
|
-
0
|
|
6101
|
-
(?:
|
|
6102
|
-
[13578]-${_31_}
|
|
6103
|
-
|
|
|
6104
|
-
[469]-${_30_}
|
|
6105
|
-
|
|
|
6106
|
-
2-${_29_}
|
|
6107
|
-
)
|
|
6108
|
-
|
|
|
6109
|
-
1
|
|
6110
|
-
(?:
|
|
6111
|
-
[02]-${_31_}
|
|
6112
|
-
|
|
|
6113
|
-
1-${_30_}
|
|
6114
|
-
)
|
|
6115
|
-
)
|
|
6116
|
-
`.valueOf();
|
|
6117
|
-
var HMS = /* @__PURE__ */ newRegExp`
|
|
6118
|
-
${_23_}:${_59_}:${_59_}
|
|
6119
|
-
`.valueOf();
|
|
6120
|
-
var OFFSET$ = /(?:[Zz]|[+-]\d\d:\d\d)$/;
|
|
6121
|
-
var { exec: Z_exec } = theRegExp(/(([+-])\d\d):(\d\d)$/);
|
|
6122
|
-
var { exec: OFFSET_DATETIME_exec } = /* @__PURE__ */ newRegExp`
|
|
6123
|
-
^
|
|
6124
|
-
${YMD}
|
|
6125
|
-
[Tt ]
|
|
6126
|
-
${HMS}
|
|
6127
|
-
(?:\.\d{1,3}(\d*?)0*)?
|
|
6128
|
-
(?:[Zz]|[+-]${_23_}:${_59_})
|
|
6129
|
-
$`.valueOf();
|
|
6130
|
-
var { exec: OFFSET_DATETIME_ZERO_exec } = /* @__PURE__ */ newRegExp`
|
|
6131
|
-
^
|
|
6132
|
-
${YMD}
|
|
6133
|
-
[Tt ]
|
|
6134
|
-
${HMS}
|
|
6135
|
-
()
|
|
6136
|
-
[Zz]
|
|
6137
|
-
$`.valueOf();
|
|
6138
|
-
var { test: IS_LOCAL_DATETIME } = /* @__PURE__ */ newRegExp`
|
|
6139
|
-
^
|
|
6140
|
-
${YMD}
|
|
6141
|
-
[Tt ]
|
|
6142
|
-
${HMS}
|
|
6143
|
-
(?:\.\d+)?
|
|
6144
|
-
$`.valueOf();
|
|
6145
|
-
var { test: IS_LOCAL_DATE } = /* @__PURE__ */ newRegExp`
|
|
6146
|
-
^
|
|
6147
|
-
${YMD}
|
|
6148
|
-
$`.valueOf();
|
|
6149
|
-
var { test: IS_LOCAL_TIME } = /* @__PURE__ */ newRegExp`
|
|
6150
|
-
^
|
|
6151
|
-
${HMS}
|
|
6152
|
-
(?:\.\d+)?
|
|
6153
|
-
$`.valueOf();
|
|
6154
|
-
var T = /[ t]/;
|
|
6155
|
-
var DELIMITER_DOT = /[-T:.]/g;
|
|
6156
|
-
var DOT_ZERO = /\.?0+$/;
|
|
6157
|
-
var ZERO = /\.(\d*?)0+$/;
|
|
6158
|
-
var zeroReplacer = /* @__PURE__ */ __name((match, p1) => p1, "zeroReplacer");
|
|
6159
|
-
var Datetime = /* @__PURE__ */ (() => {
|
|
6160
|
-
const Datetime2 = /* @__PURE__ */ __name(function() {
|
|
6161
|
-
return this;
|
|
6162
|
-
}, "Datetime");
|
|
6163
|
-
const descriptors = Null$1(null);
|
|
6164
|
-
{
|
|
6165
|
-
const descriptor = Null$1(null);
|
|
6166
|
-
for (const key of ownKeys(NativeDate.prototype)) {
|
|
6167
|
-
key === "constructor" || key === "toJSON" || (descriptors[key] = descriptor);
|
|
6168
|
-
}
|
|
6169
|
-
}
|
|
6170
|
-
Datetime2.prototype = preventExtensions(create$1(NativeDate.prototype, descriptors));
|
|
6171
|
-
return freeze(Datetime2);
|
|
6172
|
-
})();
|
|
6173
|
-
var Value = /* @__PURE__ */ __name((ISOString) => ISOString.replace(ZERO, zeroReplacer).replace(DELIMITER_DOT, ""), "Value");
|
|
6174
|
-
var d = /./gs;
|
|
6175
|
-
var d2u = /* @__PURE__ */ __name((d2) => "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009"[d2], "d2u");
|
|
6176
|
-
var ValueOFFSET = /* @__PURE__ */ __name((time, more) => time < 0 ? ("" + (time + 6216730554e4)).replace(d, d2u).padStart(14, "\u2000") + more.replace(d, d2u) + time : more ? (time + ".").padStart(16, "0") + more : ("" + time).padStart(15, "0"), "ValueOFFSET");
|
|
6177
|
-
var validateLeap = /* @__PURE__ */ __name((literal) => {
|
|
6178
|
-
if (literal.startsWith("02-29", 5)) {
|
|
6179
|
-
const year = +literal.slice(0, 4);
|
|
6180
|
-
return year & 3 ? false : year % 100 ? true : year % 400 ? false : year % 3200 ? true : false;
|
|
6181
|
-
}
|
|
6182
|
-
return true;
|
|
6183
|
-
}, "validateLeap");
|
|
6184
|
-
var { test: VALIDATE_LEAP } = /* @__PURE__ */ newRegExp.s`^.....(?:06.30|12.31).23:59:59`.valueOf();
|
|
6185
|
-
var DATE$1 = /* @__PURE__ */ defineProperties(new NativeDate(0), /* @__PURE__ */ getOwnPropertyDescriptors(NativeDate.prototype));
|
|
6186
|
-
var OffsetDateTime_ISOString = Symbol$1("OffsetDateTime_ISOString");
|
|
6187
|
-
var OffsetDateTime_value = Symbol$1("OffsetDateTime_value");
|
|
6188
|
-
var OffsetDateTime_use = /* @__PURE__ */ __name((that, $ = 0) => {
|
|
6189
|
-
DATE$1.setTime(+that[OffsetDateTime_value] + $);
|
|
6190
|
-
return DATE$1;
|
|
6191
|
-
}, "OffsetDateTime_use");
|
|
6192
|
-
var OffsetDateTime = /* @__PURE__ */ fpc(class OffsetDateTime2 extends Datetime {
|
|
6193
|
-
static {
|
|
6194
|
-
__name(this, "OffsetDateTime");
|
|
6195
|
-
}
|
|
6196
|
-
[OffsetDateTime_ISOString];
|
|
6197
|
-
[OffsetDateTime_value];
|
|
6198
|
-
get [Symbol$1.toStringTag]() {
|
|
6199
|
-
return "OffsetDateTime";
|
|
6200
|
-
}
|
|
6201
|
-
valueOf() {
|
|
6202
|
-
return this[OffsetDateTime_value];
|
|
6203
|
-
}
|
|
6204
|
-
toISOString() {
|
|
6205
|
-
return this[OffsetDateTime_ISOString];
|
|
6206
|
-
}
|
|
6207
|
-
constructor(literal) {
|
|
6208
|
-
validateLeap(literal) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal}` + where(" at ")));
|
|
6209
|
-
const with60 = literal.startsWith("60", 17);
|
|
6210
|
-
let without60 = with60 ? literal.slice(0, 17) + "59" + literal.slice(19) : literal;
|
|
6211
|
-
const { 1: more = "" } = (zeroDatetime ? OFFSET_DATETIME_ZERO_exec(without60) : OFFSET_DATETIME_exec(without60)) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal}` + where(" at ")));
|
|
6212
|
-
const time = parse$2(without60 = without60.replace(T, "T").replace("z", "Z"));
|
|
6213
|
-
if (with60) {
|
|
6214
|
-
DATE$1.setTime(time);
|
|
6215
|
-
VALIDATE_LEAP(DATE$1.toISOString()) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal}` + where(" at ")));
|
|
6216
|
-
}
|
|
6217
|
-
super();
|
|
6218
|
-
this[OffsetDateTime_ISOString] = without60;
|
|
6219
|
-
this[OffsetDateTime_value] = ValueOFFSET(time, more);
|
|
6220
|
-
return this;
|
|
6221
|
-
}
|
|
6222
|
-
getUTCFullYear() {
|
|
6223
|
-
return OffsetDateTime_use(this).getUTCFullYear();
|
|
6224
|
-
}
|
|
6225
|
-
///get year () :FullYear { return OffsetDateTime_get(this, 0, 4); }
|
|
6226
|
-
///set year (value :FullYear) { OffsetDateTime_set(this, 0, 4, value, true); }
|
|
6227
|
-
getUTCMonth() {
|
|
6228
|
-
return OffsetDateTime_use(this).getUTCMonth();
|
|
6229
|
-
}
|
|
6230
|
-
///get month () { return OffsetDateTime_get(this, 5, 7); }
|
|
6231
|
-
///set month (value) { OffsetDateTime_set(this, 5, 7, value, true); }
|
|
6232
|
-
getUTCDate() {
|
|
6233
|
-
return OffsetDateTime_use(this).getUTCDate();
|
|
6234
|
-
}
|
|
6235
|
-
///get day () :Date { return OffsetDateTime_get(this, 8, 10); }
|
|
6236
|
-
///set day (value :Date) { OffsetDateTime_set(this, 8, 10, value, true); }
|
|
6237
|
-
getUTCHours() {
|
|
6238
|
-
return OffsetDateTime_use(this).getUTCHours();
|
|
6239
|
-
}
|
|
6240
|
-
///get hour () :Hours { return OffsetDateTime_get(this, 11, 13); }
|
|
6241
|
-
///set hour (value :Hours) { OffsetDateTime_set(this, 11, 13, value, true); }
|
|
6242
|
-
getUTCMinutes() {
|
|
6243
|
-
return OffsetDateTime_use(this).getUTCMinutes();
|
|
6244
|
-
}
|
|
6245
|
-
///get minute () :Minutes { return OffsetDateTime_get(this, 14, 16); }
|
|
6246
|
-
///set minute (value :Minutes) { OffsetDateTime_set(this, 14, 16, value, true); }
|
|
6247
|
-
getUTCSeconds() {
|
|
6248
|
-
return OffsetDateTime_use(this).getUTCSeconds();
|
|
6249
|
-
}
|
|
6250
|
-
///get second () :Seconds { return OffsetDateTime_get(this, 17, 19); }
|
|
6251
|
-
///set second (value :Seconds) { OffsetDateTime_set(this, 17, 19, value, true); }
|
|
6252
|
-
getUTCMilliseconds() {
|
|
6253
|
-
return OffsetDateTime_use(this).getUTCMilliseconds();
|
|
6254
|
-
}
|
|
6255
|
-
///
|
|
6256
|
-
///get millisecond () :Milliseconds { return this[OffsetDateTime_value]%1000; }///
|
|
6257
|
-
/*set millisecond (value :Milliseconds) {
|
|
6258
|
-
this[OffsetDateTime_ISOString] = this[OffsetDateTime_ISOString].slice(0, 19) + ( value ? ( '.' + ( '' + value ).padStart(3, '0') ).replace(DOT_ZERO, '') : '' ) + this[OffsetDateTime_ISOString].slice(this[OffsetDateTime_ISOString].search(OFFSET$));
|
|
6259
|
-
OffsetDateTime_set(this, 0, 0, 0, false);
|
|
6260
|
-
}*/
|
|
6261
|
-
//
|
|
6262
|
-
///get microsecond () :Milliseconds
|
|
6263
|
-
///set microsecond (value :Milliseconds)
|
|
6264
|
-
///get nanosecond () :Milliseconds
|
|
6265
|
-
///set nanosecond (value :Milliseconds)
|
|
6266
|
-
getUTCDay() {
|
|
6267
|
-
return OffsetDateTime_use(this).getUTCDay();
|
|
6268
|
-
}
|
|
6269
|
-
///get dayOfWeek () { return OffsetDateTime_use(this, this.getTimezoneOffset()*60000).getUTCDay() || 7; }
|
|
6270
|
-
getTimezoneOffset() {
|
|
6271
|
-
const z2 = Z_exec(this[OffsetDateTime_ISOString]);
|
|
6272
|
-
return z2 ? +z2[1] * 60 + +(z2[2] + z2[3]) : 0;
|
|
6273
|
-
}
|
|
6274
|
-
///get offset () { return this[OffsetDateTime_ISOString].endsWith('Z') ? 'Z' : this[OffsetDateTime_ISOString].slice(-6); }
|
|
6275
|
-
/*set offset (value) {
|
|
6276
|
-
this[OffsetDateTime_ISOString] = this[OffsetDateTime_ISOString].slice(0, this[OffsetDateTime_ISOString].endsWith('Z') ? -1 : -6) + value;
|
|
6277
|
-
OffsetDateTime_set(this, 0, 0, 0, true);
|
|
6278
|
-
}*/
|
|
6279
|
-
//
|
|
6280
|
-
getTime() {
|
|
6281
|
-
return floor(+this[OffsetDateTime_value]);
|
|
6282
|
-
}
|
|
6283
|
-
///
|
|
6284
|
-
/*setTime (this :OffsetDateTime, value :Time) :void {
|
|
6285
|
-
value = DATE.setTime(value);
|
|
6286
|
-
const z = Z_exec(this[OffsetDateTime_ISOString]);
|
|
6287
|
-
DATE.setTime(value + ( z ? +z[1]*60 + +( z[2] + z[3] ) : 0 )*60000);
|
|
6288
|
-
this[OffsetDateTime_ISOString] = z ? DATE.toISOString().slice(0, -1) + z[0] : DATE.toISOString();
|
|
6289
|
-
this[OffsetDateTime_value] = ValueOFFSET(value, '');
|
|
6290
|
-
///return value;
|
|
6291
|
-
}*/
|
|
6292
|
-
});
|
|
6293
|
-
var LocalDateTime_ISOString = Symbol$1("LocalDateTime_ISOString");
|
|
6294
|
-
var LocalDateTime_value = Symbol$1("LocalDateTime_value");
|
|
6295
|
-
var LocalDateTime_get = /* @__PURE__ */ __name((that, start, end) => +that[LocalDateTime_ISOString].slice(start, end), "LocalDateTime_get");
|
|
6296
|
-
var LocalDateTime_set = /* @__PURE__ */ __name((that, start, end, value) => {
|
|
6297
|
-
const string = "" + value;
|
|
6298
|
-
const size = end - start;
|
|
6299
|
-
if (string.length > size) {
|
|
6300
|
-
throw RangeError$1();
|
|
6301
|
-
}
|
|
6302
|
-
that[LocalDateTime_value] = Value(
|
|
6303
|
-
that[LocalDateTime_ISOString] = that[LocalDateTime_ISOString].slice(0, start) + string.padStart(size, "0") + that[LocalDateTime_ISOString].slice(end)
|
|
6304
|
-
);
|
|
6305
|
-
}, "LocalDateTime_set");
|
|
6306
|
-
var LocalDateTime = /* @__PURE__ */ fpc(class LocalDateTime2 extends Datetime {
|
|
6307
|
-
static {
|
|
6308
|
-
__name(this, "LocalDateTime");
|
|
6309
|
-
}
|
|
6310
|
-
[LocalDateTime_ISOString];
|
|
6311
|
-
[LocalDateTime_value];
|
|
6312
|
-
get [Symbol$1.toStringTag]() {
|
|
6313
|
-
return "LocalDateTime";
|
|
6314
|
-
}
|
|
6315
|
-
valueOf() {
|
|
6316
|
-
return this[LocalDateTime_value];
|
|
6317
|
-
}
|
|
6318
|
-
toISOString() {
|
|
6319
|
-
return this[LocalDateTime_ISOString];
|
|
6320
|
-
}
|
|
6321
|
-
constructor(literal) {
|
|
6322
|
-
IS_LOCAL_DATETIME(literal) && validateLeap(literal) || throws(SyntaxError$1(`Invalid Local Date-Time ${literal}` + where(" at ")));
|
|
6323
|
-
super();
|
|
6324
|
-
this[LocalDateTime_value] = Value(
|
|
6325
|
-
this[LocalDateTime_ISOString] = literal.replace(T, "T")
|
|
6326
|
-
);
|
|
6327
|
-
return this;
|
|
6328
|
-
}
|
|
6329
|
-
getFullYear() {
|
|
6330
|
-
return LocalDateTime_get(this, 0, 4);
|
|
6331
|
-
}
|
|
6332
|
-
setFullYear(value) {
|
|
6333
|
-
LocalDateTime_set(this, 0, 4, value);
|
|
6334
|
-
}
|
|
6335
|
-
getMonth() {
|
|
6336
|
-
return LocalDateTime_get(this, 5, 7) - 1;
|
|
6337
|
-
}
|
|
6338
|
-
setMonth(value) {
|
|
6339
|
-
LocalDateTime_set(this, 5, 7, value + 1);
|
|
6340
|
-
}
|
|
6341
|
-
getDate() {
|
|
6342
|
-
return LocalDateTime_get(this, 8, 10);
|
|
6343
|
-
}
|
|
6344
|
-
setDate(value) {
|
|
6345
|
-
LocalDateTime_set(this, 8, 10, value);
|
|
6346
|
-
}
|
|
6347
|
-
getHours() {
|
|
6348
|
-
return LocalDateTime_get(this, 11, 13);
|
|
6349
|
-
}
|
|
6350
|
-
setHours(value) {
|
|
6351
|
-
LocalDateTime_set(this, 11, 13, value);
|
|
6352
|
-
}
|
|
6353
|
-
getMinutes() {
|
|
6354
|
-
return LocalDateTime_get(this, 14, 16);
|
|
6355
|
-
}
|
|
6356
|
-
setMinutes(value) {
|
|
6357
|
-
LocalDateTime_set(this, 14, 16, value);
|
|
6358
|
-
}
|
|
6359
|
-
getSeconds() {
|
|
6360
|
-
return LocalDateTime_get(this, 17, 19);
|
|
6361
|
-
}
|
|
6362
|
-
setSeconds(value) {
|
|
6363
|
-
LocalDateTime_set(this, 17, 19, value);
|
|
6364
|
-
}
|
|
6365
|
-
getMilliseconds() {
|
|
6366
|
-
return +this[LocalDateTime_value].slice(14, 17).padEnd(3, "0");
|
|
6367
|
-
}
|
|
6368
|
-
///
|
|
6369
|
-
setMilliseconds(value) {
|
|
6370
|
-
this[LocalDateTime_value] = Value(
|
|
6371
|
-
this[LocalDateTime_ISOString] = this[LocalDateTime_ISOString].slice(0, 19) + (value ? ("." + ("" + value).padStart(3, "0")).replace(DOT_ZERO, "") : "")
|
|
6372
|
-
);
|
|
6373
|
-
}
|
|
6374
|
-
});
|
|
6375
|
-
var LocalDate_ISOString = Symbol$1("LocalDate_ISOString");
|
|
6376
|
-
var LocalDate_value = Symbol$1("LocalDate_value");
|
|
6377
|
-
var LocalDate_get = /* @__PURE__ */ __name((that, start, end) => +that[LocalDate_ISOString].slice(start, end), "LocalDate_get");
|
|
6378
|
-
var LocalDate_set = /* @__PURE__ */ __name((that, start, end, value) => {
|
|
6379
|
-
const string = "" + value;
|
|
6380
|
-
const size = end - start;
|
|
6381
|
-
if (string.length > size) {
|
|
6382
|
-
throw RangeError$1();
|
|
6383
|
-
}
|
|
6384
|
-
that[LocalDate_value] = Value(
|
|
6385
|
-
that[LocalDate_ISOString] = that[LocalDate_ISOString].slice(0, start) + string.padStart(size, "0") + that[LocalDate_ISOString].slice(end)
|
|
6386
|
-
);
|
|
6387
|
-
}, "LocalDate_set");
|
|
6388
|
-
var LocalDate = /* @__PURE__ */ fpc(class LocalDate2 extends Datetime {
|
|
6389
|
-
static {
|
|
6390
|
-
__name(this, "LocalDate");
|
|
6391
|
-
}
|
|
6392
|
-
[LocalDate_ISOString];
|
|
6393
|
-
[LocalDate_value];
|
|
6394
|
-
get [Symbol$1.toStringTag]() {
|
|
6395
|
-
return "LocalDate";
|
|
6396
|
-
}
|
|
6397
|
-
valueOf() {
|
|
6398
|
-
return this[LocalDate_value];
|
|
6399
|
-
}
|
|
6400
|
-
toISOString() {
|
|
6401
|
-
return this[LocalDate_ISOString];
|
|
6402
|
-
}
|
|
6403
|
-
constructor(literal) {
|
|
6404
|
-
IS_LOCAL_DATE(literal) && validateLeap(literal) || throws(SyntaxError$1(`Invalid Local Date ${literal}` + where(" at ")));
|
|
6405
|
-
super();
|
|
6406
|
-
this[LocalDate_value] = Value(
|
|
6407
|
-
this[LocalDate_ISOString] = literal
|
|
6408
|
-
);
|
|
6409
|
-
return this;
|
|
6410
|
-
}
|
|
6411
|
-
getFullYear() {
|
|
6412
|
-
return LocalDate_get(this, 0, 4);
|
|
6413
|
-
}
|
|
6414
|
-
setFullYear(value) {
|
|
6415
|
-
LocalDate_set(this, 0, 4, value);
|
|
6416
|
-
}
|
|
6417
|
-
getMonth() {
|
|
6418
|
-
return LocalDate_get(this, 5, 7) - 1;
|
|
6419
|
-
}
|
|
6420
|
-
setMonth(value) {
|
|
6421
|
-
LocalDate_set(this, 5, 7, value + 1);
|
|
6422
|
-
}
|
|
6423
|
-
getDate() {
|
|
6424
|
-
return LocalDate_get(this, 8, 10);
|
|
6425
|
-
}
|
|
6426
|
-
setDate(value) {
|
|
6427
|
-
LocalDate_set(this, 8, 10, value);
|
|
6428
|
-
}
|
|
6429
|
-
});
|
|
6430
|
-
var LocalTime_ISOString = Symbol$1("LocalTime_ISOString");
|
|
6431
|
-
var LocalTime_value = Symbol$1("LocalTime_value");
|
|
6432
|
-
var LocalTime_get = /* @__PURE__ */ __name((that, start, end) => +that[LocalTime_ISOString].slice(start, end), "LocalTime_get");
|
|
6433
|
-
var LocalTime_set = /* @__PURE__ */ __name((that, start, end, value) => {
|
|
6434
|
-
const string = "" + value;
|
|
6435
|
-
const size = end - start;
|
|
6436
|
-
if (string.length > size) {
|
|
6437
|
-
throw RangeError$1();
|
|
6438
|
-
}
|
|
6439
|
-
that[LocalTime_value] = Value(
|
|
6440
|
-
that[LocalTime_ISOString] = that[LocalTime_ISOString].slice(0, start) + string.padStart(2, "0") + that[LocalTime_ISOString].slice(end)
|
|
6441
|
-
);
|
|
6442
|
-
}, "LocalTime_set");
|
|
6443
|
-
var LocalTime = /* @__PURE__ */ fpc(class LocalTime2 extends Datetime {
|
|
6444
|
-
static {
|
|
6445
|
-
__name(this, "LocalTime");
|
|
6446
|
-
}
|
|
6447
|
-
[LocalTime_ISOString];
|
|
6448
|
-
[LocalTime_value];
|
|
6449
|
-
get [Symbol$1.toStringTag]() {
|
|
6450
|
-
return "LocalTime";
|
|
6451
|
-
}
|
|
6452
|
-
valueOf() {
|
|
6453
|
-
return this[LocalTime_value];
|
|
6454
|
-
}
|
|
6455
|
-
toISOString() {
|
|
6456
|
-
return this[LocalTime_ISOString];
|
|
6457
|
-
}
|
|
6458
|
-
constructor(literal) {
|
|
6459
|
-
IS_LOCAL_TIME(literal) || throws(SyntaxError$1(`Invalid Local Time ${literal}` + where(" at ")));
|
|
6460
|
-
super();
|
|
6461
|
-
this[LocalTime_value] = Value(
|
|
6462
|
-
this[LocalTime_ISOString] = literal
|
|
6463
|
-
);
|
|
6464
|
-
return this;
|
|
6465
|
-
}
|
|
6466
|
-
getHours() {
|
|
6467
|
-
return LocalTime_get(this, 0, 2);
|
|
6468
|
-
}
|
|
6469
|
-
setHours(value) {
|
|
6470
|
-
LocalTime_set(this, 0, 2, value);
|
|
6471
|
-
}
|
|
6472
|
-
getMinutes() {
|
|
6473
|
-
return LocalTime_get(this, 3, 5);
|
|
6474
|
-
}
|
|
6475
|
-
setMinutes(value) {
|
|
6476
|
-
LocalTime_set(this, 3, 5, value);
|
|
6477
|
-
}
|
|
6478
|
-
getSeconds() {
|
|
6479
|
-
return LocalTime_get(this, 6, 8);
|
|
6480
|
-
}
|
|
6481
|
-
setSeconds(value) {
|
|
6482
|
-
LocalTime_set(this, 6, 8, value);
|
|
6483
|
-
}
|
|
6484
|
-
getMilliseconds() {
|
|
6485
|
-
return +this[LocalTime_value].slice(6, 9).padEnd(3, "0");
|
|
6486
|
-
}
|
|
6487
|
-
///
|
|
6488
|
-
setMilliseconds(value) {
|
|
6489
|
-
this[LocalTime_value] = Value(
|
|
6490
|
-
this[LocalTime_ISOString] = this[LocalTime_ISOString].slice(0, 8) + (value ? ("." + ("" + value).padStart(3, "0")).replace(DOT_ZERO, "") : "")
|
|
6491
|
-
);
|
|
6492
|
-
}
|
|
6493
|
-
});
|
|
6494
|
-
var fromCodePoint = String.fromCodePoint;
|
|
6495
|
-
var INTEGER_D = /[-+]?(?:0|[1-9][_\d]*)/;
|
|
6496
|
-
var { test: BAD_D } = /* @__PURE__ */ newRegExp`_(?!\d)`.valueOf();
|
|
6497
|
-
var { test: IS_D_INTEGER } = /* @__PURE__ */ newRegExp`^${INTEGER_D}$`.valueOf();
|
|
6498
|
-
var { test: IS_XOB_INTEGER } = theRegExp(/^0(?:x[\dA-Fa-f][_\dA-Fa-f]*|o[0-7][_0-7]*|b[01][_01]*)$/);
|
|
6499
|
-
var { test: BAD_XOB } = /* @__PURE__ */ newRegExp`_(?![\dA-Fa-f])`.valueOf();
|
|
6500
|
-
var MIN = BigInt$1 && -/* @__PURE__ */ BigInt$1("0x8000000000000000");
|
|
6501
|
-
var NaN$1 = 0 / 0;
|
|
6502
|
-
var _NaN = -NaN$1;
|
|
6503
|
-
var _Infinity$1 = -Infinity2;
|
|
6504
|
-
var { test: IS_FLOAT } = /* @__PURE__ */ newRegExp`
|
|
6505
|
-
^
|
|
6506
|
-
${INTEGER_D}
|
|
6507
|
-
(?:
|
|
6508
|
-
\.\d[_\d]*
|
|
6509
|
-
(?:[eE][-+]?\d[_\d]*)?
|
|
6510
|
-
|
|
|
6511
|
-
[eE][-+]?\d[_\d]*
|
|
6512
|
-
)
|
|
6513
|
-
$`.valueOf();
|
|
6514
|
-
var { test: IS_ZERO } = theRegExp(/^[-+]?0(?:\.0+)?(?:[eE][-+]?0+)?$/);
|
|
6515
|
-
var { exec: NORMALIZED } = theRegExp(/^[-0]?(\d*)(?:\.(\d+))?(?:e\+?(-?\d+))?$/);
|
|
6516
|
-
var { exec: ORIGINAL } = theRegExp(/^[-+]?0?(\d*)(?:\.(\d*?)0*)?(?:[eE]\+?(-?\d+))?$/);
|
|
6517
|
-
var KEYS = /* @__PURE__ */ Null$1(null);
|
|
6518
|
-
var commentForThis = Symbol$1("this");
|
|
6519
|
-
var { test: includesNewline } = theRegExp(/\r?\n/g);
|
|
6520
|
-
var getCOMMENT = /* @__PURE__ */ __name((table, keyComment) => {
|
|
6521
|
-
if (keyComment in table) {
|
|
6522
|
-
const comment = table[keyComment];
|
|
6523
|
-
if (typeof comment !== "string") {
|
|
6524
|
-
throw TypeError$1(`the value of comment must be a string, while "${comment === null ? "null" : typeof comment}" type is found`);
|
|
6525
|
-
}
|
|
6526
|
-
if (includesNewline(comment)) {
|
|
6527
|
-
throw SyntaxError$1(`the value of comment must be a string and can not include newline`);
|
|
6528
|
-
}
|
|
6529
|
-
return ` #${comment}`;
|
|
6530
|
-
}
|
|
6531
|
-
return "";
|
|
6532
|
-
}, "getCOMMENT");
|
|
6533
|
-
var getComment = /* @__PURE__ */ __name((table, key) => key in KEYS ? getCOMMENT(table, KEYS[key]) : "", "getComment");
|
|
6534
|
-
var { test: IS_OFFSET$ } = theRegExp(OFFSET$);
|
|
6535
|
-
var { test: IS_EMPTY } = theRegExp(/^\[[\t ]*]/);
|
|
6536
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
|
|
6537
|
-
var DATE = Date.prototype;
|
|
6538
|
-
var valueOf$2 = String.prototype.valueOf;
|
|
6539
|
-
var isString = (
|
|
6540
|
-
/* j-globals: class.isString (internal) */
|
|
6541
|
-
/* @__PURE__ */ function() {
|
|
6542
|
-
if (apply.bind) {
|
|
6543
|
-
var valueOf_apply = apply.bind(valueOf$2);
|
|
6544
|
-
return /* @__PURE__ */ __name(function isString4(value) {
|
|
6545
|
-
try {
|
|
6546
|
-
valueOf_apply(value);
|
|
6547
|
-
} catch (error) {
|
|
6548
|
-
return false;
|
|
6549
|
-
}
|
|
6550
|
-
return true;
|
|
6551
|
-
}, "isString");
|
|
6552
|
-
}
|
|
6553
|
-
return /* @__PURE__ */ __name(function isString4(value) {
|
|
6554
|
-
try {
|
|
6555
|
-
valueOf$2.apply(value);
|
|
6556
|
-
} catch (error) {
|
|
6557
|
-
return false;
|
|
6558
|
-
}
|
|
6559
|
-
return true;
|
|
6560
|
-
}, "isString");
|
|
6561
|
-
}()
|
|
6562
|
-
);
|
|
6563
|
-
var valueOf$1 = Number.prototype.valueOf;
|
|
6564
|
-
var isNumber = (
|
|
6565
|
-
/* j-globals: class.isNumber (internal) */
|
|
6566
|
-
/* @__PURE__ */ function() {
|
|
6567
|
-
if (apply.bind) {
|
|
6568
|
-
var valueOf_apply = apply.bind(valueOf$1);
|
|
6569
|
-
return /* @__PURE__ */ __name(function isNumber4(value) {
|
|
6570
|
-
try {
|
|
6571
|
-
valueOf_apply(value);
|
|
6572
|
-
} catch (error) {
|
|
6573
|
-
return false;
|
|
6574
|
-
}
|
|
6575
|
-
return true;
|
|
6576
|
-
}, "isNumber");
|
|
6577
|
-
}
|
|
6578
|
-
return /* @__PURE__ */ __name(function isNumber4(value) {
|
|
6579
|
-
try {
|
|
6580
|
-
valueOf$1.apply(value);
|
|
6581
|
-
} catch (error) {
|
|
6582
|
-
return false;
|
|
6583
|
-
}
|
|
6584
|
-
return true;
|
|
6585
|
-
}, "isNumber");
|
|
6586
|
-
}()
|
|
6587
|
-
);
|
|
6588
|
-
var isBigInt = (
|
|
6589
|
-
/* j-globals: class.isBigInt (internal) */
|
|
6590
|
-
/* @__PURE__ */ function() {
|
|
6591
|
-
if (typeof BigInt === "function") {
|
|
6592
|
-
var valueOf_apply = apply.bind(BigInt.prototype.valueOf);
|
|
6593
|
-
return /* @__PURE__ */ __name(function isBigInt2(value) {
|
|
6594
|
-
try {
|
|
6595
|
-
valueOf_apply(value);
|
|
6596
|
-
} catch (error) {
|
|
6597
|
-
return false;
|
|
6598
|
-
}
|
|
6599
|
-
return true;
|
|
6600
|
-
}, "isBigInt");
|
|
6601
|
-
}
|
|
6602
|
-
return /* @__PURE__ */ __name(function isBigInt2() {
|
|
6603
|
-
return false;
|
|
6604
|
-
}, "isBigInt");
|
|
6605
|
-
}()
|
|
6606
|
-
);
|
|
6607
|
-
var valueOf = BigInt.prototype.valueOf;
|
|
6608
|
-
var isBoolean = (
|
|
6609
|
-
/* j-globals: class.isBoolean (internal) */
|
|
6610
|
-
/* @__PURE__ */ function() {
|
|
6611
|
-
if (apply.bind) {
|
|
6612
|
-
var valueOf_apply = apply.bind(valueOf);
|
|
6613
|
-
return /* @__PURE__ */ __name(function isBoolean3(value) {
|
|
6614
|
-
try {
|
|
6615
|
-
valueOf_apply(value);
|
|
6616
|
-
} catch (error) {
|
|
6617
|
-
return false;
|
|
6618
|
-
}
|
|
6619
|
-
return true;
|
|
6620
|
-
}, "isBoolean");
|
|
6621
|
-
}
|
|
6622
|
-
return /* @__PURE__ */ __name(function isBoolean3(value) {
|
|
6623
|
-
try {
|
|
6624
|
-
valueOf.apply(value);
|
|
6625
|
-
} catch (error) {
|
|
6626
|
-
return false;
|
|
6627
|
-
}
|
|
6628
|
-
return true;
|
|
6629
|
-
}, "isBoolean");
|
|
6630
|
-
}()
|
|
6631
|
-
);
|
|
6632
|
-
var ESCAPED = /* @__PURE__ */ Null$1({
|
|
6633
|
-
.../* @__PURE__ */ fromEntries(/* @__PURE__ */ [...Array$1(32)].map((_, charCode) => [fromCharCode(charCode), "\\u" + charCode.toString(16).toUpperCase().padStart(4, "0")])),
|
|
6634
|
-
"\b": "\\b",
|
|
6635
|
-
" ": "\\t",
|
|
6636
|
-
"\n": "\\n",
|
|
6637
|
-
"\f": "\\f",
|
|
6638
|
-
"\r": "\\r",
|
|
6639
|
-
'"': '\\"',
|
|
6640
|
-
'"""': '""\\"',
|
|
6641
|
-
"\\": "\\\\",
|
|
6642
|
-
"\x7F": "\\u007F"
|
|
6643
|
-
});
|
|
6644
|
-
var { test: NEED_BASIC } = theRegExp(/[\x00-\x08\x0A-\x1F'\x7F]/);
|
|
6645
|
-
var BY_ESCAPE = /[^\x00-\x08\x0A-\x1F"\\\x7F]+|./gs;
|
|
6646
|
-
var { test: NEED_ESCAPE } = theRegExp(/^[\x00-\x08\x0A-\x1F"\\\x7F]/);
|
|
6647
|
-
var singlelineString = /* @__PURE__ */ __name((value) => {
|
|
6648
|
-
if (NEED_BASIC(value)) {
|
|
6649
|
-
const parts = value.match(BY_ESCAPE);
|
|
6650
|
-
let index = parts.length;
|
|
6651
|
-
do {
|
|
6652
|
-
if (NEED_ESCAPE(parts[--index])) {
|
|
6653
|
-
parts[index] = ESCAPED[parts[index]];
|
|
6654
|
-
}
|
|
6655
|
-
} while (index);
|
|
6656
|
-
return `"${parts.join("")}"`;
|
|
6657
|
-
}
|
|
6658
|
-
return `'${value}'`;
|
|
6659
|
-
}, "singlelineString");
|
|
6660
|
-
var { test: NEED_MULTILINE_BASIC } = theRegExp(/[\x00-\x08\x0A-\x1F\x7F]|'''/);
|
|
6661
|
-
var { test: multilineNeedBasic } = theRegExp(/[\x00-\x08\x0B-\x1F\x7F]|'''/);
|
|
6662
|
-
var { test: REAL_MULTILINE_ESCAPE } = theRegExp(/[\x00-\x08\x0A-\x1F\\\x7F]|"""/);
|
|
6663
|
-
var { test: NEED_MULTILINE_ESCAPE } = theRegExp(/^(?:[\x00-\x08\x0A-\x1F\\\x7F]|""")/);
|
|
6664
|
-
var Float64Array$1 = Float64Array;
|
|
6665
|
-
var Uint8Array$1 = Uint8Array;
|
|
6666
|
-
var _Infinity = -Infinity2;
|
|
6667
|
-
var { test: INTEGER_LIKE } = theRegExp(/^-?\d+$/);
|
|
6668
|
-
var ensureFloat = /* @__PURE__ */ __name((literal) => INTEGER_LIKE(literal) ? literal + ".0" : literal, "ensureFloat");
|
|
6669
|
-
var float64Array = new Float64Array$1([NaN$1]);
|
|
6670
|
-
var uint8Array = new Uint8Array$1(float64Array.buffer);
|
|
6671
|
-
var NaN_7 = uint8Array[7];
|
|
6672
|
-
var float = NaN_7 === new Uint8Array$1(new Float64Array$1([-NaN$1]).buffer)[7] ? (value) => value ? value === Infinity2 ? "inf" : value === _Infinity ? "-inf" : ensureFloat("" + value) : value === value ? is(value, 0) ? "0.0" : "-0.0" : "nan" : (value) => value ? value === Infinity2 ? "inf" : value === _Infinity ? "-inf" : ensureFloat("" + value) : value === value ? is(value, 0) ? "0.0" : "-0.0" : (float64Array[0] = value, uint8Array[7]) === NaN_7 ? "nan" : "-nan";
|
|
6673
|
-
var isDate = /* @__PURE__ */ isPrototypeOf.bind(DATE);
|
|
6674
|
-
var { test: BARE } = theRegExp(/^[\w-]+$/);
|
|
6675
|
-
var $Key$ = /* @__PURE__ */ __name((key) => BARE(key) ? key : singlelineString(key), "$Key$");
|
|
6676
|
-
var FIRST = /[^.]+/;
|
|
6677
|
-
var literalString = /* @__PURE__ */ __name((value) => `'${value}'`, "literalString");
|
|
6678
|
-
var $Keys = /* @__PURE__ */ __name((keys2) => isAmazing(keys2) ? keys2.replace(FIRST, literalString) : keys2 === "null" ? `'null'` : keys2, "$Keys");
|
|
6679
|
-
var TOMLSection = class extends Array$1 {
|
|
6680
|
-
static {
|
|
6681
|
-
__name(this, "TOMLSection");
|
|
6682
|
-
}
|
|
6683
|
-
document;
|
|
6684
|
-
constructor(document) {
|
|
6685
|
-
super();
|
|
6686
|
-
this.document = document;
|
|
6687
|
-
return this;
|
|
6688
|
-
}
|
|
6689
|
-
[Symbol$1.toPrimitive]() {
|
|
6690
|
-
return this.join(this.document.newline);
|
|
6691
|
-
}
|
|
6692
|
-
appendNewline() {
|
|
6693
|
-
this[this.length] = "";
|
|
6694
|
-
}
|
|
6695
|
-
set appendLine(source) {
|
|
6696
|
-
this[this.length] = source;
|
|
6697
|
-
}
|
|
6698
|
-
set appendInline(source) {
|
|
6699
|
-
this[this.length - 1] += source;
|
|
6700
|
-
}
|
|
6701
|
-
set appendInlineIf(source) {
|
|
6702
|
-
source && (this[this.length - 1] += source);
|
|
6703
|
-
}
|
|
6704
|
-
///
|
|
6705
|
-
*assignBlock(documentKeys_, sectionKeys_, table, tableKeys) {
|
|
6706
|
-
const { document } = this;
|
|
6707
|
-
const { newlineUnderHeader, newlineUnderSectionButPair } = document;
|
|
6708
|
-
const newlineAfterDotted = sectionKeys_ ? document.newlineUnderPairButDotted : false;
|
|
6709
|
-
const newlineAfterPair = sectionKeys_ ? document.newlineUnderDotted : document.newlineUnderPair;
|
|
6710
|
-
for (const tableKey of tableKeys) {
|
|
6711
|
-
const value = table[tableKey];
|
|
6712
|
-
const $key$ = $Key$(tableKey);
|
|
6713
|
-
const documentKeys = documentKeys_ + $key$;
|
|
6714
|
-
if (isArray$1(value)) {
|
|
6715
|
-
const { length } = value;
|
|
6716
|
-
if (length) {
|
|
6717
|
-
let firstItem = value[0];
|
|
6718
|
-
if (isSection(firstItem)) {
|
|
6719
|
-
const tableHeader = `[[${documentKeys}]]`;
|
|
6720
|
-
const documentKeys_2 = documentKeys + ".";
|
|
6721
|
-
let index = 0;
|
|
6722
|
-
let table2 = firstItem;
|
|
6723
|
-
for (; ; ) {
|
|
6724
|
-
const section = document.appendSection();
|
|
6725
|
-
section[0] = tableHeader + getCOMMENT(table2, commentForThis);
|
|
6726
|
-
if (newlineUnderHeader) {
|
|
6727
|
-
section[1] = "";
|
|
6728
|
-
yield section.assignBlock(documentKeys_2, ``, table2, getOwnPropertyNames(table2));
|
|
6729
|
-
newlineUnderSectionButPair && section.length !== 2 && section.appendNewline();
|
|
6730
|
-
} else {
|
|
6731
|
-
yield section.assignBlock(documentKeys_2, ``, table2, getOwnPropertyNames(table2));
|
|
6732
|
-
newlineUnderSectionButPair && section.appendNewline();
|
|
6733
|
-
}
|
|
6734
|
-
if (++index === length) {
|
|
6735
|
-
break;
|
|
6736
|
-
}
|
|
6737
|
-
table2 = value[index];
|
|
6738
|
-
if (!isSection(table2)) {
|
|
6739
|
-
throw TypeError$1(`the first table item marked by Section() means the parent array is an array of tables, which can not include other types or table not marked by Section() any more in the rest items`);
|
|
6740
|
-
}
|
|
6741
|
-
}
|
|
6742
|
-
continue;
|
|
6743
|
-
} else {
|
|
6744
|
-
let index = 1;
|
|
6745
|
-
while (index !== length) {
|
|
6746
|
-
if (isSection(value[index++])) {
|
|
6747
|
-
throw TypeError$1(`if an array is not array of tables, it can not include any table that marked by Section()`);
|
|
6748
|
-
}
|
|
6749
|
-
}
|
|
6750
|
-
}
|
|
6751
|
-
}
|
|
6752
|
-
} else {
|
|
6753
|
-
if (isSection(value)) {
|
|
6754
|
-
const section = document.appendSection();
|
|
6755
|
-
section[0] = `[${documentKeys}]${document.preferCommentForThis ? getCOMMENT(value, commentForThis) || getComment(table, tableKey) : getComment(table, tableKey) || getCOMMENT(value, commentForThis)}`;
|
|
6756
|
-
if (newlineUnderHeader) {
|
|
6757
|
-
section[1] = "";
|
|
6758
|
-
yield section.assignBlock(documentKeys + ".", ``, value, getOwnPropertyNames(value));
|
|
6759
|
-
newlineUnderSectionButPair && section.length !== 2 && section.appendNewline();
|
|
6760
|
-
} else {
|
|
6761
|
-
yield section.assignBlock(documentKeys + ".", ``, value, getOwnPropertyNames(value));
|
|
6762
|
-
newlineUnderSectionButPair && section.appendNewline();
|
|
6763
|
-
}
|
|
6764
|
-
continue;
|
|
6765
|
-
}
|
|
6766
|
-
}
|
|
6767
|
-
const sectionKeys = sectionKeys_ + $key$;
|
|
6768
|
-
this.appendLine = $Keys(sectionKeys) + " = ";
|
|
6769
|
-
const valueKeysIfValueIsDottedTable = this.value("", value, true);
|
|
6770
|
-
if (valueKeysIfValueIsDottedTable) {
|
|
6771
|
-
--this.length;
|
|
6772
|
-
yield this.assignBlock(documentKeys + ".", sectionKeys + ".", value, valueKeysIfValueIsDottedTable);
|
|
6773
|
-
newlineAfterDotted && this.appendNewline();
|
|
6774
|
-
} else {
|
|
6775
|
-
this.appendInlineIf = getComment(table, tableKey);
|
|
6776
|
-
newlineAfterPair && this.appendNewline();
|
|
6777
|
-
}
|
|
6778
|
-
}
|
|
6779
|
-
}
|
|
6780
|
-
value(indent, value, returnValueKeysIfValueIsDottedTable) {
|
|
6781
|
-
switch (typeof value) {
|
|
6782
|
-
case "object":
|
|
6783
|
-
if (value === null) {
|
|
6784
|
-
if (this.document.nullDisabled) {
|
|
6785
|
-
throw TypeError$1(`toml can not stringify "null" type value without truthy options.xNull`);
|
|
6786
|
-
}
|
|
6787
|
-
this.appendInline = "null";
|
|
6788
|
-
break;
|
|
6789
|
-
}
|
|
6790
|
-
const inlineMode = ofInline(value);
|
|
6791
|
-
if (isArray$1(value)) {
|
|
6792
|
-
if (inlineMode === undefined$1) {
|
|
6793
|
-
this.staticArray(indent, value);
|
|
6794
|
-
} else {
|
|
6795
|
-
const { $singlelineArray = inlineMode } = this.document;
|
|
6796
|
-
this.singlelineArray(indent, value, $singlelineArray);
|
|
6797
|
-
}
|
|
6798
|
-
break;
|
|
6799
|
-
}
|
|
6800
|
-
if (inlineMode !== undefined$1) {
|
|
6801
|
-
inlineMode || this.document.multilineTableDisabled ? this.inlineTable(indent, value) : this.multilineTable(indent, value, this.document.multilineTableComma);
|
|
6802
|
-
break;
|
|
6803
|
-
}
|
|
6804
|
-
if (isDate(value)) {
|
|
6805
|
-
this.appendInline = value.toISOString().replace("T", this.document.T).replace("Z", this.document.Z);
|
|
6806
|
-
break;
|
|
6807
|
-
}
|
|
6808
|
-
if (_literal in value) {
|
|
6809
|
-
const literal = value[_literal];
|
|
6810
|
-
if (typeof literal === "string") {
|
|
6811
|
-
this.appendInline = literal;
|
|
6812
|
-
} else if (isArray$1(literal)) {
|
|
6813
|
-
const { length } = literal;
|
|
6814
|
-
if (length) {
|
|
6815
|
-
this.appendInline = literal[0];
|
|
6816
|
-
let index = 1;
|
|
6817
|
-
while (index !== length) {
|
|
6818
|
-
this.appendLine = literal[index++];
|
|
6819
|
-
}
|
|
6820
|
-
} else {
|
|
6821
|
-
throw TypeError$1(`literal value is broken`);
|
|
6822
|
-
}
|
|
6823
|
-
} else {
|
|
6824
|
-
throw TypeError$1(`literal value is broken`);
|
|
6825
|
-
}
|
|
6826
|
-
break;
|
|
6827
|
-
}
|
|
6828
|
-
if (isString(value)) {
|
|
6829
|
-
throw TypeError$1(`TOML.stringify refuse to handle [object String]`);
|
|
6830
|
-
}
|
|
6831
|
-
if (isNumber(value)) {
|
|
6832
|
-
throw TypeError$1(`TOML.stringify refuse to handle [object Number]`);
|
|
6833
|
-
}
|
|
6834
|
-
if (isBigInt(value)) {
|
|
6835
|
-
throw TypeError$1(`TOML.stringify refuse to handle [object BigInt]`);
|
|
6836
|
-
}
|
|
6837
|
-
if (isBoolean(value)) {
|
|
6838
|
-
throw TypeError$1(`TOML.stringify refuse to handle [object Boolean]`);
|
|
6839
|
-
}
|
|
6840
|
-
if (returnValueKeysIfValueIsDottedTable) {
|
|
6841
|
-
const keys2 = getOwnPropertyNames(value);
|
|
6842
|
-
if (keys2.length) {
|
|
6843
|
-
return keys2;
|
|
6844
|
-
}
|
|
6845
|
-
this.appendInline = "{ }";
|
|
6846
|
-
} else {
|
|
6847
|
-
this.inlineTable(indent, value);
|
|
6848
|
-
}
|
|
6849
|
-
break;
|
|
6850
|
-
case "bigint":
|
|
6851
|
-
this.appendInline = "" + value;
|
|
6852
|
-
break;
|
|
6853
|
-
case "number":
|
|
6854
|
-
this.appendInline = this.document.asInteger(value) ? is(value, -0) ? "-0" : "" + value : float(value);
|
|
6855
|
-
break;
|
|
6856
|
-
case "string":
|
|
6857
|
-
this.appendInline = singlelineString(value);
|
|
6858
|
-
break;
|
|
6859
|
-
case "boolean":
|
|
6860
|
-
this.appendInline = value ? "true" : "false";
|
|
6861
|
-
break;
|
|
6862
|
-
default:
|
|
6863
|
-
throw TypeError$1(`toml can not stringify "${typeof value}" type value`);
|
|
6864
|
-
}
|
|
6865
|
-
return null;
|
|
6866
|
-
}
|
|
6867
|
-
singlelineArray(indent, staticArray, inlineMode) {
|
|
6868
|
-
const { length } = staticArray;
|
|
6869
|
-
if (length) {
|
|
6870
|
-
this.appendInline = inlineMode & 2 ? "[ " : "[";
|
|
6871
|
-
this.value(indent, staticArray[0], false);
|
|
6872
|
-
let index = 1;
|
|
6873
|
-
while (index !== length) {
|
|
6874
|
-
this.appendInline = ", ";
|
|
6875
|
-
this.value(indent, staticArray[index++], false);
|
|
6876
|
-
}
|
|
6877
|
-
this.appendInline = inlineMode & 2 ? " ]" : "]";
|
|
6878
|
-
} else {
|
|
6879
|
-
this.appendInline = inlineMode & 1 ? "[ ]" : "[]";
|
|
6880
|
-
}
|
|
6881
|
-
}
|
|
6882
|
-
staticArray(indent, staticArray) {
|
|
6883
|
-
this.appendInline = "[";
|
|
6884
|
-
const indent_ = indent + this.document.indent;
|
|
6885
|
-
const { length } = staticArray;
|
|
6886
|
-
let index = 0;
|
|
6887
|
-
while (index !== length) {
|
|
6888
|
-
this.appendLine = indent_;
|
|
6889
|
-
this.value(indent_, staticArray[index++], false);
|
|
6890
|
-
this.appendInline = ",";
|
|
6891
|
-
}
|
|
6892
|
-
this.appendLine = indent + "]";
|
|
6893
|
-
}
|
|
6894
|
-
inlineTable(indent, inlineTable) {
|
|
6895
|
-
const keys2 = getOwnPropertyNames(inlineTable);
|
|
6896
|
-
if (keys2.length) {
|
|
6897
|
-
this.appendInline = "{ ";
|
|
6898
|
-
this.assignInline(indent, inlineTable, ``, keys2);
|
|
6899
|
-
this[this.length - 1] = this[this.length - 1].slice(0, -2) + " }";
|
|
6900
|
-
} else {
|
|
6901
|
-
this.appendInline = "{ }";
|
|
6902
|
-
}
|
|
6903
|
-
}
|
|
6904
|
-
multilineTable(indent, inlineTable, comma) {
|
|
6905
|
-
this.appendInline = "{";
|
|
6906
|
-
this.assignMultiline(indent, inlineTable, ``, getOwnPropertyNames(inlineTable), comma);
|
|
6907
|
-
this.appendLine = indent + "}";
|
|
6908
|
-
}
|
|
6909
|
-
assignInline(indent, inlineTable, keys_, keys2) {
|
|
6910
|
-
for (const key of keys2) {
|
|
6911
|
-
const value = inlineTable[key];
|
|
6912
|
-
const keys3 = keys_ + $Key$(key);
|
|
6913
|
-
const before_value = this.appendInline = $Keys(keys3) + " = ";
|
|
6914
|
-
const valueKeysIfValueIsDottedTable = this.value(indent, value, true);
|
|
6915
|
-
if (valueKeysIfValueIsDottedTable) {
|
|
6916
|
-
this[this.length - 1] = this[this.length - 1].slice(0, -before_value.length);
|
|
6917
|
-
this.assignInline(indent, value, keys3 + ".", valueKeysIfValueIsDottedTable);
|
|
6918
|
-
} else {
|
|
6919
|
-
this.appendInline = ", ";
|
|
6920
|
-
}
|
|
6921
|
-
}
|
|
6922
|
-
}
|
|
6923
|
-
assignMultiline(indent, inlineTable, keys_, keys2, comma) {
|
|
6924
|
-
const indent_ = indent + this.document.indent;
|
|
6925
|
-
for (const key of keys2) {
|
|
6926
|
-
const value = inlineTable[key];
|
|
6927
|
-
const keys3 = keys_ + $Key$(key);
|
|
6928
|
-
this.appendLine = indent_ + $Keys(keys3) + " = ";
|
|
6929
|
-
const valueKeysIfValueIsDottedTable = this.value(indent_, value, true);
|
|
6930
|
-
if (valueKeysIfValueIsDottedTable) {
|
|
6931
|
-
--this.length;
|
|
6932
|
-
this.assignMultiline(indent, value, keys3 + ".", valueKeysIfValueIsDottedTable, comma);
|
|
6933
|
-
} else {
|
|
6934
|
-
comma ? this.appendInline = "," + getComment(inlineTable, key) : this.appendInlineIf = getComment(inlineTable, key);
|
|
6935
|
-
}
|
|
6936
|
-
}
|
|
6937
|
-
}
|
|
6938
|
-
};
|
|
6939
|
-
var { test: IS_INDENT } = theRegExp(/^[\t ]*$/);
|
|
6940
|
-
var linesFromStringify = new WeakSet$1();
|
|
6941
|
-
var textDecoder = /* @__PURE__ */ new TextDecoder$1("utf-8", Null$1({ fatal: true, ignoreBOM: false }));
|
|
6942
|
-
var { test: includesNonScalar } = theRegExp(/[\uD800-\uDFFF]/u);
|
|
6943
|
-
|
|
6944
5458
|
// ../path/src/get-parent-path.ts
|
|
6945
5459
|
init_esm_shims();
|
|
6946
5460
|
var resolveParentPath = /* @__PURE__ */ __name((path6, count = 1) => {
|
|
@@ -8177,2419 +6691,6 @@ init_esm_shims();
|
|
|
8177
6691
|
|
|
8178
6692
|
// ../fs/src/write-file.ts
|
|
8179
6693
|
init_esm_shims();
|
|
8180
|
-
|
|
8181
|
-
// ../json/src/storm-json.ts
|
|
8182
|
-
init_esm_shims();
|
|
8183
|
-
|
|
8184
|
-
// ../type-checks/src/is-object.ts
|
|
8185
|
-
init_esm_shims();
|
|
8186
|
-
|
|
8187
|
-
// ../type-checks/src/is-plain-object.ts
|
|
8188
|
-
init_esm_shims();
|
|
8189
|
-
|
|
8190
|
-
// ../type-checks/src/get-object-tag.ts
|
|
8191
|
-
init_esm_shims();
|
|
8192
|
-
var getObjectTag = /* @__PURE__ */ __name((value) => {
|
|
8193
|
-
if (value == null) {
|
|
8194
|
-
return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
8195
|
-
}
|
|
8196
|
-
return Object.prototype.toString.call(value);
|
|
8197
|
-
}, "getObjectTag");
|
|
8198
|
-
|
|
8199
|
-
// ../type-checks/src/is-plain-object.ts
|
|
8200
|
-
var isObjectLike = /* @__PURE__ */ __name((obj) => {
|
|
8201
|
-
return typeof obj === "object" && obj !== null;
|
|
8202
|
-
}, "isObjectLike");
|
|
8203
|
-
var isPlainObject2 = /* @__PURE__ */ __name((obj) => {
|
|
8204
|
-
if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") {
|
|
8205
|
-
return false;
|
|
8206
|
-
}
|
|
8207
|
-
if (Object.getPrototypeOf(obj) === null) {
|
|
8208
|
-
return true;
|
|
8209
|
-
}
|
|
8210
|
-
let proto = obj;
|
|
8211
|
-
while (Object.getPrototypeOf(proto) !== null) {
|
|
8212
|
-
proto = Object.getPrototypeOf(proto);
|
|
8213
|
-
}
|
|
8214
|
-
return Object.getPrototypeOf(obj) === proto;
|
|
8215
|
-
}, "isPlainObject");
|
|
8216
|
-
|
|
8217
|
-
// ../type-checks/src/is-object.ts
|
|
8218
|
-
var isObject = /* @__PURE__ */ __name((value) => {
|
|
8219
|
-
try {
|
|
8220
|
-
return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject2(value);
|
|
8221
|
-
} catch {
|
|
8222
|
-
return false;
|
|
8223
|
-
}
|
|
8224
|
-
}, "isObject");
|
|
8225
|
-
|
|
8226
|
-
// ../type-checks/src/is-string.ts
|
|
8227
|
-
init_esm_shims();
|
|
8228
|
-
var isString2 = /* @__PURE__ */ __name((value) => {
|
|
8229
|
-
try {
|
|
8230
|
-
return typeof value === "string";
|
|
8231
|
-
} catch {
|
|
8232
|
-
return false;
|
|
8233
|
-
}
|
|
8234
|
-
}, "isString");
|
|
8235
|
-
|
|
8236
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
|
|
8237
|
-
init_esm_shims();
|
|
8238
|
-
|
|
8239
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js
|
|
8240
|
-
init_esm_shims();
|
|
8241
|
-
|
|
8242
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
8243
|
-
init_esm_shims();
|
|
8244
|
-
function createScanner(text, ignoreTrivia = false) {
|
|
8245
|
-
const len = text.length;
|
|
8246
|
-
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
8247
|
-
function scanHexDigits(count, exact) {
|
|
8248
|
-
let digits = 0;
|
|
8249
|
-
let value2 = 0;
|
|
8250
|
-
while (digits < count || !exact) {
|
|
8251
|
-
let ch = text.charCodeAt(pos);
|
|
8252
|
-
if (ch >= 48 && ch <= 57) {
|
|
8253
|
-
value2 = value2 * 16 + ch - 48;
|
|
8254
|
-
} else if (ch >= 65 && ch <= 70) {
|
|
8255
|
-
value2 = value2 * 16 + ch - 65 + 10;
|
|
8256
|
-
} else if (ch >= 97 && ch <= 102) {
|
|
8257
|
-
value2 = value2 * 16 + ch - 97 + 10;
|
|
8258
|
-
} else {
|
|
8259
|
-
break;
|
|
8260
|
-
}
|
|
8261
|
-
pos++;
|
|
8262
|
-
digits++;
|
|
8263
|
-
}
|
|
8264
|
-
if (digits < count) {
|
|
8265
|
-
value2 = -1;
|
|
8266
|
-
}
|
|
8267
|
-
return value2;
|
|
8268
|
-
}
|
|
8269
|
-
__name(scanHexDigits, "scanHexDigits");
|
|
8270
|
-
function setPosition(newPosition) {
|
|
8271
|
-
pos = newPosition;
|
|
8272
|
-
value = "";
|
|
8273
|
-
tokenOffset = 0;
|
|
8274
|
-
token = 16;
|
|
8275
|
-
scanError = 0;
|
|
8276
|
-
}
|
|
8277
|
-
__name(setPosition, "setPosition");
|
|
8278
|
-
function scanNumber() {
|
|
8279
|
-
let start = pos;
|
|
8280
|
-
if (text.charCodeAt(pos) === 48) {
|
|
8281
|
-
pos++;
|
|
8282
|
-
} else {
|
|
8283
|
-
pos++;
|
|
8284
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8285
|
-
pos++;
|
|
8286
|
-
}
|
|
8287
|
-
}
|
|
8288
|
-
if (pos < text.length && text.charCodeAt(pos) === 46) {
|
|
8289
|
-
pos++;
|
|
8290
|
-
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8291
|
-
pos++;
|
|
8292
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8293
|
-
pos++;
|
|
8294
|
-
}
|
|
8295
|
-
} else {
|
|
8296
|
-
scanError = 3;
|
|
8297
|
-
return text.substring(start, pos);
|
|
8298
|
-
}
|
|
8299
|
-
}
|
|
8300
|
-
let end = pos;
|
|
8301
|
-
if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
|
|
8302
|
-
pos++;
|
|
8303
|
-
if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
|
|
8304
|
-
pos++;
|
|
8305
|
-
}
|
|
8306
|
-
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8307
|
-
pos++;
|
|
8308
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8309
|
-
pos++;
|
|
8310
|
-
}
|
|
8311
|
-
end = pos;
|
|
8312
|
-
} else {
|
|
8313
|
-
scanError = 3;
|
|
8314
|
-
}
|
|
8315
|
-
}
|
|
8316
|
-
return text.substring(start, end);
|
|
8317
|
-
}
|
|
8318
|
-
__name(scanNumber, "scanNumber");
|
|
8319
|
-
function scanString() {
|
|
8320
|
-
let result = "", start = pos;
|
|
8321
|
-
while (true) {
|
|
8322
|
-
if (pos >= len) {
|
|
8323
|
-
result += text.substring(start, pos);
|
|
8324
|
-
scanError = 2;
|
|
8325
|
-
break;
|
|
8326
|
-
}
|
|
8327
|
-
const ch = text.charCodeAt(pos);
|
|
8328
|
-
if (ch === 34) {
|
|
8329
|
-
result += text.substring(start, pos);
|
|
8330
|
-
pos++;
|
|
8331
|
-
break;
|
|
8332
|
-
}
|
|
8333
|
-
if (ch === 92) {
|
|
8334
|
-
result += text.substring(start, pos);
|
|
8335
|
-
pos++;
|
|
8336
|
-
if (pos >= len) {
|
|
8337
|
-
scanError = 2;
|
|
8338
|
-
break;
|
|
8339
|
-
}
|
|
8340
|
-
const ch2 = text.charCodeAt(pos++);
|
|
8341
|
-
switch (ch2) {
|
|
8342
|
-
case 34:
|
|
8343
|
-
result += '"';
|
|
8344
|
-
break;
|
|
8345
|
-
case 92:
|
|
8346
|
-
result += "\\";
|
|
8347
|
-
break;
|
|
8348
|
-
case 47:
|
|
8349
|
-
result += "/";
|
|
8350
|
-
break;
|
|
8351
|
-
case 98:
|
|
8352
|
-
result += "\b";
|
|
8353
|
-
break;
|
|
8354
|
-
case 102:
|
|
8355
|
-
result += "\f";
|
|
8356
|
-
break;
|
|
8357
|
-
case 110:
|
|
8358
|
-
result += "\n";
|
|
8359
|
-
break;
|
|
8360
|
-
case 114:
|
|
8361
|
-
result += "\r";
|
|
8362
|
-
break;
|
|
8363
|
-
case 116:
|
|
8364
|
-
result += " ";
|
|
8365
|
-
break;
|
|
8366
|
-
case 117:
|
|
8367
|
-
const ch3 = scanHexDigits(4, true);
|
|
8368
|
-
if (ch3 >= 0) {
|
|
8369
|
-
result += String.fromCharCode(ch3);
|
|
8370
|
-
} else {
|
|
8371
|
-
scanError = 4;
|
|
8372
|
-
}
|
|
8373
|
-
break;
|
|
8374
|
-
default:
|
|
8375
|
-
scanError = 5;
|
|
8376
|
-
}
|
|
8377
|
-
start = pos;
|
|
8378
|
-
continue;
|
|
8379
|
-
}
|
|
8380
|
-
if (ch >= 0 && ch <= 31) {
|
|
8381
|
-
if (isLineBreak(ch)) {
|
|
8382
|
-
result += text.substring(start, pos);
|
|
8383
|
-
scanError = 2;
|
|
8384
|
-
break;
|
|
8385
|
-
} else {
|
|
8386
|
-
scanError = 6;
|
|
8387
|
-
}
|
|
8388
|
-
}
|
|
8389
|
-
pos++;
|
|
8390
|
-
}
|
|
8391
|
-
return result;
|
|
8392
|
-
}
|
|
8393
|
-
__name(scanString, "scanString");
|
|
8394
|
-
function scanNext() {
|
|
8395
|
-
value = "";
|
|
8396
|
-
scanError = 0;
|
|
8397
|
-
tokenOffset = pos;
|
|
8398
|
-
lineStartOffset = lineNumber;
|
|
8399
|
-
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
8400
|
-
if (pos >= len) {
|
|
8401
|
-
tokenOffset = len;
|
|
8402
|
-
return token = 17;
|
|
8403
|
-
}
|
|
8404
|
-
let code = text.charCodeAt(pos);
|
|
8405
|
-
if (isWhiteSpace(code)) {
|
|
8406
|
-
do {
|
|
8407
|
-
pos++;
|
|
8408
|
-
value += String.fromCharCode(code);
|
|
8409
|
-
code = text.charCodeAt(pos);
|
|
8410
|
-
} while (isWhiteSpace(code));
|
|
8411
|
-
return token = 15;
|
|
8412
|
-
}
|
|
8413
|
-
if (isLineBreak(code)) {
|
|
8414
|
-
pos++;
|
|
8415
|
-
value += String.fromCharCode(code);
|
|
8416
|
-
if (code === 13 && text.charCodeAt(pos) === 10) {
|
|
8417
|
-
pos++;
|
|
8418
|
-
value += "\n";
|
|
8419
|
-
}
|
|
8420
|
-
lineNumber++;
|
|
8421
|
-
tokenLineStartOffset = pos;
|
|
8422
|
-
return token = 14;
|
|
8423
|
-
}
|
|
8424
|
-
switch (code) {
|
|
8425
|
-
// tokens: []{}:,
|
|
8426
|
-
case 123:
|
|
8427
|
-
pos++;
|
|
8428
|
-
return token = 1;
|
|
8429
|
-
case 125:
|
|
8430
|
-
pos++;
|
|
8431
|
-
return token = 2;
|
|
8432
|
-
case 91:
|
|
8433
|
-
pos++;
|
|
8434
|
-
return token = 3;
|
|
8435
|
-
case 93:
|
|
8436
|
-
pos++;
|
|
8437
|
-
return token = 4;
|
|
8438
|
-
case 58:
|
|
8439
|
-
pos++;
|
|
8440
|
-
return token = 6;
|
|
8441
|
-
case 44:
|
|
8442
|
-
pos++;
|
|
8443
|
-
return token = 5;
|
|
8444
|
-
// strings
|
|
8445
|
-
case 34:
|
|
8446
|
-
pos++;
|
|
8447
|
-
value = scanString();
|
|
8448
|
-
return token = 10;
|
|
8449
|
-
// comments
|
|
8450
|
-
case 47:
|
|
8451
|
-
const start = pos - 1;
|
|
8452
|
-
if (text.charCodeAt(pos + 1) === 47) {
|
|
8453
|
-
pos += 2;
|
|
8454
|
-
while (pos < len) {
|
|
8455
|
-
if (isLineBreak(text.charCodeAt(pos))) {
|
|
8456
|
-
break;
|
|
8457
|
-
}
|
|
8458
|
-
pos++;
|
|
8459
|
-
}
|
|
8460
|
-
value = text.substring(start, pos);
|
|
8461
|
-
return token = 12;
|
|
8462
|
-
}
|
|
8463
|
-
if (text.charCodeAt(pos + 1) === 42) {
|
|
8464
|
-
pos += 2;
|
|
8465
|
-
const safeLength = len - 1;
|
|
8466
|
-
let commentClosed = false;
|
|
8467
|
-
while (pos < safeLength) {
|
|
8468
|
-
const ch = text.charCodeAt(pos);
|
|
8469
|
-
if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
|
|
8470
|
-
pos += 2;
|
|
8471
|
-
commentClosed = true;
|
|
8472
|
-
break;
|
|
8473
|
-
}
|
|
8474
|
-
pos++;
|
|
8475
|
-
if (isLineBreak(ch)) {
|
|
8476
|
-
if (ch === 13 && text.charCodeAt(pos) === 10) {
|
|
8477
|
-
pos++;
|
|
8478
|
-
}
|
|
8479
|
-
lineNumber++;
|
|
8480
|
-
tokenLineStartOffset = pos;
|
|
8481
|
-
}
|
|
8482
|
-
}
|
|
8483
|
-
if (!commentClosed) {
|
|
8484
|
-
pos++;
|
|
8485
|
-
scanError = 1;
|
|
8486
|
-
}
|
|
8487
|
-
value = text.substring(start, pos);
|
|
8488
|
-
return token = 13;
|
|
8489
|
-
}
|
|
8490
|
-
value += String.fromCharCode(code);
|
|
8491
|
-
pos++;
|
|
8492
|
-
return token = 16;
|
|
8493
|
-
// numbers
|
|
8494
|
-
case 45:
|
|
8495
|
-
value += String.fromCharCode(code);
|
|
8496
|
-
pos++;
|
|
8497
|
-
if (pos === len || !isDigit(text.charCodeAt(pos))) {
|
|
8498
|
-
return token = 16;
|
|
8499
|
-
}
|
|
8500
|
-
// found a minus, followed by a number so
|
|
8501
|
-
// we fall through to proceed with scanning
|
|
8502
|
-
// numbers
|
|
8503
|
-
case 48:
|
|
8504
|
-
case 49:
|
|
8505
|
-
case 50:
|
|
8506
|
-
case 51:
|
|
8507
|
-
case 52:
|
|
8508
|
-
case 53:
|
|
8509
|
-
case 54:
|
|
8510
|
-
case 55:
|
|
8511
|
-
case 56:
|
|
8512
|
-
case 57:
|
|
8513
|
-
value += scanNumber();
|
|
8514
|
-
return token = 11;
|
|
8515
|
-
// literals and unknown symbols
|
|
8516
|
-
default:
|
|
8517
|
-
while (pos < len && isUnknownContentCharacter(code)) {
|
|
8518
|
-
pos++;
|
|
8519
|
-
code = text.charCodeAt(pos);
|
|
8520
|
-
}
|
|
8521
|
-
if (tokenOffset !== pos) {
|
|
8522
|
-
value = text.substring(tokenOffset, pos);
|
|
8523
|
-
switch (value) {
|
|
8524
|
-
case "true":
|
|
8525
|
-
return token = 8;
|
|
8526
|
-
case "false":
|
|
8527
|
-
return token = 9;
|
|
8528
|
-
case "null":
|
|
8529
|
-
return token = 7;
|
|
8530
|
-
}
|
|
8531
|
-
return token = 16;
|
|
8532
|
-
}
|
|
8533
|
-
value += String.fromCharCode(code);
|
|
8534
|
-
pos++;
|
|
8535
|
-
return token = 16;
|
|
8536
|
-
}
|
|
8537
|
-
}
|
|
8538
|
-
__name(scanNext, "scanNext");
|
|
8539
|
-
function isUnknownContentCharacter(code) {
|
|
8540
|
-
if (isWhiteSpace(code) || isLineBreak(code)) {
|
|
8541
|
-
return false;
|
|
8542
|
-
}
|
|
8543
|
-
switch (code) {
|
|
8544
|
-
case 125:
|
|
8545
|
-
case 93:
|
|
8546
|
-
case 123:
|
|
8547
|
-
case 91:
|
|
8548
|
-
case 34:
|
|
8549
|
-
case 58:
|
|
8550
|
-
case 44:
|
|
8551
|
-
case 47:
|
|
8552
|
-
return false;
|
|
8553
|
-
}
|
|
8554
|
-
return true;
|
|
8555
|
-
}
|
|
8556
|
-
__name(isUnknownContentCharacter, "isUnknownContentCharacter");
|
|
8557
|
-
function scanNextNonTrivia() {
|
|
8558
|
-
let result;
|
|
8559
|
-
do {
|
|
8560
|
-
result = scanNext();
|
|
8561
|
-
} while (result >= 12 && result <= 15);
|
|
8562
|
-
return result;
|
|
8563
|
-
}
|
|
8564
|
-
__name(scanNextNonTrivia, "scanNextNonTrivia");
|
|
8565
|
-
return {
|
|
8566
|
-
setPosition,
|
|
8567
|
-
getPosition: /* @__PURE__ */ __name(() => pos, "getPosition"),
|
|
8568
|
-
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
8569
|
-
getToken: /* @__PURE__ */ __name(() => token, "getToken"),
|
|
8570
|
-
getTokenValue: /* @__PURE__ */ __name(() => value, "getTokenValue"),
|
|
8571
|
-
getTokenOffset: /* @__PURE__ */ __name(() => tokenOffset, "getTokenOffset"),
|
|
8572
|
-
getTokenLength: /* @__PURE__ */ __name(() => pos - tokenOffset, "getTokenLength"),
|
|
8573
|
-
getTokenStartLine: /* @__PURE__ */ __name(() => lineStartOffset, "getTokenStartLine"),
|
|
8574
|
-
getTokenStartCharacter: /* @__PURE__ */ __name(() => tokenOffset - prevTokenLineStartOffset, "getTokenStartCharacter"),
|
|
8575
|
-
getTokenError: /* @__PURE__ */ __name(() => scanError, "getTokenError")
|
|
8576
|
-
};
|
|
8577
|
-
}
|
|
8578
|
-
__name(createScanner, "createScanner");
|
|
8579
|
-
function isWhiteSpace(ch) {
|
|
8580
|
-
return ch === 32 || ch === 9;
|
|
8581
|
-
}
|
|
8582
|
-
__name(isWhiteSpace, "isWhiteSpace");
|
|
8583
|
-
function isLineBreak(ch) {
|
|
8584
|
-
return ch === 10 || ch === 13;
|
|
8585
|
-
}
|
|
8586
|
-
__name(isLineBreak, "isLineBreak");
|
|
8587
|
-
function isDigit(ch) {
|
|
8588
|
-
return ch >= 48 && ch <= 57;
|
|
8589
|
-
}
|
|
8590
|
-
__name(isDigit, "isDigit");
|
|
8591
|
-
var CharacterCodes;
|
|
8592
|
-
(function(CharacterCodes2) {
|
|
8593
|
-
CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
|
|
8594
|
-
CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
|
|
8595
|
-
CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
|
|
8596
|
-
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
8597
|
-
CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
|
|
8598
|
-
CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
|
|
8599
|
-
CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
|
|
8600
|
-
CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
|
|
8601
|
-
CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
|
|
8602
|
-
CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
|
|
8603
|
-
CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
|
|
8604
|
-
CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
|
|
8605
|
-
CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
|
|
8606
|
-
CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
|
|
8607
|
-
CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
|
|
8608
|
-
CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
|
|
8609
|
-
CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
|
|
8610
|
-
CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
|
|
8611
|
-
CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
|
|
8612
|
-
CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
|
|
8613
|
-
CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
|
|
8614
|
-
CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
|
|
8615
|
-
CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
|
|
8616
|
-
CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
|
|
8617
|
-
CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
|
|
8618
|
-
CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
|
|
8619
|
-
CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
|
|
8620
|
-
CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
|
|
8621
|
-
CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
|
|
8622
|
-
CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
|
|
8623
|
-
CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
|
|
8624
|
-
CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
|
|
8625
|
-
CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
|
|
8626
|
-
CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
|
|
8627
|
-
CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
|
|
8628
|
-
CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
|
|
8629
|
-
CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
|
|
8630
|
-
CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
|
|
8631
|
-
CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
|
|
8632
|
-
CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
|
|
8633
|
-
CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
|
|
8634
|
-
CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
|
|
8635
|
-
CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
|
|
8636
|
-
CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
|
|
8637
|
-
CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
|
|
8638
|
-
CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
|
|
8639
|
-
CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
|
|
8640
|
-
CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
|
|
8641
|
-
CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
|
|
8642
|
-
CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
|
|
8643
|
-
CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
|
|
8644
|
-
CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
|
|
8645
|
-
CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
|
|
8646
|
-
CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
|
|
8647
|
-
CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
|
|
8648
|
-
CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
|
|
8649
|
-
CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
|
|
8650
|
-
CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
|
|
8651
|
-
CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
|
|
8652
|
-
CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
|
|
8653
|
-
CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
|
|
8654
|
-
CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
|
|
8655
|
-
CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
|
|
8656
|
-
CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
|
|
8657
|
-
CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
|
|
8658
|
-
CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
|
|
8659
|
-
CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
|
|
8660
|
-
CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
|
|
8661
|
-
CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
|
|
8662
|
-
CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
|
|
8663
|
-
CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
|
|
8664
|
-
CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
|
|
8665
|
-
CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
|
|
8666
|
-
CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
|
|
8667
|
-
CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
|
|
8668
|
-
CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
|
|
8669
|
-
CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
|
|
8670
|
-
CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
|
|
8671
|
-
CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
|
|
8672
|
-
CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
|
|
8673
|
-
})(CharacterCodes || (CharacterCodes = {}));
|
|
8674
|
-
|
|
8675
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
8676
|
-
init_esm_shims();
|
|
8677
|
-
|
|
8678
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
8679
|
-
init_esm_shims();
|
|
8680
|
-
var ParseOptions;
|
|
8681
|
-
(function(ParseOptions2) {
|
|
8682
|
-
ParseOptions2.DEFAULT = {
|
|
8683
|
-
allowTrailingComma: false
|
|
8684
|
-
};
|
|
8685
|
-
})(ParseOptions || (ParseOptions = {}));
|
|
8686
|
-
function parse(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
8687
|
-
let currentProperty = null;
|
|
8688
|
-
let currentParent = [];
|
|
8689
|
-
const previousParents = [];
|
|
8690
|
-
function onValue(value) {
|
|
8691
|
-
if (Array.isArray(currentParent)) {
|
|
8692
|
-
currentParent.push(value);
|
|
8693
|
-
} else if (currentProperty !== null) {
|
|
8694
|
-
currentParent[currentProperty] = value;
|
|
8695
|
-
}
|
|
8696
|
-
}
|
|
8697
|
-
__name(onValue, "onValue");
|
|
8698
|
-
const visitor = {
|
|
8699
|
-
onObjectBegin: /* @__PURE__ */ __name(() => {
|
|
8700
|
-
const object = {};
|
|
8701
|
-
onValue(object);
|
|
8702
|
-
previousParents.push(currentParent);
|
|
8703
|
-
currentParent = object;
|
|
8704
|
-
currentProperty = null;
|
|
8705
|
-
}, "onObjectBegin"),
|
|
8706
|
-
onObjectProperty: /* @__PURE__ */ __name((name) => {
|
|
8707
|
-
currentProperty = name;
|
|
8708
|
-
}, "onObjectProperty"),
|
|
8709
|
-
onObjectEnd: /* @__PURE__ */ __name(() => {
|
|
8710
|
-
currentParent = previousParents.pop();
|
|
8711
|
-
}, "onObjectEnd"),
|
|
8712
|
-
onArrayBegin: /* @__PURE__ */ __name(() => {
|
|
8713
|
-
const array = [];
|
|
8714
|
-
onValue(array);
|
|
8715
|
-
previousParents.push(currentParent);
|
|
8716
|
-
currentParent = array;
|
|
8717
|
-
currentProperty = null;
|
|
8718
|
-
}, "onArrayBegin"),
|
|
8719
|
-
onArrayEnd: /* @__PURE__ */ __name(() => {
|
|
8720
|
-
currentParent = previousParents.pop();
|
|
8721
|
-
}, "onArrayEnd"),
|
|
8722
|
-
onLiteralValue: onValue,
|
|
8723
|
-
onError: /* @__PURE__ */ __name((error, offset, length) => {
|
|
8724
|
-
errors.push({
|
|
8725
|
-
error,
|
|
8726
|
-
offset,
|
|
8727
|
-
length
|
|
8728
|
-
});
|
|
8729
|
-
}, "onError")
|
|
8730
|
-
};
|
|
8731
|
-
visit(text, visitor, options);
|
|
8732
|
-
return currentParent[0];
|
|
8733
|
-
}
|
|
8734
|
-
__name(parse, "parse");
|
|
8735
|
-
function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
8736
|
-
const _scanner = createScanner(text, false);
|
|
8737
|
-
const _jsonPath = [];
|
|
8738
|
-
function toNoArgVisit(visitFunction) {
|
|
8739
|
-
return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
8740
|
-
}
|
|
8741
|
-
__name(toNoArgVisit, "toNoArgVisit");
|
|
8742
|
-
function toNoArgVisitWithPath(visitFunction) {
|
|
8743
|
-
return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
8744
|
-
}
|
|
8745
|
-
__name(toNoArgVisitWithPath, "toNoArgVisitWithPath");
|
|
8746
|
-
function toOneArgVisit(visitFunction) {
|
|
8747
|
-
return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
8748
|
-
}
|
|
8749
|
-
__name(toOneArgVisit, "toOneArgVisit");
|
|
8750
|
-
function toOneArgVisitWithPath(visitFunction) {
|
|
8751
|
-
return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
8752
|
-
}
|
|
8753
|
-
__name(toOneArgVisitWithPath, "toOneArgVisitWithPath");
|
|
8754
|
-
const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
|
|
8755
|
-
const disallowComments = options && options.disallowComments;
|
|
8756
|
-
const allowTrailingComma = options && options.allowTrailingComma;
|
|
8757
|
-
function scanNext() {
|
|
8758
|
-
while (true) {
|
|
8759
|
-
const token = _scanner.scan();
|
|
8760
|
-
switch (_scanner.getTokenError()) {
|
|
8761
|
-
case 4:
|
|
8762
|
-
handleError(
|
|
8763
|
-
14
|
|
8764
|
-
/* ParseErrorCode.InvalidUnicode */
|
|
8765
|
-
);
|
|
8766
|
-
break;
|
|
8767
|
-
case 5:
|
|
8768
|
-
handleError(
|
|
8769
|
-
15
|
|
8770
|
-
/* ParseErrorCode.InvalidEscapeCharacter */
|
|
8771
|
-
);
|
|
8772
|
-
break;
|
|
8773
|
-
case 3:
|
|
8774
|
-
handleError(
|
|
8775
|
-
13
|
|
8776
|
-
/* ParseErrorCode.UnexpectedEndOfNumber */
|
|
8777
|
-
);
|
|
8778
|
-
break;
|
|
8779
|
-
case 1:
|
|
8780
|
-
if (!disallowComments) {
|
|
8781
|
-
handleError(
|
|
8782
|
-
11
|
|
8783
|
-
/* ParseErrorCode.UnexpectedEndOfComment */
|
|
8784
|
-
);
|
|
8785
|
-
}
|
|
8786
|
-
break;
|
|
8787
|
-
case 2:
|
|
8788
|
-
handleError(
|
|
8789
|
-
12
|
|
8790
|
-
/* ParseErrorCode.UnexpectedEndOfString */
|
|
8791
|
-
);
|
|
8792
|
-
break;
|
|
8793
|
-
case 6:
|
|
8794
|
-
handleError(
|
|
8795
|
-
16
|
|
8796
|
-
/* ParseErrorCode.InvalidCharacter */
|
|
8797
|
-
);
|
|
8798
|
-
break;
|
|
8799
|
-
}
|
|
8800
|
-
switch (token) {
|
|
8801
|
-
case 12:
|
|
8802
|
-
case 13:
|
|
8803
|
-
if (disallowComments) {
|
|
8804
|
-
handleError(
|
|
8805
|
-
10
|
|
8806
|
-
/* ParseErrorCode.InvalidCommentToken */
|
|
8807
|
-
);
|
|
8808
|
-
} else {
|
|
8809
|
-
onComment();
|
|
8810
|
-
}
|
|
8811
|
-
break;
|
|
8812
|
-
case 16:
|
|
8813
|
-
handleError(
|
|
8814
|
-
1
|
|
8815
|
-
/* ParseErrorCode.InvalidSymbol */
|
|
8816
|
-
);
|
|
8817
|
-
break;
|
|
8818
|
-
case 15:
|
|
8819
|
-
case 14:
|
|
8820
|
-
break;
|
|
8821
|
-
default:
|
|
8822
|
-
return token;
|
|
8823
|
-
}
|
|
8824
|
-
}
|
|
8825
|
-
}
|
|
8826
|
-
__name(scanNext, "scanNext");
|
|
8827
|
-
function handleError(error, skipUntilAfter = [], skipUntil = []) {
|
|
8828
|
-
onError(error);
|
|
8829
|
-
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
8830
|
-
let token = _scanner.getToken();
|
|
8831
|
-
while (token !== 17) {
|
|
8832
|
-
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
8833
|
-
scanNext();
|
|
8834
|
-
break;
|
|
8835
|
-
} else if (skipUntil.indexOf(token) !== -1) {
|
|
8836
|
-
break;
|
|
8837
|
-
}
|
|
8838
|
-
token = scanNext();
|
|
8839
|
-
}
|
|
8840
|
-
}
|
|
8841
|
-
}
|
|
8842
|
-
__name(handleError, "handleError");
|
|
8843
|
-
function parseString(isValue) {
|
|
8844
|
-
const value = _scanner.getTokenValue();
|
|
8845
|
-
if (isValue) {
|
|
8846
|
-
onLiteralValue(value);
|
|
8847
|
-
} else {
|
|
8848
|
-
onObjectProperty(value);
|
|
8849
|
-
_jsonPath.push(value);
|
|
8850
|
-
}
|
|
8851
|
-
scanNext();
|
|
8852
|
-
return true;
|
|
8853
|
-
}
|
|
8854
|
-
__name(parseString, "parseString");
|
|
8855
|
-
function parseLiteral() {
|
|
8856
|
-
switch (_scanner.getToken()) {
|
|
8857
|
-
case 11:
|
|
8858
|
-
const tokenValue = _scanner.getTokenValue();
|
|
8859
|
-
let value = Number(tokenValue);
|
|
8860
|
-
if (isNaN(value)) {
|
|
8861
|
-
handleError(
|
|
8862
|
-
2
|
|
8863
|
-
/* ParseErrorCode.InvalidNumberFormat */
|
|
8864
|
-
);
|
|
8865
|
-
value = 0;
|
|
8866
|
-
}
|
|
8867
|
-
onLiteralValue(value);
|
|
8868
|
-
break;
|
|
8869
|
-
case 7:
|
|
8870
|
-
onLiteralValue(null);
|
|
8871
|
-
break;
|
|
8872
|
-
case 8:
|
|
8873
|
-
onLiteralValue(true);
|
|
8874
|
-
break;
|
|
8875
|
-
case 9:
|
|
8876
|
-
onLiteralValue(false);
|
|
8877
|
-
break;
|
|
8878
|
-
default:
|
|
8879
|
-
return false;
|
|
8880
|
-
}
|
|
8881
|
-
scanNext();
|
|
8882
|
-
return true;
|
|
8883
|
-
}
|
|
8884
|
-
__name(parseLiteral, "parseLiteral");
|
|
8885
|
-
function parseProperty() {
|
|
8886
|
-
if (_scanner.getToken() !== 10) {
|
|
8887
|
-
handleError(3, [], [
|
|
8888
|
-
2,
|
|
8889
|
-
5
|
|
8890
|
-
/* SyntaxKind.CommaToken */
|
|
8891
|
-
]);
|
|
8892
|
-
return false;
|
|
8893
|
-
}
|
|
8894
|
-
parseString(false);
|
|
8895
|
-
if (_scanner.getToken() === 6) {
|
|
8896
|
-
onSeparator(":");
|
|
8897
|
-
scanNext();
|
|
8898
|
-
if (!parseValue()) {
|
|
8899
|
-
handleError(4, [], [
|
|
8900
|
-
2,
|
|
8901
|
-
5
|
|
8902
|
-
/* SyntaxKind.CommaToken */
|
|
8903
|
-
]);
|
|
8904
|
-
}
|
|
8905
|
-
} else {
|
|
8906
|
-
handleError(5, [], [
|
|
8907
|
-
2,
|
|
8908
|
-
5
|
|
8909
|
-
/* SyntaxKind.CommaToken */
|
|
8910
|
-
]);
|
|
8911
|
-
}
|
|
8912
|
-
_jsonPath.pop();
|
|
8913
|
-
return true;
|
|
8914
|
-
}
|
|
8915
|
-
__name(parseProperty, "parseProperty");
|
|
8916
|
-
function parseObject() {
|
|
8917
|
-
onObjectBegin();
|
|
8918
|
-
scanNext();
|
|
8919
|
-
let needsComma = false;
|
|
8920
|
-
while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
|
|
8921
|
-
if (_scanner.getToken() === 5) {
|
|
8922
|
-
if (!needsComma) {
|
|
8923
|
-
handleError(4, [], []);
|
|
8924
|
-
}
|
|
8925
|
-
onSeparator(",");
|
|
8926
|
-
scanNext();
|
|
8927
|
-
if (_scanner.getToken() === 2 && allowTrailingComma) {
|
|
8928
|
-
break;
|
|
8929
|
-
}
|
|
8930
|
-
} else if (needsComma) {
|
|
8931
|
-
handleError(6, [], []);
|
|
8932
|
-
}
|
|
8933
|
-
if (!parseProperty()) {
|
|
8934
|
-
handleError(4, [], [
|
|
8935
|
-
2,
|
|
8936
|
-
5
|
|
8937
|
-
/* SyntaxKind.CommaToken */
|
|
8938
|
-
]);
|
|
8939
|
-
}
|
|
8940
|
-
needsComma = true;
|
|
8941
|
-
}
|
|
8942
|
-
onObjectEnd();
|
|
8943
|
-
if (_scanner.getToken() !== 2) {
|
|
8944
|
-
handleError(7, [
|
|
8945
|
-
2
|
|
8946
|
-
/* SyntaxKind.CloseBraceToken */
|
|
8947
|
-
], []);
|
|
8948
|
-
} else {
|
|
8949
|
-
scanNext();
|
|
8950
|
-
}
|
|
8951
|
-
return true;
|
|
8952
|
-
}
|
|
8953
|
-
__name(parseObject, "parseObject");
|
|
8954
|
-
function parseArray() {
|
|
8955
|
-
onArrayBegin();
|
|
8956
|
-
scanNext();
|
|
8957
|
-
let isFirstElement = true;
|
|
8958
|
-
let needsComma = false;
|
|
8959
|
-
while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
|
|
8960
|
-
if (_scanner.getToken() === 5) {
|
|
8961
|
-
if (!needsComma) {
|
|
8962
|
-
handleError(4, [], []);
|
|
8963
|
-
}
|
|
8964
|
-
onSeparator(",");
|
|
8965
|
-
scanNext();
|
|
8966
|
-
if (_scanner.getToken() === 4 && allowTrailingComma) {
|
|
8967
|
-
break;
|
|
8968
|
-
}
|
|
8969
|
-
} else if (needsComma) {
|
|
8970
|
-
handleError(6, [], []);
|
|
8971
|
-
}
|
|
8972
|
-
if (isFirstElement) {
|
|
8973
|
-
_jsonPath.push(0);
|
|
8974
|
-
isFirstElement = false;
|
|
8975
|
-
} else {
|
|
8976
|
-
_jsonPath[_jsonPath.length - 1]++;
|
|
8977
|
-
}
|
|
8978
|
-
if (!parseValue()) {
|
|
8979
|
-
handleError(4, [], [
|
|
8980
|
-
4,
|
|
8981
|
-
5
|
|
8982
|
-
/* SyntaxKind.CommaToken */
|
|
8983
|
-
]);
|
|
8984
|
-
}
|
|
8985
|
-
needsComma = true;
|
|
8986
|
-
}
|
|
8987
|
-
onArrayEnd();
|
|
8988
|
-
if (!isFirstElement) {
|
|
8989
|
-
_jsonPath.pop();
|
|
8990
|
-
}
|
|
8991
|
-
if (_scanner.getToken() !== 4) {
|
|
8992
|
-
handleError(8, [
|
|
8993
|
-
4
|
|
8994
|
-
/* SyntaxKind.CloseBracketToken */
|
|
8995
|
-
], []);
|
|
8996
|
-
} else {
|
|
8997
|
-
scanNext();
|
|
8998
|
-
}
|
|
8999
|
-
return true;
|
|
9000
|
-
}
|
|
9001
|
-
__name(parseArray, "parseArray");
|
|
9002
|
-
function parseValue() {
|
|
9003
|
-
switch (_scanner.getToken()) {
|
|
9004
|
-
case 3:
|
|
9005
|
-
return parseArray();
|
|
9006
|
-
case 1:
|
|
9007
|
-
return parseObject();
|
|
9008
|
-
case 10:
|
|
9009
|
-
return parseString(true);
|
|
9010
|
-
default:
|
|
9011
|
-
return parseLiteral();
|
|
9012
|
-
}
|
|
9013
|
-
}
|
|
9014
|
-
__name(parseValue, "parseValue");
|
|
9015
|
-
scanNext();
|
|
9016
|
-
if (_scanner.getToken() === 17) {
|
|
9017
|
-
if (options.allowEmptyContent) {
|
|
9018
|
-
return true;
|
|
9019
|
-
}
|
|
9020
|
-
handleError(4, [], []);
|
|
9021
|
-
return false;
|
|
9022
|
-
}
|
|
9023
|
-
if (!parseValue()) {
|
|
9024
|
-
handleError(4, [], []);
|
|
9025
|
-
return false;
|
|
9026
|
-
}
|
|
9027
|
-
if (_scanner.getToken() !== 17) {
|
|
9028
|
-
handleError(9, [], []);
|
|
9029
|
-
}
|
|
9030
|
-
return true;
|
|
9031
|
-
}
|
|
9032
|
-
__name(visit, "visit");
|
|
9033
|
-
|
|
9034
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
|
|
9035
|
-
var ScanError;
|
|
9036
|
-
(function(ScanError2) {
|
|
9037
|
-
ScanError2[ScanError2["None"] = 0] = "None";
|
|
9038
|
-
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
9039
|
-
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
9040
|
-
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
9041
|
-
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
9042
|
-
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
9043
|
-
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
9044
|
-
})(ScanError || (ScanError = {}));
|
|
9045
|
-
var SyntaxKind;
|
|
9046
|
-
(function(SyntaxKind2) {
|
|
9047
|
-
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
9048
|
-
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
9049
|
-
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
9050
|
-
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
9051
|
-
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
9052
|
-
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
9053
|
-
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
9054
|
-
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
9055
|
-
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
9056
|
-
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
9057
|
-
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
9058
|
-
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
9059
|
-
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
9060
|
-
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
9061
|
-
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
9062
|
-
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
9063
|
-
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
9064
|
-
})(SyntaxKind || (SyntaxKind = {}));
|
|
9065
|
-
var parse2 = parse;
|
|
9066
|
-
var ParseErrorCode;
|
|
9067
|
-
(function(ParseErrorCode2) {
|
|
9068
|
-
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
9069
|
-
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
9070
|
-
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
9071
|
-
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
9072
|
-
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
9073
|
-
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
9074
|
-
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
9075
|
-
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
9076
|
-
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
9077
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
9078
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
9079
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
9080
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
9081
|
-
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
9082
|
-
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
9083
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
9084
|
-
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
9085
|
-
function printParseErrorCode(code) {
|
|
9086
|
-
switch (code) {
|
|
9087
|
-
case 1:
|
|
9088
|
-
return "InvalidSymbol";
|
|
9089
|
-
case 2:
|
|
9090
|
-
return "InvalidNumberFormat";
|
|
9091
|
-
case 3:
|
|
9092
|
-
return "PropertyNameExpected";
|
|
9093
|
-
case 4:
|
|
9094
|
-
return "ValueExpected";
|
|
9095
|
-
case 5:
|
|
9096
|
-
return "ColonExpected";
|
|
9097
|
-
case 6:
|
|
9098
|
-
return "CommaExpected";
|
|
9099
|
-
case 7:
|
|
9100
|
-
return "CloseBraceExpected";
|
|
9101
|
-
case 8:
|
|
9102
|
-
return "CloseBracketExpected";
|
|
9103
|
-
case 9:
|
|
9104
|
-
return "EndOfFileExpected";
|
|
9105
|
-
case 10:
|
|
9106
|
-
return "InvalidCommentToken";
|
|
9107
|
-
case 11:
|
|
9108
|
-
return "UnexpectedEndOfComment";
|
|
9109
|
-
case 12:
|
|
9110
|
-
return "UnexpectedEndOfString";
|
|
9111
|
-
case 13:
|
|
9112
|
-
return "UnexpectedEndOfNumber";
|
|
9113
|
-
case 14:
|
|
9114
|
-
return "InvalidUnicode";
|
|
9115
|
-
case 15:
|
|
9116
|
-
return "InvalidEscapeCharacter";
|
|
9117
|
-
case 16:
|
|
9118
|
-
return "InvalidCharacter";
|
|
9119
|
-
}
|
|
9120
|
-
return "<unknown ParseErrorCode>";
|
|
9121
|
-
}
|
|
9122
|
-
__name(printParseErrorCode, "printParseErrorCode");
|
|
9123
|
-
|
|
9124
|
-
// ../json/src/storm-json.ts
|
|
9125
|
-
import { Buffer as Buffer2 } from "node:buffer";
|
|
9126
|
-
|
|
9127
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js
|
|
9128
|
-
init_esm_shims();
|
|
9129
|
-
|
|
9130
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js
|
|
9131
|
-
init_esm_shims();
|
|
9132
|
-
|
|
9133
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js
|
|
9134
|
-
init_esm_shims();
|
|
9135
|
-
|
|
9136
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.js
|
|
9137
|
-
init_esm_shims();
|
|
9138
|
-
var DoubleIndexedKV = class {
|
|
9139
|
-
static {
|
|
9140
|
-
__name(this, "DoubleIndexedKV");
|
|
9141
|
-
}
|
|
9142
|
-
constructor() {
|
|
9143
|
-
this.keyToValue = /* @__PURE__ */ new Map();
|
|
9144
|
-
this.valueToKey = /* @__PURE__ */ new Map();
|
|
9145
|
-
}
|
|
9146
|
-
set(key, value) {
|
|
9147
|
-
this.keyToValue.set(key, value);
|
|
9148
|
-
this.valueToKey.set(value, key);
|
|
9149
|
-
}
|
|
9150
|
-
getByKey(key) {
|
|
9151
|
-
return this.keyToValue.get(key);
|
|
9152
|
-
}
|
|
9153
|
-
getByValue(value) {
|
|
9154
|
-
return this.valueToKey.get(value);
|
|
9155
|
-
}
|
|
9156
|
-
clear() {
|
|
9157
|
-
this.keyToValue.clear();
|
|
9158
|
-
this.valueToKey.clear();
|
|
9159
|
-
}
|
|
9160
|
-
};
|
|
9161
|
-
|
|
9162
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js
|
|
9163
|
-
var Registry = class {
|
|
9164
|
-
static {
|
|
9165
|
-
__name(this, "Registry");
|
|
9166
|
-
}
|
|
9167
|
-
constructor(generateIdentifier) {
|
|
9168
|
-
this.generateIdentifier = generateIdentifier;
|
|
9169
|
-
this.kv = new DoubleIndexedKV();
|
|
9170
|
-
}
|
|
9171
|
-
register(value, identifier) {
|
|
9172
|
-
if (this.kv.getByValue(value)) {
|
|
9173
|
-
return;
|
|
9174
|
-
}
|
|
9175
|
-
if (!identifier) {
|
|
9176
|
-
identifier = this.generateIdentifier(value);
|
|
9177
|
-
}
|
|
9178
|
-
this.kv.set(identifier, value);
|
|
9179
|
-
}
|
|
9180
|
-
clear() {
|
|
9181
|
-
this.kv.clear();
|
|
9182
|
-
}
|
|
9183
|
-
getIdentifier(value) {
|
|
9184
|
-
return this.kv.getByValue(value);
|
|
9185
|
-
}
|
|
9186
|
-
getValue(identifier) {
|
|
9187
|
-
return this.kv.getByKey(identifier);
|
|
9188
|
-
}
|
|
9189
|
-
};
|
|
9190
|
-
|
|
9191
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js
|
|
9192
|
-
var ClassRegistry = class extends Registry {
|
|
9193
|
-
static {
|
|
9194
|
-
__name(this, "ClassRegistry");
|
|
9195
|
-
}
|
|
9196
|
-
constructor() {
|
|
9197
|
-
super((c) => c.name);
|
|
9198
|
-
this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
9199
|
-
}
|
|
9200
|
-
register(value, options) {
|
|
9201
|
-
if (typeof options === "object") {
|
|
9202
|
-
if (options.allowProps) {
|
|
9203
|
-
this.classToAllowedProps.set(value, options.allowProps);
|
|
9204
|
-
}
|
|
9205
|
-
super.register(value, options.identifier);
|
|
9206
|
-
} else {
|
|
9207
|
-
super.register(value, options);
|
|
9208
|
-
}
|
|
9209
|
-
}
|
|
9210
|
-
getAllowedProps(value) {
|
|
9211
|
-
return this.classToAllowedProps.get(value);
|
|
9212
|
-
}
|
|
9213
|
-
};
|
|
9214
|
-
|
|
9215
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js
|
|
9216
|
-
init_esm_shims();
|
|
9217
|
-
|
|
9218
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.js
|
|
9219
|
-
init_esm_shims();
|
|
9220
|
-
function valuesOfObj(record) {
|
|
9221
|
-
if ("values" in Object) {
|
|
9222
|
-
return Object.values(record);
|
|
9223
|
-
}
|
|
9224
|
-
const values = [];
|
|
9225
|
-
for (const key in record) {
|
|
9226
|
-
if (record.hasOwnProperty(key)) {
|
|
9227
|
-
values.push(record[key]);
|
|
9228
|
-
}
|
|
9229
|
-
}
|
|
9230
|
-
return values;
|
|
9231
|
-
}
|
|
9232
|
-
__name(valuesOfObj, "valuesOfObj");
|
|
9233
|
-
function find(record, predicate) {
|
|
9234
|
-
const values = valuesOfObj(record);
|
|
9235
|
-
if ("find" in values) {
|
|
9236
|
-
return values.find(predicate);
|
|
9237
|
-
}
|
|
9238
|
-
const valuesNotNever = values;
|
|
9239
|
-
for (let i = 0; i < valuesNotNever.length; i++) {
|
|
9240
|
-
const value = valuesNotNever[i];
|
|
9241
|
-
if (predicate(value)) {
|
|
9242
|
-
return value;
|
|
9243
|
-
}
|
|
9244
|
-
}
|
|
9245
|
-
return void 0;
|
|
9246
|
-
}
|
|
9247
|
-
__name(find, "find");
|
|
9248
|
-
function forEach(record, run) {
|
|
9249
|
-
Object.entries(record).forEach(([key, value]) => run(value, key));
|
|
9250
|
-
}
|
|
9251
|
-
__name(forEach, "forEach");
|
|
9252
|
-
function includes2(arr, value) {
|
|
9253
|
-
return arr.indexOf(value) !== -1;
|
|
9254
|
-
}
|
|
9255
|
-
__name(includes2, "includes");
|
|
9256
|
-
function findArr(record, predicate) {
|
|
9257
|
-
for (let i = 0; i < record.length; i++) {
|
|
9258
|
-
const value = record[i];
|
|
9259
|
-
if (predicate(value)) {
|
|
9260
|
-
return value;
|
|
9261
|
-
}
|
|
9262
|
-
}
|
|
9263
|
-
return void 0;
|
|
9264
|
-
}
|
|
9265
|
-
__name(findArr, "findArr");
|
|
9266
|
-
|
|
9267
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js
|
|
9268
|
-
var CustomTransformerRegistry = class {
|
|
9269
|
-
static {
|
|
9270
|
-
__name(this, "CustomTransformerRegistry");
|
|
9271
|
-
}
|
|
9272
|
-
constructor() {
|
|
9273
|
-
this.transfomers = {};
|
|
9274
|
-
}
|
|
9275
|
-
register(transformer) {
|
|
9276
|
-
this.transfomers[transformer.name] = transformer;
|
|
9277
|
-
}
|
|
9278
|
-
findApplicable(v) {
|
|
9279
|
-
return find(this.transfomers, (transformer) => transformer.isApplicable(v));
|
|
9280
|
-
}
|
|
9281
|
-
findByName(name) {
|
|
9282
|
-
return this.transfomers[name];
|
|
9283
|
-
}
|
|
9284
|
-
};
|
|
9285
|
-
|
|
9286
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js
|
|
9287
|
-
init_esm_shims();
|
|
9288
|
-
|
|
9289
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.js
|
|
9290
|
-
init_esm_shims();
|
|
9291
|
-
var getType = /* @__PURE__ */ __name((payload) => Object.prototype.toString.call(payload).slice(8, -1), "getType");
|
|
9292
|
-
var isUndefined = /* @__PURE__ */ __name((payload) => typeof payload === "undefined", "isUndefined");
|
|
9293
|
-
var isNull = /* @__PURE__ */ __name((payload) => payload === null, "isNull");
|
|
9294
|
-
var isPlainObject3 = /* @__PURE__ */ __name((payload) => {
|
|
9295
|
-
if (typeof payload !== "object" || payload === null) return false;
|
|
9296
|
-
if (payload === Object.prototype) return false;
|
|
9297
|
-
if (Object.getPrototypeOf(payload) === null) return true;
|
|
9298
|
-
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
9299
|
-
}, "isPlainObject");
|
|
9300
|
-
var isEmptyObject = /* @__PURE__ */ __name((payload) => isPlainObject3(payload) && Object.keys(payload).length === 0, "isEmptyObject");
|
|
9301
|
-
var isArray = /* @__PURE__ */ __name((payload) => Array.isArray(payload), "isArray");
|
|
9302
|
-
var isString3 = /* @__PURE__ */ __name((payload) => typeof payload === "string", "isString");
|
|
9303
|
-
var isNumber2 = /* @__PURE__ */ __name((payload) => typeof payload === "number" && !isNaN(payload), "isNumber");
|
|
9304
|
-
var isBoolean2 = /* @__PURE__ */ __name((payload) => typeof payload === "boolean", "isBoolean");
|
|
9305
|
-
var isRegExp = /* @__PURE__ */ __name((payload) => payload instanceof RegExp, "isRegExp");
|
|
9306
|
-
var isMap = /* @__PURE__ */ __name((payload) => payload instanceof Map, "isMap");
|
|
9307
|
-
var isSet = /* @__PURE__ */ __name((payload) => payload instanceof Set, "isSet");
|
|
9308
|
-
var isSymbol = /* @__PURE__ */ __name((payload) => getType(payload) === "Symbol", "isSymbol");
|
|
9309
|
-
var isDate2 = /* @__PURE__ */ __name((payload) => payload instanceof Date && !isNaN(payload.valueOf()), "isDate");
|
|
9310
|
-
var isError = /* @__PURE__ */ __name((payload) => payload instanceof Error, "isError");
|
|
9311
|
-
var isNaNValue = /* @__PURE__ */ __name((payload) => typeof payload === "number" && isNaN(payload), "isNaNValue");
|
|
9312
|
-
var isPrimitive = /* @__PURE__ */ __name((payload) => isBoolean2(payload) || isNull(payload) || isUndefined(payload) || isNumber2(payload) || isString3(payload) || isSymbol(payload), "isPrimitive");
|
|
9313
|
-
var isBigint = /* @__PURE__ */ __name((payload) => typeof payload === "bigint", "isBigint");
|
|
9314
|
-
var isInfinite = /* @__PURE__ */ __name((payload) => payload === Infinity || payload === -Infinity, "isInfinite");
|
|
9315
|
-
var isTypedArray = /* @__PURE__ */ __name((payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView), "isTypedArray");
|
|
9316
|
-
var isURL = /* @__PURE__ */ __name((payload) => payload instanceof URL, "isURL");
|
|
9317
|
-
|
|
9318
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.js
|
|
9319
|
-
init_esm_shims();
|
|
9320
|
-
var escapeKey = /* @__PURE__ */ __name((key) => key.replace(/\./g, "\\."), "escapeKey");
|
|
9321
|
-
var stringifyPath = /* @__PURE__ */ __name((path6) => path6.map(String).map(escapeKey).join("."), "stringifyPath");
|
|
9322
|
-
var parsePath = /* @__PURE__ */ __name((string) => {
|
|
9323
|
-
const result = [];
|
|
9324
|
-
let segment = "";
|
|
9325
|
-
for (let i = 0; i < string.length; i++) {
|
|
9326
|
-
let char = string.charAt(i);
|
|
9327
|
-
const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
|
|
9328
|
-
if (isEscapedDot) {
|
|
9329
|
-
segment += ".";
|
|
9330
|
-
i++;
|
|
9331
|
-
continue;
|
|
9332
|
-
}
|
|
9333
|
-
const isEndOfSegment = char === ".";
|
|
9334
|
-
if (isEndOfSegment) {
|
|
9335
|
-
result.push(segment);
|
|
9336
|
-
segment = "";
|
|
9337
|
-
continue;
|
|
9338
|
-
}
|
|
9339
|
-
segment += char;
|
|
9340
|
-
}
|
|
9341
|
-
const lastSegment = segment;
|
|
9342
|
-
result.push(lastSegment);
|
|
9343
|
-
return result;
|
|
9344
|
-
}, "parsePath");
|
|
9345
|
-
|
|
9346
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.js
|
|
9347
|
-
init_esm_shims();
|
|
9348
|
-
function simpleTransformation(isApplicable, annotation, transform, untransform) {
|
|
9349
|
-
return {
|
|
9350
|
-
isApplicable,
|
|
9351
|
-
annotation,
|
|
9352
|
-
transform,
|
|
9353
|
-
untransform
|
|
9354
|
-
};
|
|
9355
|
-
}
|
|
9356
|
-
__name(simpleTransformation, "simpleTransformation");
|
|
9357
|
-
var simpleRules = [
|
|
9358
|
-
simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
|
|
9359
|
-
simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
|
|
9360
|
-
if (typeof BigInt !== "undefined") {
|
|
9361
|
-
return BigInt(v);
|
|
9362
|
-
}
|
|
9363
|
-
console.error("Please add a BigInt polyfill.");
|
|
9364
|
-
return v;
|
|
9365
|
-
}),
|
|
9366
|
-
simpleTransformation(isDate2, "Date", (v) => v.toISOString(), (v) => new Date(v)),
|
|
9367
|
-
simpleTransformation(isError, "Error", (v, superJson) => {
|
|
9368
|
-
const baseError = {
|
|
9369
|
-
name: v.name,
|
|
9370
|
-
message: v.message
|
|
9371
|
-
};
|
|
9372
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
9373
|
-
baseError[prop] = v[prop];
|
|
9374
|
-
});
|
|
9375
|
-
return baseError;
|
|
9376
|
-
}, (v, superJson) => {
|
|
9377
|
-
const e = new Error(v.message);
|
|
9378
|
-
e.name = v.name;
|
|
9379
|
-
e.stack = v.stack;
|
|
9380
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
9381
|
-
e[prop] = v[prop];
|
|
9382
|
-
});
|
|
9383
|
-
return e;
|
|
9384
|
-
}),
|
|
9385
|
-
simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
|
|
9386
|
-
const body = regex.slice(1, regex.lastIndexOf("/"));
|
|
9387
|
-
const flags = regex.slice(regex.lastIndexOf("/") + 1);
|
|
9388
|
-
return new RegExp(body, flags);
|
|
9389
|
-
}),
|
|
9390
|
-
simpleTransformation(
|
|
9391
|
-
isSet,
|
|
9392
|
-
"set",
|
|
9393
|
-
// (sets only exist in es6+)
|
|
9394
|
-
// eslint-disable-next-line es5/no-es6-methods
|
|
9395
|
-
(v) => [
|
|
9396
|
-
...v.values()
|
|
9397
|
-
],
|
|
9398
|
-
(v) => new Set(v)
|
|
9399
|
-
),
|
|
9400
|
-
simpleTransformation(isMap, "map", (v) => [
|
|
9401
|
-
...v.entries()
|
|
9402
|
-
], (v) => new Map(v)),
|
|
9403
|
-
simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
|
|
9404
|
-
if (isNaNValue(v)) {
|
|
9405
|
-
return "NaN";
|
|
9406
|
-
}
|
|
9407
|
-
if (v > 0) {
|
|
9408
|
-
return "Infinity";
|
|
9409
|
-
} else {
|
|
9410
|
-
return "-Infinity";
|
|
9411
|
-
}
|
|
9412
|
-
}, Number),
|
|
9413
|
-
simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
|
|
9414
|
-
return "-0";
|
|
9415
|
-
}, Number),
|
|
9416
|
-
simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
|
|
9417
|
-
];
|
|
9418
|
-
function compositeTransformation(isApplicable, annotation, transform, untransform) {
|
|
9419
|
-
return {
|
|
9420
|
-
isApplicable,
|
|
9421
|
-
annotation,
|
|
9422
|
-
transform,
|
|
9423
|
-
untransform
|
|
9424
|
-
};
|
|
9425
|
-
}
|
|
9426
|
-
__name(compositeTransformation, "compositeTransformation");
|
|
9427
|
-
var symbolRule = compositeTransformation((s, superJson) => {
|
|
9428
|
-
if (isSymbol(s)) {
|
|
9429
|
-
const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
|
|
9430
|
-
return isRegistered;
|
|
9431
|
-
}
|
|
9432
|
-
return false;
|
|
9433
|
-
}, (s, superJson) => {
|
|
9434
|
-
const identifier = superJson.symbolRegistry.getIdentifier(s);
|
|
9435
|
-
return [
|
|
9436
|
-
"symbol",
|
|
9437
|
-
identifier
|
|
9438
|
-
];
|
|
9439
|
-
}, (v) => v.description, (_, a, superJson) => {
|
|
9440
|
-
const value = superJson.symbolRegistry.getValue(a[1]);
|
|
9441
|
-
if (!value) {
|
|
9442
|
-
throw new Error("Trying to deserialize unknown symbol");
|
|
9443
|
-
}
|
|
9444
|
-
return value;
|
|
9445
|
-
});
|
|
9446
|
-
var constructorToName = [
|
|
9447
|
-
Int8Array,
|
|
9448
|
-
Uint8Array,
|
|
9449
|
-
Int16Array,
|
|
9450
|
-
Uint16Array,
|
|
9451
|
-
Int32Array,
|
|
9452
|
-
Uint32Array,
|
|
9453
|
-
Float32Array,
|
|
9454
|
-
Float64Array,
|
|
9455
|
-
Uint8ClampedArray
|
|
9456
|
-
].reduce((obj, ctor) => {
|
|
9457
|
-
obj[ctor.name] = ctor;
|
|
9458
|
-
return obj;
|
|
9459
|
-
}, {});
|
|
9460
|
-
var typedArrayRule = compositeTransformation(isTypedArray, (v) => [
|
|
9461
|
-
"typed-array",
|
|
9462
|
-
v.constructor.name
|
|
9463
|
-
], (v) => [
|
|
9464
|
-
...v
|
|
9465
|
-
], (v, a) => {
|
|
9466
|
-
const ctor = constructorToName[a[1]];
|
|
9467
|
-
if (!ctor) {
|
|
9468
|
-
throw new Error("Trying to deserialize unknown typed array");
|
|
9469
|
-
}
|
|
9470
|
-
return new ctor(v);
|
|
9471
|
-
});
|
|
9472
|
-
function isInstanceOfRegisteredClass(potentialClass, superJson) {
|
|
9473
|
-
if (potentialClass?.constructor) {
|
|
9474
|
-
const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
|
|
9475
|
-
return isRegistered;
|
|
9476
|
-
}
|
|
9477
|
-
return false;
|
|
9478
|
-
}
|
|
9479
|
-
__name(isInstanceOfRegisteredClass, "isInstanceOfRegisteredClass");
|
|
9480
|
-
var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
|
|
9481
|
-
const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
|
|
9482
|
-
return [
|
|
9483
|
-
"class",
|
|
9484
|
-
identifier
|
|
9485
|
-
];
|
|
9486
|
-
}, (clazz, superJson) => {
|
|
9487
|
-
const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
|
|
9488
|
-
if (!allowedProps) {
|
|
9489
|
-
return {
|
|
9490
|
-
...clazz
|
|
9491
|
-
};
|
|
9492
|
-
}
|
|
9493
|
-
const result = {};
|
|
9494
|
-
allowedProps.forEach((prop) => {
|
|
9495
|
-
result[prop] = clazz[prop];
|
|
9496
|
-
});
|
|
9497
|
-
return result;
|
|
9498
|
-
}, (v, a, superJson) => {
|
|
9499
|
-
const clazz = superJson.classRegistry.getValue(a[1]);
|
|
9500
|
-
if (!clazz) {
|
|
9501
|
-
throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
9502
|
-
}
|
|
9503
|
-
return Object.assign(Object.create(clazz.prototype), v);
|
|
9504
|
-
});
|
|
9505
|
-
var customRule = compositeTransformation((value, superJson) => {
|
|
9506
|
-
return !!superJson.customTransformerRegistry.findApplicable(value);
|
|
9507
|
-
}, (value, superJson) => {
|
|
9508
|
-
const transformer = superJson.customTransformerRegistry.findApplicable(value);
|
|
9509
|
-
return [
|
|
9510
|
-
"custom",
|
|
9511
|
-
transformer.name
|
|
9512
|
-
];
|
|
9513
|
-
}, (value, superJson) => {
|
|
9514
|
-
const transformer = superJson.customTransformerRegistry.findApplicable(value);
|
|
9515
|
-
return transformer.serialize(value);
|
|
9516
|
-
}, (v, a, superJson) => {
|
|
9517
|
-
const transformer = superJson.customTransformerRegistry.findByName(a[1]);
|
|
9518
|
-
if (!transformer) {
|
|
9519
|
-
throw new Error("Trying to deserialize unknown custom value");
|
|
9520
|
-
}
|
|
9521
|
-
return transformer.deserialize(v);
|
|
9522
|
-
});
|
|
9523
|
-
var compositeRules = [
|
|
9524
|
-
classRule,
|
|
9525
|
-
symbolRule,
|
|
9526
|
-
customRule,
|
|
9527
|
-
typedArrayRule
|
|
9528
|
-
];
|
|
9529
|
-
var transformValue = /* @__PURE__ */ __name((value, superJson) => {
|
|
9530
|
-
const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
|
|
9531
|
-
if (applicableCompositeRule) {
|
|
9532
|
-
return {
|
|
9533
|
-
value: applicableCompositeRule.transform(value, superJson),
|
|
9534
|
-
type: applicableCompositeRule.annotation(value, superJson)
|
|
9535
|
-
};
|
|
9536
|
-
}
|
|
9537
|
-
const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
|
|
9538
|
-
if (applicableSimpleRule) {
|
|
9539
|
-
return {
|
|
9540
|
-
value: applicableSimpleRule.transform(value, superJson),
|
|
9541
|
-
type: applicableSimpleRule.annotation
|
|
9542
|
-
};
|
|
9543
|
-
}
|
|
9544
|
-
return void 0;
|
|
9545
|
-
}, "transformValue");
|
|
9546
|
-
var simpleRulesByAnnotation = {};
|
|
9547
|
-
simpleRules.forEach((rule) => {
|
|
9548
|
-
simpleRulesByAnnotation[rule.annotation] = rule;
|
|
9549
|
-
});
|
|
9550
|
-
var untransformValue = /* @__PURE__ */ __name((json, type, superJson) => {
|
|
9551
|
-
if (isArray(type)) {
|
|
9552
|
-
switch (type[0]) {
|
|
9553
|
-
case "symbol":
|
|
9554
|
-
return symbolRule.untransform(json, type, superJson);
|
|
9555
|
-
case "class":
|
|
9556
|
-
return classRule.untransform(json, type, superJson);
|
|
9557
|
-
case "custom":
|
|
9558
|
-
return customRule.untransform(json, type, superJson);
|
|
9559
|
-
case "typed-array":
|
|
9560
|
-
return typedArrayRule.untransform(json, type, superJson);
|
|
9561
|
-
default:
|
|
9562
|
-
throw new Error("Unknown transformation: " + type);
|
|
9563
|
-
}
|
|
9564
|
-
} else {
|
|
9565
|
-
const transformation = simpleRulesByAnnotation[type];
|
|
9566
|
-
if (!transformation) {
|
|
9567
|
-
throw new Error("Unknown transformation: " + type);
|
|
9568
|
-
}
|
|
9569
|
-
return transformation.untransform(json, superJson);
|
|
9570
|
-
}
|
|
9571
|
-
}, "untransformValue");
|
|
9572
|
-
|
|
9573
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.js
|
|
9574
|
-
init_esm_shims();
|
|
9575
|
-
var getNthKey = /* @__PURE__ */ __name((value, n) => {
|
|
9576
|
-
if (n > value.size) throw new Error("index out of bounds");
|
|
9577
|
-
const keys2 = value.keys();
|
|
9578
|
-
while (n > 0) {
|
|
9579
|
-
keys2.next();
|
|
9580
|
-
n--;
|
|
9581
|
-
}
|
|
9582
|
-
return keys2.next().value;
|
|
9583
|
-
}, "getNthKey");
|
|
9584
|
-
function validatePath(path6) {
|
|
9585
|
-
if (includes2(path6, "__proto__")) {
|
|
9586
|
-
throw new Error("__proto__ is not allowed as a property");
|
|
9587
|
-
}
|
|
9588
|
-
if (includes2(path6, "prototype")) {
|
|
9589
|
-
throw new Error("prototype is not allowed as a property");
|
|
9590
|
-
}
|
|
9591
|
-
if (includes2(path6, "constructor")) {
|
|
9592
|
-
throw new Error("constructor is not allowed as a property");
|
|
9593
|
-
}
|
|
9594
|
-
}
|
|
9595
|
-
__name(validatePath, "validatePath");
|
|
9596
|
-
var getDeep = /* @__PURE__ */ __name((object, path6) => {
|
|
9597
|
-
validatePath(path6);
|
|
9598
|
-
for (let i = 0; i < path6.length; i++) {
|
|
9599
|
-
const key = path6[i];
|
|
9600
|
-
if (isSet(object)) {
|
|
9601
|
-
object = getNthKey(object, +key);
|
|
9602
|
-
} else if (isMap(object)) {
|
|
9603
|
-
const row = +key;
|
|
9604
|
-
const type = +path6[++i] === 0 ? "key" : "value";
|
|
9605
|
-
const keyOfRow = getNthKey(object, row);
|
|
9606
|
-
switch (type) {
|
|
9607
|
-
case "key":
|
|
9608
|
-
object = keyOfRow;
|
|
9609
|
-
break;
|
|
9610
|
-
case "value":
|
|
9611
|
-
object = object.get(keyOfRow);
|
|
9612
|
-
break;
|
|
9613
|
-
}
|
|
9614
|
-
} else {
|
|
9615
|
-
object = object[key];
|
|
9616
|
-
}
|
|
9617
|
-
}
|
|
9618
|
-
return object;
|
|
9619
|
-
}, "getDeep");
|
|
9620
|
-
var setDeep = /* @__PURE__ */ __name((object, path6, mapper) => {
|
|
9621
|
-
validatePath(path6);
|
|
9622
|
-
if (path6.length === 0) {
|
|
9623
|
-
return mapper(object);
|
|
9624
|
-
}
|
|
9625
|
-
let parent = object;
|
|
9626
|
-
for (let i = 0; i < path6.length - 1; i++) {
|
|
9627
|
-
const key = path6[i];
|
|
9628
|
-
if (isArray(parent)) {
|
|
9629
|
-
const index = +key;
|
|
9630
|
-
parent = parent[index];
|
|
9631
|
-
} else if (isPlainObject3(parent)) {
|
|
9632
|
-
parent = parent[key];
|
|
9633
|
-
} else if (isSet(parent)) {
|
|
9634
|
-
const row = +key;
|
|
9635
|
-
parent = getNthKey(parent, row);
|
|
9636
|
-
} else if (isMap(parent)) {
|
|
9637
|
-
const isEnd = i === path6.length - 2;
|
|
9638
|
-
if (isEnd) {
|
|
9639
|
-
break;
|
|
9640
|
-
}
|
|
9641
|
-
const row = +key;
|
|
9642
|
-
const type = +path6[++i] === 0 ? "key" : "value";
|
|
9643
|
-
const keyOfRow = getNthKey(parent, row);
|
|
9644
|
-
switch (type) {
|
|
9645
|
-
case "key":
|
|
9646
|
-
parent = keyOfRow;
|
|
9647
|
-
break;
|
|
9648
|
-
case "value":
|
|
9649
|
-
parent = parent.get(keyOfRow);
|
|
9650
|
-
break;
|
|
9651
|
-
}
|
|
9652
|
-
}
|
|
9653
|
-
}
|
|
9654
|
-
const lastKey = path6[path6.length - 1];
|
|
9655
|
-
if (isArray(parent)) {
|
|
9656
|
-
parent[+lastKey] = mapper(parent[+lastKey]);
|
|
9657
|
-
} else if (isPlainObject3(parent)) {
|
|
9658
|
-
parent[lastKey] = mapper(parent[lastKey]);
|
|
9659
|
-
}
|
|
9660
|
-
if (isSet(parent)) {
|
|
9661
|
-
const oldValue = getNthKey(parent, +lastKey);
|
|
9662
|
-
const newValue = mapper(oldValue);
|
|
9663
|
-
if (oldValue !== newValue) {
|
|
9664
|
-
parent.delete(oldValue);
|
|
9665
|
-
parent.add(newValue);
|
|
9666
|
-
}
|
|
9667
|
-
}
|
|
9668
|
-
if (isMap(parent)) {
|
|
9669
|
-
const row = +path6[path6.length - 2];
|
|
9670
|
-
const keyToRow = getNthKey(parent, row);
|
|
9671
|
-
const type = +lastKey === 0 ? "key" : "value";
|
|
9672
|
-
switch (type) {
|
|
9673
|
-
case "key": {
|
|
9674
|
-
const newKey = mapper(keyToRow);
|
|
9675
|
-
parent.set(newKey, parent.get(keyToRow));
|
|
9676
|
-
if (newKey !== keyToRow) {
|
|
9677
|
-
parent.delete(keyToRow);
|
|
9678
|
-
}
|
|
9679
|
-
break;
|
|
9680
|
-
}
|
|
9681
|
-
case "value": {
|
|
9682
|
-
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
9683
|
-
break;
|
|
9684
|
-
}
|
|
9685
|
-
}
|
|
9686
|
-
}
|
|
9687
|
-
return object;
|
|
9688
|
-
}, "setDeep");
|
|
9689
|
-
|
|
9690
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js
|
|
9691
|
-
function traverse(tree, walker2, origin = []) {
|
|
9692
|
-
if (!tree) {
|
|
9693
|
-
return;
|
|
9694
|
-
}
|
|
9695
|
-
if (!isArray(tree)) {
|
|
9696
|
-
forEach(tree, (subtree, key) => traverse(subtree, walker2, [
|
|
9697
|
-
...origin,
|
|
9698
|
-
...parsePath(key)
|
|
9699
|
-
]));
|
|
9700
|
-
return;
|
|
9701
|
-
}
|
|
9702
|
-
const [nodeValue, children] = tree;
|
|
9703
|
-
if (children) {
|
|
9704
|
-
forEach(children, (child, key) => {
|
|
9705
|
-
traverse(child, walker2, [
|
|
9706
|
-
...origin,
|
|
9707
|
-
...parsePath(key)
|
|
9708
|
-
]);
|
|
9709
|
-
});
|
|
9710
|
-
}
|
|
9711
|
-
walker2(nodeValue, origin);
|
|
9712
|
-
}
|
|
9713
|
-
__name(traverse, "traverse");
|
|
9714
|
-
function applyValueAnnotations(plain, annotations, superJson) {
|
|
9715
|
-
traverse(annotations, (type, path6) => {
|
|
9716
|
-
plain = setDeep(plain, path6, (v) => untransformValue(v, type, superJson));
|
|
9717
|
-
});
|
|
9718
|
-
return plain;
|
|
9719
|
-
}
|
|
9720
|
-
__name(applyValueAnnotations, "applyValueAnnotations");
|
|
9721
|
-
function applyReferentialEqualityAnnotations(plain, annotations) {
|
|
9722
|
-
function apply2(identicalPaths, path6) {
|
|
9723
|
-
const object = getDeep(plain, parsePath(path6));
|
|
9724
|
-
identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
|
|
9725
|
-
plain = setDeep(plain, identicalObjectPath, () => object);
|
|
9726
|
-
});
|
|
9727
|
-
}
|
|
9728
|
-
__name(apply2, "apply");
|
|
9729
|
-
if (isArray(annotations)) {
|
|
9730
|
-
const [root, other] = annotations;
|
|
9731
|
-
root.forEach((identicalPath) => {
|
|
9732
|
-
plain = setDeep(plain, parsePath(identicalPath), () => plain);
|
|
9733
|
-
});
|
|
9734
|
-
if (other) {
|
|
9735
|
-
forEach(other, apply2);
|
|
9736
|
-
}
|
|
9737
|
-
} else {
|
|
9738
|
-
forEach(annotations, apply2);
|
|
9739
|
-
}
|
|
9740
|
-
return plain;
|
|
9741
|
-
}
|
|
9742
|
-
__name(applyReferentialEqualityAnnotations, "applyReferentialEqualityAnnotations");
|
|
9743
|
-
var isDeep = /* @__PURE__ */ __name((object, superJson) => isPlainObject3(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson), "isDeep");
|
|
9744
|
-
function addIdentity(object, path6, identities) {
|
|
9745
|
-
const existingSet = identities.get(object);
|
|
9746
|
-
if (existingSet) {
|
|
9747
|
-
existingSet.push(path6);
|
|
9748
|
-
} else {
|
|
9749
|
-
identities.set(object, [
|
|
9750
|
-
path6
|
|
9751
|
-
]);
|
|
9752
|
-
}
|
|
9753
|
-
}
|
|
9754
|
-
__name(addIdentity, "addIdentity");
|
|
9755
|
-
function generateReferentialEqualityAnnotations(identitites, dedupe) {
|
|
9756
|
-
const result = {};
|
|
9757
|
-
let rootEqualityPaths = void 0;
|
|
9758
|
-
identitites.forEach((paths) => {
|
|
9759
|
-
if (paths.length <= 1) {
|
|
9760
|
-
return;
|
|
9761
|
-
}
|
|
9762
|
-
if (!dedupe) {
|
|
9763
|
-
paths = paths.map((path6) => path6.map(String)).sort((a, b) => a.length - b.length);
|
|
9764
|
-
}
|
|
9765
|
-
const [representativePath, ...identicalPaths] = paths;
|
|
9766
|
-
if (representativePath.length === 0) {
|
|
9767
|
-
rootEqualityPaths = identicalPaths.map(stringifyPath);
|
|
9768
|
-
} else {
|
|
9769
|
-
result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
|
|
9770
|
-
}
|
|
9771
|
-
});
|
|
9772
|
-
if (rootEqualityPaths) {
|
|
9773
|
-
if (isEmptyObject(result)) {
|
|
9774
|
-
return [
|
|
9775
|
-
rootEqualityPaths
|
|
9776
|
-
];
|
|
9777
|
-
} else {
|
|
9778
|
-
return [
|
|
9779
|
-
rootEqualityPaths,
|
|
9780
|
-
result
|
|
9781
|
-
];
|
|
9782
|
-
}
|
|
9783
|
-
} else {
|
|
9784
|
-
return isEmptyObject(result) ? void 0 : result;
|
|
9785
|
-
}
|
|
9786
|
-
}
|
|
9787
|
-
__name(generateReferentialEqualityAnnotations, "generateReferentialEqualityAnnotations");
|
|
9788
|
-
var walker = /* @__PURE__ */ __name((object, identities, superJson, dedupe, path6 = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
|
|
9789
|
-
const primitive = isPrimitive(object);
|
|
9790
|
-
if (!primitive) {
|
|
9791
|
-
addIdentity(object, path6, identities);
|
|
9792
|
-
const seen = seenObjects.get(object);
|
|
9793
|
-
if (seen) {
|
|
9794
|
-
return dedupe ? {
|
|
9795
|
-
transformedValue: null
|
|
9796
|
-
} : seen;
|
|
9797
|
-
}
|
|
9798
|
-
}
|
|
9799
|
-
if (!isDeep(object, superJson)) {
|
|
9800
|
-
const transformed2 = transformValue(object, superJson);
|
|
9801
|
-
const result2 = transformed2 ? {
|
|
9802
|
-
transformedValue: transformed2.value,
|
|
9803
|
-
annotations: [
|
|
9804
|
-
transformed2.type
|
|
9805
|
-
]
|
|
9806
|
-
} : {
|
|
9807
|
-
transformedValue: object
|
|
9808
|
-
};
|
|
9809
|
-
if (!primitive) {
|
|
9810
|
-
seenObjects.set(object, result2);
|
|
9811
|
-
}
|
|
9812
|
-
return result2;
|
|
9813
|
-
}
|
|
9814
|
-
if (includes2(objectsInThisPath, object)) {
|
|
9815
|
-
return {
|
|
9816
|
-
transformedValue: null
|
|
9817
|
-
};
|
|
9818
|
-
}
|
|
9819
|
-
const transformationResult = transformValue(object, superJson);
|
|
9820
|
-
const transformed = transformationResult?.value ?? object;
|
|
9821
|
-
const transformedValue = isArray(transformed) ? [] : {};
|
|
9822
|
-
const innerAnnotations = {};
|
|
9823
|
-
forEach(transformed, (value, index) => {
|
|
9824
|
-
if (index === "__proto__" || index === "constructor" || index === "prototype") {
|
|
9825
|
-
throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
|
|
9826
|
-
}
|
|
9827
|
-
const recursiveResult = walker(value, identities, superJson, dedupe, [
|
|
9828
|
-
...path6,
|
|
9829
|
-
index
|
|
9830
|
-
], [
|
|
9831
|
-
...objectsInThisPath,
|
|
9832
|
-
object
|
|
9833
|
-
], seenObjects);
|
|
9834
|
-
transformedValue[index] = recursiveResult.transformedValue;
|
|
9835
|
-
if (isArray(recursiveResult.annotations)) {
|
|
9836
|
-
innerAnnotations[index] = recursiveResult.annotations;
|
|
9837
|
-
} else if (isPlainObject3(recursiveResult.annotations)) {
|
|
9838
|
-
forEach(recursiveResult.annotations, (tree, key) => {
|
|
9839
|
-
innerAnnotations[escapeKey(index) + "." + key] = tree;
|
|
9840
|
-
});
|
|
9841
|
-
}
|
|
9842
|
-
});
|
|
9843
|
-
const result = isEmptyObject(innerAnnotations) ? {
|
|
9844
|
-
transformedValue,
|
|
9845
|
-
annotations: !!transformationResult ? [
|
|
9846
|
-
transformationResult.type
|
|
9847
|
-
] : void 0
|
|
9848
|
-
} : {
|
|
9849
|
-
transformedValue,
|
|
9850
|
-
annotations: !!transformationResult ? [
|
|
9851
|
-
transformationResult.type,
|
|
9852
|
-
innerAnnotations
|
|
9853
|
-
] : innerAnnotations
|
|
9854
|
-
};
|
|
9855
|
-
if (!primitive) {
|
|
9856
|
-
seenObjects.set(object, result);
|
|
9857
|
-
}
|
|
9858
|
-
return result;
|
|
9859
|
-
}, "walker");
|
|
9860
|
-
|
|
9861
|
-
// ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
|
|
9862
|
-
init_esm_shims();
|
|
9863
|
-
|
|
9864
|
-
// ../../node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.js
|
|
9865
|
-
init_esm_shims();
|
|
9866
|
-
function getType2(payload) {
|
|
9867
|
-
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
9868
|
-
}
|
|
9869
|
-
__name(getType2, "getType");
|
|
9870
|
-
function isArray2(payload) {
|
|
9871
|
-
return getType2(payload) === "Array";
|
|
9872
|
-
}
|
|
9873
|
-
__name(isArray2, "isArray");
|
|
9874
|
-
function isPlainObject4(payload) {
|
|
9875
|
-
if (getType2(payload) !== "Object") return false;
|
|
9876
|
-
const prototype = Object.getPrototypeOf(payload);
|
|
9877
|
-
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
|
9878
|
-
}
|
|
9879
|
-
__name(isPlainObject4, "isPlainObject");
|
|
9880
|
-
function isNull2(payload) {
|
|
9881
|
-
return getType2(payload) === "Null";
|
|
9882
|
-
}
|
|
9883
|
-
__name(isNull2, "isNull");
|
|
9884
|
-
function isOneOf(a, b, c, d2, e) {
|
|
9885
|
-
return (value) => a(value) || b(value) || !!c && c(value) || !!d2 && d2(value) || !!e && e(value);
|
|
9886
|
-
}
|
|
9887
|
-
__name(isOneOf, "isOneOf");
|
|
9888
|
-
function isUndefined2(payload) {
|
|
9889
|
-
return getType2(payload) === "Undefined";
|
|
9890
|
-
}
|
|
9891
|
-
__name(isUndefined2, "isUndefined");
|
|
9892
|
-
var isNullOrUndefined = isOneOf(isNull2, isUndefined2);
|
|
9893
|
-
|
|
9894
|
-
// ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
|
|
9895
|
-
function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
|
|
9896
|
-
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
9897
|
-
if (propType === "enumerable") carry[key] = newVal;
|
|
9898
|
-
if (includeNonenumerable && propType === "nonenumerable") {
|
|
9899
|
-
Object.defineProperty(carry, key, {
|
|
9900
|
-
value: newVal,
|
|
9901
|
-
enumerable: false,
|
|
9902
|
-
writable: true,
|
|
9903
|
-
configurable: true
|
|
9904
|
-
});
|
|
9905
|
-
}
|
|
9906
|
-
}
|
|
9907
|
-
__name(assignProp, "assignProp");
|
|
9908
|
-
function copy(target, options = {}) {
|
|
9909
|
-
if (isArray2(target)) {
|
|
9910
|
-
return target.map((item) => copy(item, options));
|
|
9911
|
-
}
|
|
9912
|
-
if (!isPlainObject4(target)) {
|
|
9913
|
-
return target;
|
|
9914
|
-
}
|
|
9915
|
-
const props = Object.getOwnPropertyNames(target);
|
|
9916
|
-
const symbols = Object.getOwnPropertySymbols(target);
|
|
9917
|
-
return [
|
|
9918
|
-
...props,
|
|
9919
|
-
...symbols
|
|
9920
|
-
].reduce((carry, key) => {
|
|
9921
|
-
if (isArray2(options.props) && !options.props.includes(key)) {
|
|
9922
|
-
return carry;
|
|
9923
|
-
}
|
|
9924
|
-
const val = target[key];
|
|
9925
|
-
const newVal = copy(val, options);
|
|
9926
|
-
assignProp(carry, key, newVal, target, options.nonenumerable);
|
|
9927
|
-
return carry;
|
|
9928
|
-
}, {});
|
|
9929
|
-
}
|
|
9930
|
-
__name(copy, "copy");
|
|
9931
|
-
|
|
9932
|
-
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js
|
|
9933
|
-
var SuperJSON = class {
|
|
9934
|
-
static {
|
|
9935
|
-
__name(this, "SuperJSON");
|
|
9936
|
-
}
|
|
9937
|
-
/**
|
|
9938
|
-
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
9939
|
-
*/
|
|
9940
|
-
constructor({ dedupe = false } = {}) {
|
|
9941
|
-
this.classRegistry = new ClassRegistry();
|
|
9942
|
-
this.symbolRegistry = new Registry((s) => s.description ?? "");
|
|
9943
|
-
this.customTransformerRegistry = new CustomTransformerRegistry();
|
|
9944
|
-
this.allowedErrorProps = [];
|
|
9945
|
-
this.dedupe = dedupe;
|
|
9946
|
-
}
|
|
9947
|
-
serialize(object) {
|
|
9948
|
-
const identities = /* @__PURE__ */ new Map();
|
|
9949
|
-
const output = walker(object, identities, this, this.dedupe);
|
|
9950
|
-
const res = {
|
|
9951
|
-
json: output.transformedValue
|
|
9952
|
-
};
|
|
9953
|
-
if (output.annotations) {
|
|
9954
|
-
res.meta = {
|
|
9955
|
-
...res.meta,
|
|
9956
|
-
values: output.annotations
|
|
9957
|
-
};
|
|
9958
|
-
}
|
|
9959
|
-
const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
|
|
9960
|
-
if (equalityAnnotations) {
|
|
9961
|
-
res.meta = {
|
|
9962
|
-
...res.meta,
|
|
9963
|
-
referentialEqualities: equalityAnnotations
|
|
9964
|
-
};
|
|
9965
|
-
}
|
|
9966
|
-
return res;
|
|
9967
|
-
}
|
|
9968
|
-
deserialize(payload) {
|
|
9969
|
-
const { json, meta } = payload;
|
|
9970
|
-
let result = copy(json);
|
|
9971
|
-
if (meta?.values) {
|
|
9972
|
-
result = applyValueAnnotations(result, meta.values, this);
|
|
9973
|
-
}
|
|
9974
|
-
if (meta?.referentialEqualities) {
|
|
9975
|
-
result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
|
|
9976
|
-
}
|
|
9977
|
-
return result;
|
|
9978
|
-
}
|
|
9979
|
-
stringify(object) {
|
|
9980
|
-
return JSON.stringify(this.serialize(object));
|
|
9981
|
-
}
|
|
9982
|
-
parse(string) {
|
|
9983
|
-
return this.deserialize(JSON.parse(string));
|
|
9984
|
-
}
|
|
9985
|
-
registerClass(v, options) {
|
|
9986
|
-
this.classRegistry.register(v, options);
|
|
9987
|
-
}
|
|
9988
|
-
registerSymbol(v, identifier) {
|
|
9989
|
-
this.symbolRegistry.register(v, identifier);
|
|
9990
|
-
}
|
|
9991
|
-
registerCustom(transformer, name) {
|
|
9992
|
-
this.customTransformerRegistry.register({
|
|
9993
|
-
name,
|
|
9994
|
-
...transformer
|
|
9995
|
-
});
|
|
9996
|
-
}
|
|
9997
|
-
allowErrorProps(...props) {
|
|
9998
|
-
this.allowedErrorProps.push(...props);
|
|
9999
|
-
}
|
|
10000
|
-
};
|
|
10001
|
-
SuperJSON.defaultInstance = new SuperJSON();
|
|
10002
|
-
SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
|
|
10003
|
-
SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
|
|
10004
|
-
SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
|
|
10005
|
-
SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
|
|
10006
|
-
SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
|
|
10007
|
-
SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
|
|
10008
|
-
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
|
10009
|
-
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
10010
|
-
var serialize = SuperJSON.serialize;
|
|
10011
|
-
var deserialize = SuperJSON.deserialize;
|
|
10012
|
-
var stringify = SuperJSON.stringify;
|
|
10013
|
-
var parse3 = SuperJSON.parse;
|
|
10014
|
-
var registerClass = SuperJSON.registerClass;
|
|
10015
|
-
var registerCustom = SuperJSON.registerCustom;
|
|
10016
|
-
var registerSymbol = SuperJSON.registerSymbol;
|
|
10017
|
-
var allowErrorProps = SuperJSON.allowErrorProps;
|
|
10018
|
-
|
|
10019
|
-
// ../json/src/utils/parse.ts
|
|
10020
|
-
init_esm_shims();
|
|
10021
|
-
|
|
10022
|
-
// ../json/src/utils/strip-comments.ts
|
|
10023
|
-
init_esm_shims();
|
|
10024
|
-
var singleComment = Symbol("singleComment");
|
|
10025
|
-
var multiComment = Symbol("multiComment");
|
|
10026
|
-
function stripWithoutWhitespace() {
|
|
10027
|
-
return "";
|
|
10028
|
-
}
|
|
10029
|
-
__name(stripWithoutWhitespace, "stripWithoutWhitespace");
|
|
10030
|
-
function stripWithWhitespace(value, start, end) {
|
|
10031
|
-
return value.slice(start, end).replace(/\S/g, " ");
|
|
10032
|
-
}
|
|
10033
|
-
__name(stripWithWhitespace, "stripWithWhitespace");
|
|
10034
|
-
function isEscaped(value, quotePosition) {
|
|
10035
|
-
let index = quotePosition - 1;
|
|
10036
|
-
let backslashCount = 0;
|
|
10037
|
-
while (value[index] === "\\") {
|
|
10038
|
-
index -= 1;
|
|
10039
|
-
backslashCount += 1;
|
|
10040
|
-
}
|
|
10041
|
-
return Boolean(backslashCount % 2);
|
|
10042
|
-
}
|
|
10043
|
-
__name(isEscaped, "isEscaped");
|
|
10044
|
-
function stripComments2(value, { whitespace = true, trailingCommas = false } = {}) {
|
|
10045
|
-
if (typeof value !== "string") {
|
|
10046
|
-
throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof value}\``);
|
|
10047
|
-
}
|
|
10048
|
-
const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
|
|
10049
|
-
let isInsideString = false;
|
|
10050
|
-
let isInsideComment = false;
|
|
10051
|
-
let offset = 0;
|
|
10052
|
-
let buffer = "";
|
|
10053
|
-
let result = "";
|
|
10054
|
-
let commaIndex = -1;
|
|
10055
|
-
for (let index = 0; index < value.length; index++) {
|
|
10056
|
-
const currentCharacter = value[index];
|
|
10057
|
-
const nextCharacter = value[index + 1];
|
|
10058
|
-
if (!isInsideComment && currentCharacter === '"') {
|
|
10059
|
-
const escaped = isEscaped(value, index);
|
|
10060
|
-
if (!escaped) {
|
|
10061
|
-
isInsideString = !isInsideString;
|
|
10062
|
-
}
|
|
10063
|
-
}
|
|
10064
|
-
if (isInsideString) {
|
|
10065
|
-
continue;
|
|
10066
|
-
}
|
|
10067
|
-
if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "//") {
|
|
10068
|
-
buffer += value.slice(offset, index);
|
|
10069
|
-
offset = index;
|
|
10070
|
-
isInsideComment = singleComment;
|
|
10071
|
-
index++;
|
|
10072
|
-
} else if (isInsideComment === singleComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "\r\n") {
|
|
10073
|
-
index++;
|
|
10074
|
-
isInsideComment = false;
|
|
10075
|
-
buffer += strip(value, offset, index);
|
|
10076
|
-
offset = index;
|
|
10077
|
-
} else if (isInsideComment === singleComment && currentCharacter === "\n") {
|
|
10078
|
-
isInsideComment = false;
|
|
10079
|
-
buffer += strip(value, offset, index);
|
|
10080
|
-
offset = index;
|
|
10081
|
-
} else if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "/*") {
|
|
10082
|
-
buffer += value.slice(offset, index);
|
|
10083
|
-
offset = index;
|
|
10084
|
-
isInsideComment = multiComment;
|
|
10085
|
-
index++;
|
|
10086
|
-
} else if (isInsideComment === multiComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "*/") {
|
|
10087
|
-
index++;
|
|
10088
|
-
isInsideComment = false;
|
|
10089
|
-
buffer += strip(value, offset, index + 1);
|
|
10090
|
-
offset = index + 1;
|
|
10091
|
-
} else if (trailingCommas && !isInsideComment) {
|
|
10092
|
-
if (commaIndex !== -1) {
|
|
10093
|
-
if (currentCharacter === "}" || currentCharacter === "]") {
|
|
10094
|
-
buffer += value.slice(offset, index);
|
|
10095
|
-
result += strip(buffer, 0, 1) + buffer.slice(1);
|
|
10096
|
-
buffer = "";
|
|
10097
|
-
offset = index;
|
|
10098
|
-
commaIndex = -1;
|
|
10099
|
-
} else if (currentCharacter !== " " && currentCharacter !== " " && currentCharacter !== "\r" && currentCharacter !== "\n") {
|
|
10100
|
-
buffer += value.slice(offset, index);
|
|
10101
|
-
offset = index;
|
|
10102
|
-
commaIndex = -1;
|
|
10103
|
-
}
|
|
10104
|
-
} else if (currentCharacter === ",") {
|
|
10105
|
-
result += buffer + value.slice(offset, index);
|
|
10106
|
-
buffer = "";
|
|
10107
|
-
offset = index;
|
|
10108
|
-
commaIndex = index;
|
|
10109
|
-
}
|
|
10110
|
-
}
|
|
10111
|
-
}
|
|
10112
|
-
return result + buffer + (isInsideComment ? strip(value.slice(offset)) : value.slice(offset));
|
|
10113
|
-
}
|
|
10114
|
-
__name(stripComments2, "stripComments");
|
|
10115
|
-
|
|
10116
|
-
// ../json/src/utils/parse.ts
|
|
10117
|
-
var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
10118
|
-
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
10119
|
-
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
|
|
10120
|
-
function jsonParseTransform(key, value) {
|
|
10121
|
-
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
10122
|
-
console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
|
|
10123
|
-
return;
|
|
10124
|
-
}
|
|
10125
|
-
return value;
|
|
10126
|
-
}
|
|
10127
|
-
__name(jsonParseTransform, "jsonParseTransform");
|
|
10128
|
-
function parse4(value, options = {}) {
|
|
10129
|
-
if (typeof value !== "string") {
|
|
10130
|
-
return value;
|
|
10131
|
-
}
|
|
10132
|
-
let stripped = stripComments2(value);
|
|
10133
|
-
if (stripped[0] === '"' && stripped[stripped.length - 1] === '"' && !stripped.includes("\\")) {
|
|
10134
|
-
return stripped.slice(1, -1);
|
|
10135
|
-
}
|
|
10136
|
-
stripped = stripped.trim();
|
|
10137
|
-
if (stripped.length <= 9) {
|
|
10138
|
-
switch (stripped.toLowerCase()) {
|
|
10139
|
-
case "true": {
|
|
10140
|
-
return true;
|
|
10141
|
-
}
|
|
10142
|
-
case "false": {
|
|
10143
|
-
return false;
|
|
10144
|
-
}
|
|
10145
|
-
case "undefined": {
|
|
10146
|
-
return void 0;
|
|
10147
|
-
}
|
|
10148
|
-
case "null": {
|
|
10149
|
-
return null;
|
|
10150
|
-
}
|
|
10151
|
-
case "nan": {
|
|
10152
|
-
return Number.NaN;
|
|
10153
|
-
}
|
|
10154
|
-
case "infinity": {
|
|
10155
|
-
return Number.POSITIVE_INFINITY;
|
|
10156
|
-
}
|
|
10157
|
-
case "-infinity": {
|
|
10158
|
-
return Number.NEGATIVE_INFINITY;
|
|
10159
|
-
}
|
|
10160
|
-
}
|
|
10161
|
-
}
|
|
10162
|
-
if (!JsonSigRx.test(stripped)) {
|
|
10163
|
-
if (options.strict) {
|
|
10164
|
-
throw new Error("Invalid JSON");
|
|
10165
|
-
}
|
|
10166
|
-
return stripped;
|
|
10167
|
-
}
|
|
10168
|
-
try {
|
|
10169
|
-
if (suspectProtoRx.test(stripped) || suspectConstructorRx.test(stripped)) {
|
|
10170
|
-
if (options.strict) {
|
|
10171
|
-
throw new Error("Possible prototype pollution");
|
|
10172
|
-
}
|
|
10173
|
-
return JSON.parse(stripped, jsonParseTransform);
|
|
10174
|
-
}
|
|
10175
|
-
return JSON.parse(stripped);
|
|
10176
|
-
} catch (error) {
|
|
10177
|
-
if (options.strict) {
|
|
10178
|
-
throw error;
|
|
10179
|
-
}
|
|
10180
|
-
return value;
|
|
10181
|
-
}
|
|
10182
|
-
}
|
|
10183
|
-
__name(parse4, "parse");
|
|
10184
|
-
|
|
10185
|
-
// ../json/src/utils/parse-error.ts
|
|
10186
|
-
init_esm_shims();
|
|
10187
|
-
|
|
10188
|
-
// ../../node_modules/.pnpm/lines-and-columns@2.0.4/node_modules/lines-and-columns/build/index.mjs
|
|
10189
|
-
init_esm_shims();
|
|
10190
|
-
var LF = "\n";
|
|
10191
|
-
var CR = "\r";
|
|
10192
|
-
var LinesAndColumns = (
|
|
10193
|
-
/** @class */
|
|
10194
|
-
function() {
|
|
10195
|
-
function LinesAndColumns2(string) {
|
|
10196
|
-
this.length = string.length;
|
|
10197
|
-
var offsets = [0];
|
|
10198
|
-
for (var offset = 0; offset < string.length; ) {
|
|
10199
|
-
switch (string[offset]) {
|
|
10200
|
-
case LF:
|
|
10201
|
-
offset += LF.length;
|
|
10202
|
-
offsets.push(offset);
|
|
10203
|
-
break;
|
|
10204
|
-
case CR:
|
|
10205
|
-
offset += CR.length;
|
|
10206
|
-
if (string[offset] === LF) {
|
|
10207
|
-
offset += LF.length;
|
|
10208
|
-
}
|
|
10209
|
-
offsets.push(offset);
|
|
10210
|
-
break;
|
|
10211
|
-
default:
|
|
10212
|
-
offset++;
|
|
10213
|
-
break;
|
|
10214
|
-
}
|
|
10215
|
-
}
|
|
10216
|
-
this.offsets = offsets;
|
|
10217
|
-
}
|
|
10218
|
-
__name(LinesAndColumns2, "LinesAndColumns");
|
|
10219
|
-
LinesAndColumns2.prototype.locationForIndex = function(index) {
|
|
10220
|
-
if (index < 0 || index > this.length) {
|
|
10221
|
-
return null;
|
|
10222
|
-
}
|
|
10223
|
-
var line = 0;
|
|
10224
|
-
var offsets = this.offsets;
|
|
10225
|
-
while (offsets[line + 1] <= index) {
|
|
10226
|
-
line++;
|
|
10227
|
-
}
|
|
10228
|
-
var column = index - offsets[line];
|
|
10229
|
-
return { line, column };
|
|
10230
|
-
};
|
|
10231
|
-
LinesAndColumns2.prototype.indexForLocation = function(location) {
|
|
10232
|
-
var line = location.line, column = location.column;
|
|
10233
|
-
if (line < 0 || line >= this.offsets.length) {
|
|
10234
|
-
return null;
|
|
10235
|
-
}
|
|
10236
|
-
if (column < 0 || column > this.lengthOfLine(line)) {
|
|
10237
|
-
return null;
|
|
10238
|
-
}
|
|
10239
|
-
return this.offsets[line] + column;
|
|
10240
|
-
};
|
|
10241
|
-
LinesAndColumns2.prototype.lengthOfLine = function(line) {
|
|
10242
|
-
var offset = this.offsets[line];
|
|
10243
|
-
var nextOffset = line === this.offsets.length - 1 ? this.length : this.offsets[line + 1];
|
|
10244
|
-
return nextOffset - offset;
|
|
10245
|
-
};
|
|
10246
|
-
return LinesAndColumns2;
|
|
10247
|
-
}()
|
|
10248
|
-
);
|
|
10249
|
-
|
|
10250
|
-
// ../json/src/utils/code-frames.ts
|
|
10251
|
-
init_esm_shims();
|
|
10252
|
-
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
10253
|
-
function getMarkerLines(loc, source, opts = {}) {
|
|
10254
|
-
const startLoc = {
|
|
10255
|
-
column: 0,
|
|
10256
|
-
line: -1,
|
|
10257
|
-
...loc.start
|
|
10258
|
-
};
|
|
10259
|
-
const endLoc = {
|
|
10260
|
-
...startLoc,
|
|
10261
|
-
...loc.end
|
|
10262
|
-
};
|
|
10263
|
-
const { linesAbove = 2, linesBelow = 3 } = opts || {};
|
|
10264
|
-
const startLine = startLoc.line;
|
|
10265
|
-
const startColumn = startLoc.column;
|
|
10266
|
-
const endLine = endLoc.line;
|
|
10267
|
-
const endColumn = endLoc.column;
|
|
10268
|
-
let start = Math.max(startLine - (linesAbove + 1), 0);
|
|
10269
|
-
let end = Math.min(source.length, endLine + linesBelow);
|
|
10270
|
-
if (startLine === -1) {
|
|
10271
|
-
start = 0;
|
|
10272
|
-
}
|
|
10273
|
-
if (endLine === -1) {
|
|
10274
|
-
end = source.length;
|
|
10275
|
-
}
|
|
10276
|
-
const lineDiff = endLine - startLine;
|
|
10277
|
-
const markerLines = {};
|
|
10278
|
-
if (lineDiff) {
|
|
10279
|
-
for (let i = 0; i <= lineDiff; i++) {
|
|
10280
|
-
const lineNumber = i + startLine;
|
|
10281
|
-
if (!startColumn) {
|
|
10282
|
-
markerLines[lineNumber] = true;
|
|
10283
|
-
} else if (i === 0) {
|
|
10284
|
-
const sourceLength = source[lineNumber - 1]?.length ?? 0;
|
|
10285
|
-
markerLines[lineNumber] = [
|
|
10286
|
-
startColumn,
|
|
10287
|
-
sourceLength - startColumn + 1
|
|
10288
|
-
];
|
|
10289
|
-
} else if (i === lineDiff) {
|
|
10290
|
-
markerLines[lineNumber] = [
|
|
10291
|
-
0,
|
|
10292
|
-
endColumn
|
|
10293
|
-
];
|
|
10294
|
-
} else {
|
|
10295
|
-
const sourceLength = source[lineNumber - i]?.length ?? 0;
|
|
10296
|
-
markerLines[lineNumber] = [
|
|
10297
|
-
0,
|
|
10298
|
-
sourceLength
|
|
10299
|
-
];
|
|
10300
|
-
}
|
|
10301
|
-
}
|
|
10302
|
-
} else if (startColumn === endColumn) {
|
|
10303
|
-
markerLines[startLine] = startColumn ? [
|
|
10304
|
-
startColumn,
|
|
10305
|
-
0
|
|
10306
|
-
] : true;
|
|
10307
|
-
} else {
|
|
10308
|
-
markerLines[startLine] = [
|
|
10309
|
-
startColumn,
|
|
10310
|
-
endColumn - startColumn
|
|
10311
|
-
];
|
|
10312
|
-
}
|
|
10313
|
-
return {
|
|
10314
|
-
start,
|
|
10315
|
-
end,
|
|
10316
|
-
markerLines
|
|
10317
|
-
};
|
|
10318
|
-
}
|
|
10319
|
-
__name(getMarkerLines, "getMarkerLines");
|
|
10320
|
-
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
10321
|
-
const lines = rawLines.split(NEWLINE);
|
|
10322
|
-
const { start, end, markerLines } = getMarkerLines(loc, lines, opts);
|
|
10323
|
-
const numberMaxWidth = String(end).length;
|
|
10324
|
-
const highlightedLines = opts.highlight ? opts.highlight(rawLines) : rawLines;
|
|
10325
|
-
const frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
|
|
10326
|
-
const number = start + 1 + index;
|
|
10327
|
-
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
|
10328
|
-
const gutter = ` ${paddedNumber} | `;
|
|
10329
|
-
const hasMarker = Boolean(markerLines[number] ?? false);
|
|
10330
|
-
if (hasMarker) {
|
|
10331
|
-
let markerLine = "";
|
|
10332
|
-
if (Array.isArray(hasMarker)) {
|
|
10333
|
-
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
|
10334
|
-
const numberOfMarkers = hasMarker[1] || 1;
|
|
10335
|
-
markerLine = [
|
|
10336
|
-
"\n ",
|
|
10337
|
-
gutter.replace(/\d/g, " "),
|
|
10338
|
-
markerSpacing,
|
|
10339
|
-
"^".repeat(numberOfMarkers)
|
|
10340
|
-
].join("");
|
|
10341
|
-
}
|
|
10342
|
-
return [
|
|
10343
|
-
">",
|
|
10344
|
-
gutter,
|
|
10345
|
-
line,
|
|
10346
|
-
markerLine
|
|
10347
|
-
].join("");
|
|
10348
|
-
}
|
|
10349
|
-
return ` ${gutter}${line}`;
|
|
10350
|
-
}).join("\n");
|
|
10351
|
-
return frame;
|
|
10352
|
-
}
|
|
10353
|
-
__name(codeFrameColumns, "codeFrameColumns");
|
|
10354
|
-
|
|
10355
|
-
// ../json/src/utils/parse-error.ts
|
|
10356
|
-
function formatParseError(input, parseError) {
|
|
10357
|
-
const { error, offset, length } = parseError;
|
|
10358
|
-
const result = new LinesAndColumns(input).locationForIndex(offset);
|
|
10359
|
-
let line = result?.line ?? 0;
|
|
10360
|
-
let column = result?.column ?? 0;
|
|
10361
|
-
line++;
|
|
10362
|
-
column++;
|
|
10363
|
-
return `${printParseErrorCode(error)} in JSON at ${line}:${column}
|
|
10364
|
-
${codeFrameColumns(input, {
|
|
10365
|
-
start: {
|
|
10366
|
-
line,
|
|
10367
|
-
column
|
|
10368
|
-
},
|
|
10369
|
-
end: {
|
|
10370
|
-
line,
|
|
10371
|
-
column: column + length
|
|
10372
|
-
}
|
|
10373
|
-
})}
|
|
10374
|
-
`;
|
|
10375
|
-
}
|
|
10376
|
-
__name(formatParseError, "formatParseError");
|
|
10377
|
-
|
|
10378
|
-
// ../json/src/utils/stringify.ts
|
|
10379
|
-
init_esm_shims();
|
|
10380
|
-
|
|
10381
|
-
// ../type-checks/src/is-number.ts
|
|
10382
|
-
init_esm_shims();
|
|
10383
|
-
var isNumber3 = /* @__PURE__ */ __name((value) => {
|
|
10384
|
-
try {
|
|
10385
|
-
return value instanceof Number || typeof value === "number" || Number(value) === value;
|
|
10386
|
-
} catch {
|
|
10387
|
-
return false;
|
|
10388
|
-
}
|
|
10389
|
-
}, "isNumber");
|
|
10390
|
-
|
|
10391
|
-
// ../type-checks/src/is-undefined.ts
|
|
10392
|
-
init_esm_shims();
|
|
10393
|
-
var isUndefined3 = /* @__PURE__ */ __name((value) => {
|
|
10394
|
-
return value === void 0;
|
|
10395
|
-
}, "isUndefined");
|
|
10396
|
-
|
|
10397
|
-
// ../json/src/utils/stringify.ts
|
|
10398
|
-
var invalidKeyChars = [
|
|
10399
|
-
"@",
|
|
10400
|
-
"/",
|
|
10401
|
-
"#",
|
|
10402
|
-
"$",
|
|
10403
|
-
" ",
|
|
10404
|
-
":",
|
|
10405
|
-
";",
|
|
10406
|
-
",",
|
|
10407
|
-
".",
|
|
10408
|
-
"!",
|
|
10409
|
-
"?",
|
|
10410
|
-
"&",
|
|
10411
|
-
"=",
|
|
10412
|
-
"+",
|
|
10413
|
-
"-",
|
|
10414
|
-
"*",
|
|
10415
|
-
"%",
|
|
10416
|
-
"^",
|
|
10417
|
-
"~",
|
|
10418
|
-
"|",
|
|
10419
|
-
"\\",
|
|
10420
|
-
'"',
|
|
10421
|
-
"'",
|
|
10422
|
-
"`",
|
|
10423
|
-
"{",
|
|
10424
|
-
"}",
|
|
10425
|
-
"[",
|
|
10426
|
-
"]",
|
|
10427
|
-
"(",
|
|
10428
|
-
")",
|
|
10429
|
-
"<",
|
|
10430
|
-
">"
|
|
10431
|
-
];
|
|
10432
|
-
var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
10433
|
-
const space = isNumber3(spacing) ? " ".repeat(spacing) : spacing;
|
|
10434
|
-
switch (value) {
|
|
10435
|
-
case null: {
|
|
10436
|
-
return "null";
|
|
10437
|
-
}
|
|
10438
|
-
case void 0: {
|
|
10439
|
-
return '"undefined"';
|
|
10440
|
-
}
|
|
10441
|
-
case true: {
|
|
10442
|
-
return "true";
|
|
10443
|
-
}
|
|
10444
|
-
case false: {
|
|
10445
|
-
return "false";
|
|
10446
|
-
}
|
|
10447
|
-
case Number.POSITIVE_INFINITY: {
|
|
10448
|
-
return "infinity";
|
|
10449
|
-
}
|
|
10450
|
-
case Number.NEGATIVE_INFINITY: {
|
|
10451
|
-
return "-infinity";
|
|
10452
|
-
}
|
|
10453
|
-
}
|
|
10454
|
-
if (Array.isArray(value)) {
|
|
10455
|
-
return `[${space}${value.map((v) => stringify2(v, space)).join(`,${space}`)}${space}]`;
|
|
10456
|
-
}
|
|
10457
|
-
if (value instanceof Uint8Array) {
|
|
10458
|
-
return value.toString();
|
|
10459
|
-
}
|
|
10460
|
-
switch (typeof value) {
|
|
10461
|
-
case "number": {
|
|
10462
|
-
return `${value}`;
|
|
10463
|
-
}
|
|
10464
|
-
case "string": {
|
|
10465
|
-
return JSON.stringify(value);
|
|
10466
|
-
}
|
|
10467
|
-
case "object": {
|
|
10468
|
-
const keys2 = Object.keys(value).filter((key) => !isUndefined3(value[key]));
|
|
10469
|
-
return `{${space}${keys2.map((key) => `${invalidKeyChars.some((invalidKeyChar) => key.includes(invalidKeyChar)) ? `"${key}"` : key}: ${space}${stringify2(value[key], space)}`).join(`,${space}`)}${space}}`;
|
|
10470
|
-
}
|
|
10471
|
-
default:
|
|
10472
|
-
return "null";
|
|
10473
|
-
}
|
|
10474
|
-
}, "stringify");
|
|
10475
|
-
|
|
10476
|
-
// ../json/src/storm-json.ts
|
|
10477
|
-
var StormJSON = class _StormJSON extends SuperJSON {
|
|
10478
|
-
static {
|
|
10479
|
-
__name(this, "StormJSON");
|
|
10480
|
-
}
|
|
10481
|
-
static #instance;
|
|
10482
|
-
static get instance() {
|
|
10483
|
-
if (!_StormJSON.#instance) {
|
|
10484
|
-
_StormJSON.#instance = new _StormJSON();
|
|
10485
|
-
}
|
|
10486
|
-
return _StormJSON.#instance;
|
|
10487
|
-
}
|
|
10488
|
-
/**
|
|
10489
|
-
* Deserialize the given value with superjson using the given metadata
|
|
10490
|
-
*/
|
|
10491
|
-
static deserialize(payload) {
|
|
10492
|
-
return _StormJSON.instance.deserialize(payload);
|
|
10493
|
-
}
|
|
10494
|
-
/**
|
|
10495
|
-
* Serialize the given value with superjson
|
|
10496
|
-
*/
|
|
10497
|
-
static serialize(object) {
|
|
10498
|
-
return _StormJSON.instance.serialize(object);
|
|
10499
|
-
}
|
|
10500
|
-
/**
|
|
10501
|
-
* Parse the given string value with superjson using the given metadata
|
|
10502
|
-
*
|
|
10503
|
-
* @param value - The string value to parse
|
|
10504
|
-
* @returns The parsed data
|
|
10505
|
-
*/
|
|
10506
|
-
static parse(value) {
|
|
10507
|
-
return parse4(value);
|
|
10508
|
-
}
|
|
10509
|
-
/**
|
|
10510
|
-
* Serializes the given data to a JSON string.
|
|
10511
|
-
* By default the JSON string is formatted with a 2 space indentation to be easy readable.
|
|
10512
|
-
*
|
|
10513
|
-
* @param value - Object which should be serialized to JSON
|
|
10514
|
-
* @param _options - JSON serialize options
|
|
10515
|
-
* @returns the formatted JSON representation of the object
|
|
10516
|
-
*/
|
|
10517
|
-
static stringify(value, _options) {
|
|
10518
|
-
const customTransformer = _StormJSON.instance.customTransformerRegistry.findApplicable(value);
|
|
10519
|
-
let result = value;
|
|
10520
|
-
if (customTransformer && customTransformer.isApplicable(value)) {
|
|
10521
|
-
result = customTransformer.serialize(result);
|
|
10522
|
-
}
|
|
10523
|
-
return stringify2(result);
|
|
10524
|
-
}
|
|
10525
|
-
/**
|
|
10526
|
-
* Parses the given JSON string and returns the object the JSON content represents.
|
|
10527
|
-
* By default javascript-style comments and trailing commas are allowed.
|
|
10528
|
-
*
|
|
10529
|
-
* @param strData - JSON content as string
|
|
10530
|
-
* @param options - JSON parse options
|
|
10531
|
-
* @returns Object the JSON content represents
|
|
10532
|
-
*/
|
|
10533
|
-
static parseJson(strData, options) {
|
|
10534
|
-
try {
|
|
10535
|
-
if (options?.expectComments === false) {
|
|
10536
|
-
return _StormJSON.instance.parse(strData);
|
|
10537
|
-
}
|
|
10538
|
-
} catch {
|
|
10539
|
-
}
|
|
10540
|
-
const errors = [];
|
|
10541
|
-
const opts = {
|
|
10542
|
-
allowTrailingComma: true,
|
|
10543
|
-
...options
|
|
10544
|
-
};
|
|
10545
|
-
const result = parse2(strData, errors, opts);
|
|
10546
|
-
if (errors.length > 0 && errors[0]) {
|
|
10547
|
-
throw new Error(formatParseError(strData, errors[0]));
|
|
10548
|
-
}
|
|
10549
|
-
return result;
|
|
10550
|
-
}
|
|
10551
|
-
/**
|
|
10552
|
-
* Register a custom schema with superjson
|
|
10553
|
-
*
|
|
10554
|
-
* @param name - The name of the schema
|
|
10555
|
-
* @param serialize - The function to serialize the schema
|
|
10556
|
-
* @param deserialize - The function to deserialize the schema
|
|
10557
|
-
* @param isApplicable - The function to check if the schema is applicable
|
|
10558
|
-
*/
|
|
10559
|
-
static register(name, serialize2, deserialize2, isApplicable) {
|
|
10560
|
-
_StormJSON.instance.registerCustom({
|
|
10561
|
-
isApplicable,
|
|
10562
|
-
serialize: serialize2,
|
|
10563
|
-
deserialize: deserialize2
|
|
10564
|
-
}, name);
|
|
10565
|
-
}
|
|
10566
|
-
/**
|
|
10567
|
-
* Register a class with superjson
|
|
10568
|
-
*
|
|
10569
|
-
* @param classConstructor - The class constructor to register
|
|
10570
|
-
*/
|
|
10571
|
-
static registerClass(classConstructor, options) {
|
|
10572
|
-
_StormJSON.instance.registerClass(classConstructor, {
|
|
10573
|
-
identifier: isString2(options) ? options : options?.identifier || classConstructor.name,
|
|
10574
|
-
allowProps: options && isObject(options) && options?.allowProps && Array.isArray(options.allowProps) ? options.allowProps : [
|
|
10575
|
-
"__typename"
|
|
10576
|
-
]
|
|
10577
|
-
});
|
|
10578
|
-
}
|
|
10579
|
-
constructor() {
|
|
10580
|
-
super({
|
|
10581
|
-
dedupe: true
|
|
10582
|
-
});
|
|
10583
|
-
}
|
|
10584
|
-
};
|
|
10585
|
-
StormJSON.instance.registerCustom({
|
|
10586
|
-
isApplicable: /* @__PURE__ */ __name((v) => Buffer2.isBuffer(v), "isApplicable"),
|
|
10587
|
-
serialize: /* @__PURE__ */ __name((v) => v.toString("base64"), "serialize"),
|
|
10588
|
-
deserialize: /* @__PURE__ */ __name((v) => Buffer2.from(v, "base64"), "deserialize")
|
|
10589
|
-
}, "Bytes");
|
|
10590
|
-
|
|
10591
|
-
// ../fs/src/write-file.ts
|
|
10592
|
-
init_defu();
|
|
10593
6694
|
import { writeFile as writeFileFs } from "node:fs/promises";
|
|
10594
6695
|
var writeFile = /* @__PURE__ */ __name(async (filePath, content = "", options = {}) => {
|
|
10595
6696
|
if (!filePath) {
|
|
@@ -10846,8 +6947,8 @@ function resolveMongoDbRawOperations(modelOperations) {
|
|
|
10846
6947
|
const rawOpsMap = {};
|
|
10847
6948
|
const rawOpsNames = [
|
|
10848
6949
|
...new Set(modelOperations.reduce((result, current) => {
|
|
10849
|
-
const
|
|
10850
|
-
|
|
6950
|
+
const keys = Object.keys(current);
|
|
6951
|
+
keys?.forEach((key) => {
|
|
10851
6952
|
if (key.includes("Raw")) {
|
|
10852
6953
|
result.push(key);
|
|
10853
6954
|
}
|
|
@@ -10993,8 +7094,8 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
|
|
|
10993
7094
|
} else if (inputType.type === "Bytes") {
|
|
10994
7095
|
result.push(this.wrapWithZodValidators("z.instanceof(Buffer)", field));
|
|
10995
7096
|
} else if (!inputType.type.endsWith("FieldRefInput")) {
|
|
10996
|
-
const
|
|
10997
|
-
if (inputType.namespace === "prisma" ||
|
|
7097
|
+
const isEnum = inputType.location === "enumTypes";
|
|
7098
|
+
if (inputType.namespace === "prisma" || isEnum) {
|
|
10998
7099
|
if (inputType.type !== this.name && typeof inputType.type === "string") {
|
|
10999
7100
|
this.addSchemaImport(inputType.type);
|
|
11000
7101
|
}
|
|
@@ -11038,12 +7139,12 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
|
|
|
11038
7139
|
this.schemaImports.add(name);
|
|
11039
7140
|
}
|
|
11040
7141
|
generatePrismaStringLine(field, inputType, inputsLength) {
|
|
11041
|
-
const
|
|
7142
|
+
const isEnum = inputType.location === "enumTypes";
|
|
11042
7143
|
const inputTypeString = inputType.type;
|
|
11043
7144
|
const { isModelQueryType, modelName, queryName } = this.checkIsModelQueryType(inputTypeString);
|
|
11044
7145
|
const objectSchemaLine = isModelQueryType ? this.resolveModelQuerySchemaName(modelName, queryName) : `${inputTypeString}ObjectSchema`;
|
|
11045
7146
|
const enumSchemaLine = `${inputTypeString}Schema`;
|
|
11046
|
-
const schema = inputType.type === this.name ? objectSchemaLine :
|
|
7147
|
+
const schema = inputType.type === this.name ? objectSchemaLine : isEnum ? enumSchemaLine : objectSchemaLine;
|
|
11047
7148
|
const arr = inputType.isList ? ".array()" : "";
|
|
11048
7149
|
const opt = !field.isRequired ? ".optional()" : "";
|
|
11049
7150
|
return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}`;
|
|
@@ -12019,29 +8120,3 @@ getPrismaGeneratorHelper().then((helpers) => {
|
|
|
12019
8120
|
}).catch((reason) => {
|
|
12020
8121
|
console.error(`An error occured while generating prisma tRPC source code: ${reason}`);
|
|
12021
8122
|
});
|
|
12022
|
-
/*! Bundled license information:
|
|
12023
|
-
|
|
12024
|
-
@ltd/j-toml/index.mjs:
|
|
12025
|
-
(*!@preserve@license
|
|
12026
|
-
* 模块名称:j-regexp
|
|
12027
|
-
* 模块功能:可读性更好的正则表达式创建方式。从属于“简计划”。
|
|
12028
|
-
More readable way for creating RegExp. Belong to "Plan J".
|
|
12029
|
-
* 模块版本:8.2.0
|
|
12030
|
-
* 许可条款:LGPL-3.0
|
|
12031
|
-
* 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
|
|
12032
|
-
* 问题反馈:https://GitHub.com/LongTengDao/j-regexp/issues
|
|
12033
|
-
* 项目主页:https://GitHub.com/LongTengDao/j-regexp/
|
|
12034
|
-
*)
|
|
12035
|
-
|
|
12036
|
-
@ltd/j-toml/index.mjs:
|
|
12037
|
-
(*!@preserve@license
|
|
12038
|
-
* 模块名称:j-orderify
|
|
12039
|
-
* 模块功能:返回一个能保证给定对象的属性按此后添加顺序排列的 proxy,即使键名是 symbol,或整数 string。从属于“简计划”。
|
|
12040
|
-
Return a proxy for given object, which can guarantee own keys are in setting order, even if the key name is symbol or int string. Belong to "Plan J".
|
|
12041
|
-
* 模块版本:7.0.1
|
|
12042
|
-
* 许可条款:LGPL-3.0
|
|
12043
|
-
* 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
|
|
12044
|
-
* 问题反馈:https://GitHub.com/LongTengDao/j-orderify/issues
|
|
12045
|
-
* 项目主页:https://GitHub.com/LongTengDao/j-orderify/
|
|
12046
|
-
*)
|
|
12047
|
-
*/
|