@powerlines/deepkit 0.6.89 → 0.6.90

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