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