@powerlines/deepkit 0.6.89 → 0.6.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6XE3MLML.cjs → chunk-5FCA3FUP.cjs} +247 -202
- package/dist/{chunk-QIBJ3SJN.js → chunk-DCCZEVPD.js} +247 -202
- package/dist/{chunk-BW5M6IZV.js → chunk-H23PXUB4.js} +1 -1
- package/dist/{chunk-64Y4Q5UZ.js → chunk-H7FBHYTC.js} +1 -1
- package/dist/{chunk-24CKWFNY.cjs → chunk-PKJKNFER.cjs} +2 -2
- package/dist/{chunk-DZ5A2U2B.cjs → chunk-Z6RAU3EG.cjs} +1 -1
- package/dist/esbuild-plugin.cjs +2 -2
- package/dist/esbuild-plugin.js +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.js +3 -3
- package/dist/reflect-type.cjs +3 -3
- package/dist/reflect-type.js +2 -2
- package/dist/utilities.cjs +8 -8
- package/dist/utilities.js +1 -1
- package/dist/vendor/{chunk-G2YK5TOF.cjs → chunk-5L4PYRTQ.cjs} +176 -176
- package/dist/vendor/{chunk-JAA2EQ6V.cjs → chunk-DIGWWPID.cjs} +3 -3
- package/dist/vendor/{chunk-N3N3KQNO.cjs → chunk-EH4HVWS6.cjs} +2 -2
- package/dist/vendor/core.cjs +130 -130
- package/dist/vendor/type-compiler/{chunk-TZT5S6XV.cjs → chunk-OU7N5UBK.cjs} +2 -2
- package/dist/vendor/type-compiler/{chunk-JETWHI7O.js → chunk-P6BGPDLC.js} +2 -2
- package/dist/vendor/type-compiler/{chunk-MV7POLJ2.js → chunk-WIERSFXU.js} +1 -1
- package/dist/vendor/type-compiler/{chunk-EPTDVMT2.cjs → chunk-ZIBKXJM6.cjs} +505 -505
- package/dist/vendor/type-compiler/compiler.cjs +12 -12
- package/dist/vendor/type-compiler/compiler.js +2 -2
- package/dist/vendor/type-compiler/config.cjs +9 -9
- package/dist/vendor/type-compiler/config.js +2 -2
- package/dist/vendor/type-compiler/index.cjs +24 -24
- package/dist/vendor/type-compiler/index.js +4 -4
- package/dist/vendor/type-spec.cjs +5 -5
- package/dist/vendor/type.cjs +776 -776
- package/package.json +10 -10
|
@@ -8,7 +8,7 @@ var isNull$1 = require('@stryke/type-checks/is-null');
|
|
|
8
8
|
var isString$1 = require('@stryke/type-checks/is-string');
|
|
9
9
|
var isUndefined$1 = require('@stryke/type-checks/is-undefined');
|
|
10
10
|
|
|
11
|
-
// ../../node_modules/.pnpm/@stryke+helpers@0.9.
|
|
11
|
+
// ../../node_modules/.pnpm/@stryke+helpers@0.9.48/node_modules/@stryke/helpers/dist/get-unique.mjs
|
|
12
12
|
function getUniqueBy(arr, mapper = (item) => item) {
|
|
13
13
|
const map = /* @__PURE__ */ new Map();
|
|
14
14
|
for (const item of arr) {
|
|
@@ -19,182 +19,7 @@ function getUniqueBy(arr, mapper = (item) => item) {
|
|
|
19
19
|
}
|
|
20
20
|
chunkUSNT2KNT_cjs.__name(getUniqueBy, "getUniqueBy");
|
|
21
21
|
|
|
22
|
-
// ../../node_modules/.pnpm/@stryke+json@0.
|
|
23
|
-
var getObjectTag = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
24
|
-
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
25
|
-
return Object.prototype.toString.call(value);
|
|
26
|
-
}, "getObjectTag");
|
|
27
|
-
|
|
28
|
-
// ../../node_modules/.pnpm/@stryke+json@0.9.43/node_modules/@stryke/json/dist/type-checks/src/is-plain-object.mjs
|
|
29
|
-
var isObjectLike = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((obj) => {
|
|
30
|
-
return typeof obj === "object" && obj !== null;
|
|
31
|
-
}, "isObjectLike");
|
|
32
|
-
var isPlainObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((obj) => {
|
|
33
|
-
if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
|
|
34
|
-
if (Object.getPrototypeOf(obj) === null) return true;
|
|
35
|
-
let proto = obj;
|
|
36
|
-
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
37
|
-
return Object.getPrototypeOf(obj) === proto;
|
|
38
|
-
}, "isPlainObject");
|
|
39
|
-
|
|
40
|
-
// ../../node_modules/.pnpm/@stryke+json@0.9.43/node_modules/@stryke/json/dist/type-checks/src/is-object.mjs
|
|
41
|
-
var isObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
42
|
-
try {
|
|
43
|
-
return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
|
|
44
|
-
} catch {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
}, "isObject");
|
|
48
|
-
|
|
49
|
-
// ../../node_modules/.pnpm/@stryke+json@0.9.43/node_modules/@stryke/json/dist/type-checks/src/is-string.mjs
|
|
50
|
-
var isString = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
51
|
-
try {
|
|
52
|
-
return typeof value === "string";
|
|
53
|
-
} catch {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
}, "isString");
|
|
57
|
-
|
|
58
|
-
// ../../node_modules/.pnpm/@stryke+json@0.9.43/node_modules/@stryke/json/dist/types/src/base.mjs
|
|
59
|
-
var EMPTY_STRING = "";
|
|
60
|
-
|
|
61
|
-
// ../../node_modules/.pnpm/@stryke+json@0.9.43/node_modules/@stryke/json/dist/utils/strip-comments.mjs
|
|
62
|
-
var singleComment = Symbol("singleComment");
|
|
63
|
-
var multiComment = Symbol("multiComment");
|
|
64
|
-
function stripWithoutWhitespace() {
|
|
65
|
-
return "";
|
|
66
|
-
}
|
|
67
|
-
chunkUSNT2KNT_cjs.__name(stripWithoutWhitespace, "stripWithoutWhitespace");
|
|
68
|
-
function stripWithWhitespace(value, start, end) {
|
|
69
|
-
return value.slice(start, end).replace(/\S/g, " ");
|
|
70
|
-
}
|
|
71
|
-
chunkUSNT2KNT_cjs.__name(stripWithWhitespace, "stripWithWhitespace");
|
|
72
|
-
function isEscaped(value, quotePosition) {
|
|
73
|
-
let index = quotePosition - 1;
|
|
74
|
-
let backslashCount = 0;
|
|
75
|
-
while (value[index] === "\\") {
|
|
76
|
-
index -= 1;
|
|
77
|
-
backslashCount += 1;
|
|
78
|
-
}
|
|
79
|
-
return Boolean(backslashCount % 2);
|
|
80
|
-
}
|
|
81
|
-
chunkUSNT2KNT_cjs.__name(isEscaped, "isEscaped");
|
|
82
|
-
function stripComments(value, { whitespace = true, trailingCommas = false } = {}) {
|
|
83
|
-
if (typeof value !== "string") throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof value}\``);
|
|
84
|
-
const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
|
|
85
|
-
let isInsideString = false;
|
|
86
|
-
let isInsideComment = false;
|
|
87
|
-
let offset = 0;
|
|
88
|
-
let buffer = "";
|
|
89
|
-
let result = "";
|
|
90
|
-
let commaIndex = -1;
|
|
91
|
-
for (let index = 0; index < value.length; index++) {
|
|
92
|
-
const currentCharacter = value[index];
|
|
93
|
-
const nextCharacter = value[index + 1];
|
|
94
|
-
if (!isInsideComment && currentCharacter === '"') {
|
|
95
|
-
if (!isEscaped(value, index)) isInsideString = !isInsideString;
|
|
96
|
-
}
|
|
97
|
-
if (isInsideString) continue;
|
|
98
|
-
if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "//") {
|
|
99
|
-
buffer += value.slice(offset, index);
|
|
100
|
-
offset = index;
|
|
101
|
-
isInsideComment = singleComment;
|
|
102
|
-
index++;
|
|
103
|
-
} else if (isInsideComment === singleComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "\r\n") {
|
|
104
|
-
index++;
|
|
105
|
-
isInsideComment = false;
|
|
106
|
-
buffer += strip(value, offset, index);
|
|
107
|
-
offset = index;
|
|
108
|
-
} else if (isInsideComment === singleComment && currentCharacter === "\n") {
|
|
109
|
-
isInsideComment = false;
|
|
110
|
-
buffer += strip(value, offset, index);
|
|
111
|
-
offset = index;
|
|
112
|
-
} else if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "/*") {
|
|
113
|
-
buffer += value.slice(offset, index);
|
|
114
|
-
offset = index;
|
|
115
|
-
isInsideComment = multiComment;
|
|
116
|
-
index++;
|
|
117
|
-
} else if (isInsideComment === multiComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "*/") {
|
|
118
|
-
index++;
|
|
119
|
-
isInsideComment = false;
|
|
120
|
-
buffer += strip(value, offset, index + 1);
|
|
121
|
-
offset = index + 1;
|
|
122
|
-
} else if (trailingCommas && !isInsideComment) {
|
|
123
|
-
if (commaIndex !== -1) {
|
|
124
|
-
if (currentCharacter === "}" || currentCharacter === "]") {
|
|
125
|
-
buffer += value.slice(offset, index);
|
|
126
|
-
result += strip(buffer, 0, 1) + buffer.slice(1);
|
|
127
|
-
buffer = "";
|
|
128
|
-
offset = index;
|
|
129
|
-
commaIndex = -1;
|
|
130
|
-
} else if (currentCharacter !== " " && currentCharacter !== " " && currentCharacter !== "\r" && currentCharacter !== "\n") {
|
|
131
|
-
buffer += value.slice(offset, index);
|
|
132
|
-
offset = index;
|
|
133
|
-
commaIndex = -1;
|
|
134
|
-
}
|
|
135
|
-
} else if (currentCharacter === ",") {
|
|
136
|
-
result += buffer + value.slice(offset, index);
|
|
137
|
-
buffer = "";
|
|
138
|
-
offset = index;
|
|
139
|
-
commaIndex = index;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return result + buffer + (isInsideComment ? strip(value.slice(offset)) : value.slice(offset));
|
|
144
|
-
}
|
|
145
|
-
chunkUSNT2KNT_cjs.__name(stripComments, "stripComments");
|
|
146
|
-
|
|
147
|
-
// ../../node_modules/.pnpm/@stryke+json@0.9.43/node_modules/@stryke/json/dist/utils/parse.mjs
|
|
148
|
-
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*:/;
|
|
149
|
-
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*:/;
|
|
150
|
-
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
|
|
151
|
-
function jsonParseTransform(key, value) {
|
|
152
|
-
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
153
|
-
console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
return value;
|
|
157
|
-
}
|
|
158
|
-
chunkUSNT2KNT_cjs.__name(jsonParseTransform, "jsonParseTransform");
|
|
159
|
-
function parse(value, options = {}) {
|
|
160
|
-
if (typeof value !== "string") return value;
|
|
161
|
-
let stripped = stripComments(value);
|
|
162
|
-
if (stripped[0] === '"' && stripped[stripped.length - 1] === '"' && !stripped.includes("\\")) return stripped.slice(1, -1);
|
|
163
|
-
stripped = stripped.trim();
|
|
164
|
-
if (stripped.length <= 9) switch (stripped.toLowerCase()) {
|
|
165
|
-
case "true":
|
|
166
|
-
return true;
|
|
167
|
-
case "false":
|
|
168
|
-
return false;
|
|
169
|
-
case "undefined":
|
|
170
|
-
return;
|
|
171
|
-
case "null":
|
|
172
|
-
return null;
|
|
173
|
-
case "nan":
|
|
174
|
-
return NaN;
|
|
175
|
-
case "infinity":
|
|
176
|
-
return Number.POSITIVE_INFINITY;
|
|
177
|
-
case "-infinity":
|
|
178
|
-
return Number.NEGATIVE_INFINITY;
|
|
179
|
-
}
|
|
180
|
-
if (!JsonSigRx.test(stripped)) {
|
|
181
|
-
if (options.strict) throw new Error("Invalid JSON");
|
|
182
|
-
return stripped;
|
|
183
|
-
}
|
|
184
|
-
try {
|
|
185
|
-
if (suspectProtoRx.test(stripped) || suspectConstructorRx.test(stripped)) {
|
|
186
|
-
if (options.strict) throw new Error("Possible prototype pollution");
|
|
187
|
-
return JSON.parse(stripped, jsonParseTransform);
|
|
188
|
-
}
|
|
189
|
-
return JSON.parse(stripped);
|
|
190
|
-
} catch (error) {
|
|
191
|
-
if (options.strict) throw error;
|
|
192
|
-
return value;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
chunkUSNT2KNT_cjs.__name(parse, "parse");
|
|
196
|
-
|
|
197
|
-
// ../../node_modules/.pnpm/@stryke+json@0.9.43/node_modules/@stryke/json/dist/utils/code-frames.mjs
|
|
22
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/code-frames-C8DEdLmV.mjs
|
|
198
23
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
199
24
|
function getMarkerLines(loc, source, opts = {}) {
|
|
200
25
|
const startLoc = {
|
|
@@ -264,7 +89,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
|
264
89
|
}
|
|
265
90
|
chunkUSNT2KNT_cjs.__name(codeFrameColumns, "codeFrameColumns");
|
|
266
91
|
|
|
267
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.
|
|
92
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
268
93
|
function createScanner(text, ignoreTrivia = false) {
|
|
269
94
|
const len = text.length;
|
|
270
95
|
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
@@ -696,14 +521,44 @@ var CharacterCodes;
|
|
|
696
521
|
CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
|
|
697
522
|
})(CharacterCodes || (CharacterCodes = {}));
|
|
698
523
|
|
|
699
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.
|
|
524
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
525
|
+
new Array(20).fill(0).map((_, index) => {
|
|
526
|
+
return " ".repeat(index);
|
|
527
|
+
});
|
|
528
|
+
var maxCachedValues = 200;
|
|
529
|
+
({
|
|
530
|
+
" ": {
|
|
531
|
+
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
532
|
+
return "\n" + " ".repeat(index);
|
|
533
|
+
}),
|
|
534
|
+
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
535
|
+
return "\r" + " ".repeat(index);
|
|
536
|
+
}),
|
|
537
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
538
|
+
return "\r\n" + " ".repeat(index);
|
|
539
|
+
})
|
|
540
|
+
},
|
|
541
|
+
" ": {
|
|
542
|
+
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
543
|
+
return "\n" + " ".repeat(index);
|
|
544
|
+
}),
|
|
545
|
+
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
546
|
+
return "\r" + " ".repeat(index);
|
|
547
|
+
}),
|
|
548
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
549
|
+
return "\r\n" + " ".repeat(index);
|
|
550
|
+
})
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
700
555
|
var ParseOptions;
|
|
701
556
|
(function(ParseOptions2) {
|
|
702
557
|
ParseOptions2.DEFAULT = {
|
|
703
558
|
allowTrailingComma: false
|
|
704
559
|
};
|
|
705
560
|
})(ParseOptions || (ParseOptions = {}));
|
|
706
|
-
function
|
|
561
|
+
function parse(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
707
562
|
let currentProperty = null;
|
|
708
563
|
let currentParent = [];
|
|
709
564
|
const previousParents = [];
|
|
@@ -751,27 +606,48 @@ function parse2(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
751
606
|
visit(text, visitor, options);
|
|
752
607
|
return currentParent[0];
|
|
753
608
|
}
|
|
754
|
-
chunkUSNT2KNT_cjs.__name(
|
|
609
|
+
chunkUSNT2KNT_cjs.__name(parse, "parse");
|
|
755
610
|
function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
756
611
|
const _scanner = createScanner(text, false);
|
|
757
612
|
const _jsonPath = [];
|
|
613
|
+
let suppressedCallbacks = 0;
|
|
758
614
|
function toNoArgVisit(visitFunction) {
|
|
759
|
-
return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
615
|
+
return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
760
616
|
}
|
|
761
617
|
chunkUSNT2KNT_cjs.__name(toNoArgVisit, "toNoArgVisit");
|
|
762
|
-
function toNoArgVisitWithPath(visitFunction) {
|
|
763
|
-
return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
764
|
-
}
|
|
765
|
-
chunkUSNT2KNT_cjs.__name(toNoArgVisitWithPath, "toNoArgVisitWithPath");
|
|
766
618
|
function toOneArgVisit(visitFunction) {
|
|
767
|
-
return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
619
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
768
620
|
}
|
|
769
621
|
chunkUSNT2KNT_cjs.__name(toOneArgVisit, "toOneArgVisit");
|
|
770
622
|
function toOneArgVisitWithPath(visitFunction) {
|
|
771
|
-
return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
623
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
772
624
|
}
|
|
773
625
|
chunkUSNT2KNT_cjs.__name(toOneArgVisitWithPath, "toOneArgVisitWithPath");
|
|
774
|
-
|
|
626
|
+
function toBeginVisit(visitFunction) {
|
|
627
|
+
return visitFunction ? () => {
|
|
628
|
+
if (suppressedCallbacks > 0) {
|
|
629
|
+
suppressedCallbacks++;
|
|
630
|
+
} else {
|
|
631
|
+
let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());
|
|
632
|
+
if (cbReturn === false) {
|
|
633
|
+
suppressedCallbacks = 1;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
} : () => true;
|
|
637
|
+
}
|
|
638
|
+
chunkUSNT2KNT_cjs.__name(toBeginVisit, "toBeginVisit");
|
|
639
|
+
function toEndVisit(visitFunction) {
|
|
640
|
+
return visitFunction ? () => {
|
|
641
|
+
if (suppressedCallbacks > 0) {
|
|
642
|
+
suppressedCallbacks--;
|
|
643
|
+
}
|
|
644
|
+
if (suppressedCallbacks === 0) {
|
|
645
|
+
visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
|
|
646
|
+
}
|
|
647
|
+
} : () => true;
|
|
648
|
+
}
|
|
649
|
+
chunkUSNT2KNT_cjs.__name(toEndVisit, "toEndVisit");
|
|
650
|
+
const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
|
|
775
651
|
const disallowComments = options && options.disallowComments;
|
|
776
652
|
const allowTrailingComma = options && options.allowTrailingComma;
|
|
777
653
|
function scanNext() {
|
|
@@ -1051,7 +927,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
1051
927
|
}
|
|
1052
928
|
chunkUSNT2KNT_cjs.__name(visit, "visit");
|
|
1053
929
|
|
|
1054
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.
|
|
930
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
|
|
1055
931
|
var ScanError;
|
|
1056
932
|
(function(ScanError2) {
|
|
1057
933
|
ScanError2[ScanError2["None"] = 0] = "None";
|
|
@@ -1082,7 +958,7 @@ var SyntaxKind;
|
|
|
1082
958
|
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
1083
959
|
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
1084
960
|
})(SyntaxKind || (SyntaxKind = {}));
|
|
1085
|
-
var
|
|
961
|
+
var parse2 = parse;
|
|
1086
962
|
var ParseErrorCode;
|
|
1087
963
|
(function(ParseErrorCode2) {
|
|
1088
964
|
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
@@ -1202,7 +1078,7 @@ var LinesAndColumns = (
|
|
|
1202
1078
|
})()
|
|
1203
1079
|
);
|
|
1204
1080
|
|
|
1205
|
-
// ../../node_modules/.pnpm/@stryke+json@0.
|
|
1081
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/parse-error-Cu6mjBS7.mjs
|
|
1206
1082
|
function formatParseError(input, parseError) {
|
|
1207
1083
|
const { error, offset, length } = parseError;
|
|
1208
1084
|
const result = new LinesAndColumns(input).locationForIndex(offset);
|
|
@@ -1225,7 +1101,11 @@ ${codeFrameColumns(input, {
|
|
|
1225
1101
|
}
|
|
1226
1102
|
chunkUSNT2KNT_cjs.__name(formatParseError, "formatParseError");
|
|
1227
1103
|
|
|
1228
|
-
// ../../node_modules/.pnpm/@stryke+json@0.
|
|
1104
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/is-number-BMxmACAS.mjs
|
|
1105
|
+
var getObjectTag = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
1106
|
+
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
1107
|
+
return Object.prototype.toString.call(value);
|
|
1108
|
+
}, "getObjectTag");
|
|
1229
1109
|
var isNumber = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
1230
1110
|
try {
|
|
1231
1111
|
return value instanceof Number || typeof value === "number" || Number(value) === value;
|
|
@@ -1234,12 +1114,177 @@ var isNumber = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
|
1234
1114
|
}
|
|
1235
1115
|
}, "isNumber");
|
|
1236
1116
|
|
|
1237
|
-
// ../../node_modules/.pnpm/@stryke+json@0.
|
|
1117
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/is-object-BYxzKTYU.mjs
|
|
1118
|
+
var isObjectLike = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((obj) => {
|
|
1119
|
+
return typeof obj === "object" && obj !== null;
|
|
1120
|
+
}, "isObjectLike");
|
|
1121
|
+
var isPlainObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((obj) => {
|
|
1122
|
+
if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
|
|
1123
|
+
if (Object.getPrototypeOf(obj) === null) return true;
|
|
1124
|
+
let proto = obj;
|
|
1125
|
+
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
1126
|
+
return Object.getPrototypeOf(obj) === proto;
|
|
1127
|
+
}, "isPlainObject");
|
|
1128
|
+
var isObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
1129
|
+
try {
|
|
1130
|
+
return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
|
|
1131
|
+
} catch {
|
|
1132
|
+
return false;
|
|
1133
|
+
}
|
|
1134
|
+
}, "isObject");
|
|
1135
|
+
|
|
1136
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/is-string--ny35huw.mjs
|
|
1137
|
+
var isString = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
1138
|
+
try {
|
|
1139
|
+
return typeof value === "string";
|
|
1140
|
+
} catch {
|
|
1141
|
+
return false;
|
|
1142
|
+
}
|
|
1143
|
+
}, "isString");
|
|
1144
|
+
|
|
1145
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/strip-comments-DNTu6CWM.mjs
|
|
1146
|
+
var EMPTY_STRING = "";
|
|
1147
|
+
var singleComment = Symbol("singleComment");
|
|
1148
|
+
var multiComment = Symbol("multiComment");
|
|
1149
|
+
function stripWithoutWhitespace() {
|
|
1150
|
+
return "";
|
|
1151
|
+
}
|
|
1152
|
+
chunkUSNT2KNT_cjs.__name(stripWithoutWhitespace, "stripWithoutWhitespace");
|
|
1153
|
+
function stripWithWhitespace(value, start, end) {
|
|
1154
|
+
return value.slice(start, end).replace(/\S/g, " ");
|
|
1155
|
+
}
|
|
1156
|
+
chunkUSNT2KNT_cjs.__name(stripWithWhitespace, "stripWithWhitespace");
|
|
1157
|
+
function isEscaped(value, quotePosition) {
|
|
1158
|
+
let index = quotePosition - 1;
|
|
1159
|
+
let backslashCount = 0;
|
|
1160
|
+
while (value[index] === "\\") {
|
|
1161
|
+
index -= 1;
|
|
1162
|
+
backslashCount += 1;
|
|
1163
|
+
}
|
|
1164
|
+
return Boolean(backslashCount % 2);
|
|
1165
|
+
}
|
|
1166
|
+
chunkUSNT2KNT_cjs.__name(isEscaped, "isEscaped");
|
|
1167
|
+
function stripComments2(value, { whitespace = true, trailingCommas = false } = {}) {
|
|
1168
|
+
if (typeof value !== "string") throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof value}\``);
|
|
1169
|
+
const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
|
|
1170
|
+
let isInsideString = false;
|
|
1171
|
+
let isInsideComment = false;
|
|
1172
|
+
let offset = 0;
|
|
1173
|
+
let buffer = "";
|
|
1174
|
+
let result = "";
|
|
1175
|
+
let commaIndex = -1;
|
|
1176
|
+
for (let index = 0; index < value.length; index++) {
|
|
1177
|
+
const currentCharacter = value[index];
|
|
1178
|
+
const nextCharacter = value[index + 1];
|
|
1179
|
+
if (!isInsideComment && currentCharacter === '"') {
|
|
1180
|
+
if (!isEscaped(value, index)) isInsideString = !isInsideString;
|
|
1181
|
+
}
|
|
1182
|
+
if (isInsideString) continue;
|
|
1183
|
+
if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "//") {
|
|
1184
|
+
buffer += value.slice(offset, index);
|
|
1185
|
+
offset = index;
|
|
1186
|
+
isInsideComment = singleComment;
|
|
1187
|
+
index++;
|
|
1188
|
+
} else if (isInsideComment === singleComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "\r\n") {
|
|
1189
|
+
index++;
|
|
1190
|
+
isInsideComment = false;
|
|
1191
|
+
buffer += strip(value, offset, index);
|
|
1192
|
+
offset = index;
|
|
1193
|
+
} else if (isInsideComment === singleComment && currentCharacter === "\n") {
|
|
1194
|
+
isInsideComment = false;
|
|
1195
|
+
buffer += strip(value, offset, index);
|
|
1196
|
+
offset = index;
|
|
1197
|
+
} else if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "/*") {
|
|
1198
|
+
buffer += value.slice(offset, index);
|
|
1199
|
+
offset = index;
|
|
1200
|
+
isInsideComment = multiComment;
|
|
1201
|
+
index++;
|
|
1202
|
+
} else if (isInsideComment === multiComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "*/") {
|
|
1203
|
+
index++;
|
|
1204
|
+
isInsideComment = false;
|
|
1205
|
+
buffer += strip(value, offset, index + 1);
|
|
1206
|
+
offset = index + 1;
|
|
1207
|
+
} else if (trailingCommas && !isInsideComment) {
|
|
1208
|
+
if (commaIndex !== -1) {
|
|
1209
|
+
if (currentCharacter === "}" || currentCharacter === "]") {
|
|
1210
|
+
buffer += value.slice(offset, index);
|
|
1211
|
+
result += strip(buffer, 0, 1) + buffer.slice(1);
|
|
1212
|
+
buffer = "";
|
|
1213
|
+
offset = index;
|
|
1214
|
+
commaIndex = -1;
|
|
1215
|
+
} else if (currentCharacter !== " " && currentCharacter !== " " && currentCharacter !== "\r" && currentCharacter !== "\n") {
|
|
1216
|
+
buffer += value.slice(offset, index);
|
|
1217
|
+
offset = index;
|
|
1218
|
+
commaIndex = -1;
|
|
1219
|
+
}
|
|
1220
|
+
} else if (currentCharacter === ",") {
|
|
1221
|
+
result += buffer + value.slice(offset, index);
|
|
1222
|
+
buffer = "";
|
|
1223
|
+
offset = index;
|
|
1224
|
+
commaIndex = index;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
return result + buffer + (isInsideComment ? strip(value.slice(offset)) : value.slice(offset));
|
|
1229
|
+
}
|
|
1230
|
+
chunkUSNT2KNT_cjs.__name(stripComments2, "stripComments");
|
|
1231
|
+
|
|
1232
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/parse-BrChHTWb.mjs
|
|
1233
|
+
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*:/;
|
|
1234
|
+
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*:/;
|
|
1235
|
+
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
|
|
1236
|
+
function jsonParseTransform(key, value) {
|
|
1237
|
+
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
1238
|
+
console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1241
|
+
return value;
|
|
1242
|
+
}
|
|
1243
|
+
chunkUSNT2KNT_cjs.__name(jsonParseTransform, "jsonParseTransform");
|
|
1244
|
+
function parse3(value, options = {}) {
|
|
1245
|
+
if (typeof value !== "string") return value;
|
|
1246
|
+
let stripped = stripComments2(value);
|
|
1247
|
+
if (stripped[0] === '"' && stripped[stripped.length - 1] === '"' && !stripped.includes("\\")) return stripped.slice(1, -1);
|
|
1248
|
+
stripped = stripped.trim();
|
|
1249
|
+
if (stripped.length <= 9) switch (stripped.toLowerCase()) {
|
|
1250
|
+
case "true":
|
|
1251
|
+
return true;
|
|
1252
|
+
case "false":
|
|
1253
|
+
return false;
|
|
1254
|
+
case "undefined":
|
|
1255
|
+
return;
|
|
1256
|
+
case "null":
|
|
1257
|
+
return null;
|
|
1258
|
+
case "nan":
|
|
1259
|
+
return NaN;
|
|
1260
|
+
case "infinity":
|
|
1261
|
+
return Number.POSITIVE_INFINITY;
|
|
1262
|
+
case "-infinity":
|
|
1263
|
+
return Number.NEGATIVE_INFINITY;
|
|
1264
|
+
}
|
|
1265
|
+
if (!JsonSigRx.test(stripped)) {
|
|
1266
|
+
if (options.strict) throw new Error("Invalid JSON");
|
|
1267
|
+
return stripped;
|
|
1268
|
+
}
|
|
1269
|
+
try {
|
|
1270
|
+
if (suspectProtoRx.test(stripped) || suspectConstructorRx.test(stripped)) {
|
|
1271
|
+
if (options.strict) throw new Error("Possible prototype pollution");
|
|
1272
|
+
return JSON.parse(stripped, jsonParseTransform);
|
|
1273
|
+
}
|
|
1274
|
+
return JSON.parse(stripped);
|
|
1275
|
+
} catch (error) {
|
|
1276
|
+
if (options.strict) throw error;
|
|
1277
|
+
return value;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
chunkUSNT2KNT_cjs.__name(parse3, "parse");
|
|
1281
|
+
|
|
1282
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/is-undefined-CqNzBssC.mjs
|
|
1238
1283
|
var isUndefined = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
|
|
1239
1284
|
return value === void 0;
|
|
1240
1285
|
}, "isUndefined");
|
|
1241
1286
|
|
|
1242
|
-
// ../../node_modules/.pnpm/@stryke+json@0.
|
|
1287
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/stringify-CfeAVjh8.mjs
|
|
1243
1288
|
var invalidKeyChars = [
|
|
1244
1289
|
"@",
|
|
1245
1290
|
"/",
|
|
@@ -2170,7 +2215,7 @@ SuperJSON.registerCustom;
|
|
|
2170
2215
|
SuperJSON.registerSymbol;
|
|
2171
2216
|
SuperJSON.allowErrorProps;
|
|
2172
2217
|
|
|
2173
|
-
// ../../node_modules/.pnpm/@stryke+json@0.
|
|
2218
|
+
// ../../node_modules/.pnpm/@stryke+json@0.14.0/node_modules/@stryke/json/dist/storm-json-BmO91crX.mjs
|
|
2174
2219
|
var StormJSON = class StormJSON2 extends SuperJSON {
|
|
2175
2220
|
static {
|
|
2176
2221
|
chunkUSNT2KNT_cjs.__name(this, "StormJSON");
|
|
@@ -2199,21 +2244,21 @@ var StormJSON = class StormJSON2 extends SuperJSON {
|
|
|
2199
2244
|
* @returns The parsed data
|
|
2200
2245
|
*/
|
|
2201
2246
|
static parse(value) {
|
|
2202
|
-
return
|
|
2247
|
+
return parse3(value);
|
|
2203
2248
|
}
|
|
2204
2249
|
/**
|
|
2205
2250
|
* Serializes the given data to a JSON string.
|
|
2206
2251
|
* By default the JSON string is formatted with a 2 space indentation to be easy readable.
|
|
2207
2252
|
*
|
|
2208
2253
|
* @param value - Object which should be serialized to JSON
|
|
2209
|
-
* @param
|
|
2254
|
+
* @param options - JSON serialize options
|
|
2210
2255
|
* @returns the formatted JSON representation of the object
|
|
2211
2256
|
*/
|
|
2212
|
-
static stringify(value,
|
|
2257
|
+
static stringify(value, options) {
|
|
2213
2258
|
const customTransformer = StormJSON2.instance.customTransformerRegistry.findApplicable(value);
|
|
2214
2259
|
let result = value;
|
|
2215
2260
|
if (customTransformer && customTransformer.isApplicable(value)) result = customTransformer.serialize(result);
|
|
2216
|
-
return stringify(result);
|
|
2261
|
+
return stringify(result, options?.spaces ?? 2);
|
|
2217
2262
|
}
|
|
2218
2263
|
/**
|
|
2219
2264
|
* Parses the given JSON string and returns the object the JSON content represents.
|
|
@@ -2229,7 +2274,7 @@ var StormJSON = class StormJSON2 extends SuperJSON {
|
|
|
2229
2274
|
} catch {
|
|
2230
2275
|
}
|
|
2231
2276
|
const errors = [];
|
|
2232
|
-
const result =
|
|
2277
|
+
const result = parse2(strData, errors, {
|
|
2233
2278
|
allowTrailingComma: true,
|
|
2234
2279
|
...options
|
|
2235
2280
|
});
|
|
@@ -2267,7 +2312,7 @@ var StormJSON = class StormJSON2 extends SuperJSON {
|
|
|
2267
2312
|
}
|
|
2268
2313
|
};
|
|
2269
2314
|
StormJSON.instance.registerCustom({
|
|
2270
|
-
isApplicable: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((v) => buffer.Buffer.isBuffer(v), "isApplicable"),
|
|
2315
|
+
isApplicable: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((v) => typeof buffer.Buffer.isBuffer === "function" && buffer.Buffer.isBuffer(v), "isApplicable"),
|
|
2271
2316
|
serialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((v) => v.toString("base64"), "serialize"),
|
|
2272
2317
|
deserialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((v) => buffer.Buffer.from(v, "base64"), "deserialize")
|
|
2273
2318
|
}, "Bytes");
|