@stryke/json 0.11.0 → 0.13.0

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 (160) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/canonical-3PQxSh5G.d.cts +17 -0
  3. package/dist/canonical-3PQxSh5G.d.cts.map +1 -0
  4. package/dist/canonical-CVbmCnGM.mjs +28 -0
  5. package/dist/canonical-CVbmCnGM.mjs.map +1 -0
  6. package/dist/canonical-DZDrZ9dv.d.mts +17 -0
  7. package/dist/canonical-DZDrZ9dv.d.mts.map +1 -0
  8. package/dist/canonical-hMXtzPIV.cjs +33 -0
  9. package/dist/canonical.cjs +3 -0
  10. package/dist/canonical.d.cts +2 -0
  11. package/dist/canonical.d.mts +2 -0
  12. package/dist/canonical.mjs +3 -0
  13. package/dist/{code-frames-BUtrssZ5.d.cts → code-frames-BOS_tt9F.d.mts} +1 -1
  14. package/dist/{code-frames-CrTAYYSE.d.mts.map → code-frames-BOS_tt9F.d.mts.map} +1 -1
  15. package/dist/{code-frames-DuBfTMu4.mjs → code-frames-C8DEdLmV.mjs} +1 -1
  16. package/dist/{code-frames-DuBfTMu4.mjs.map → code-frames-C8DEdLmV.mjs.map} +1 -1
  17. package/dist/{code-frames-CrTAYYSE.d.mts → code-frames-ClyQ9O1l.d.cts} +1 -1
  18. package/dist/{code-frames-BUtrssZ5.d.cts.map → code-frames-ClyQ9O1l.d.cts.map} +1 -1
  19. package/dist/{find-reference-B8xshNXL.d.mts → find-reference-BuuNqqOh.d.cts} +1 -1
  20. package/dist/{find-reference-B8xshNXL.d.mts.map → find-reference-BuuNqqOh.d.cts.map} +1 -1
  21. package/dist/{find-reference-De5vBQV2.cjs → find-reference-Ct8UDBo2.cjs} +2 -2
  22. package/dist/{find-reference-C-YleCds.d.cts → find-reference-MHRH7HJ_.d.mts} +1 -1
  23. package/dist/{find-reference-C-YleCds.d.cts.map → find-reference-MHRH7HJ_.d.mts.map} +1 -1
  24. package/dist/{find-reference-DMSYEaaI.mjs → find-reference-kPgdulJ1.mjs} +3 -3
  25. package/dist/{find-reference-DMSYEaaI.mjs.map → find-reference-kPgdulJ1.mjs.map} +1 -1
  26. package/dist/index.cjs +17 -11
  27. package/dist/index.d.cts +12 -11
  28. package/dist/index.d.mts +13 -12
  29. package/dist/index.mjs +13 -12
  30. package/dist/{is-number-BIwzZzyi.mjs → is-number-BMxmACAS.mjs} +1 -1
  31. package/dist/{is-number-BIwzZzyi.mjs.map → is-number-BMxmACAS.mjs.map} +1 -1
  32. package/dist/{is-object-BpfmzHWa.mjs → is-object-BYxzKTYU.mjs} +2 -2
  33. package/dist/{is-object-BpfmzHWa.mjs.map → is-object-BYxzKTYU.mjs.map} +1 -1
  34. package/dist/{is-object-umGh91v1.cjs → is-object-BbRMEXAo.cjs} +1 -1
  35. package/dist/{is-set-object-BmHip9em.cjs → is-set-object-5lZPw_Pq.cjs} +3 -3
  36. package/dist/{is-set-object-C1Qnj1Q8.mjs → is-set-object-yxjp5vg-.mjs} +4 -4
  37. package/dist/{is-set-object-C1Qnj1Q8.mjs.map → is-set-object-yxjp5vg-.mjs.map} +1 -1
  38. package/dist/{is-string-CLiBUSKV.mjs → is-string--ny35huw.mjs} +1 -1
  39. package/dist/{is-string-CLiBUSKV.mjs.map → is-string--ny35huw.mjs.map} +1 -1
  40. package/dist/{is-undefined-CmyJWYGD.mjs → is-undefined-CqNzBssC.mjs} +1 -1
  41. package/dist/{is-undefined-CmyJWYGD.mjs.map → is-undefined-CqNzBssC.mjs.map} +1 -1
  42. package/dist/{parse-vw_qRD3F.mjs → parse-B3NfTO06.mjs} +3 -3
  43. package/dist/{parse-vw_qRD3F.mjs.map → parse-B3NfTO06.mjs.map} +1 -1
  44. package/dist/{parse-Bp6kkcQ4.cjs → parse-BSmqrTy_.cjs} +2 -2
  45. package/dist/{parse-Dn43ZK9y.mjs → parse-BrChHTWb.mjs} +2 -2
  46. package/dist/{parse-Dn43ZK9y.mjs.map → parse-BrChHTWb.mjs.map} +1 -1
  47. package/dist/{parse-ByDxRup5.cjs → parse-CX9jPskm.cjs} +1 -1
  48. package/dist/{parse-DZfi3d96.d.cts → parse-DCHSu_0u.d.cts} +1 -1
  49. package/dist/{parse-Cj-YfhrI.d.mts.map → parse-DCHSu_0u.d.cts.map} +1 -1
  50. package/dist/{parse-Cj-YfhrI.d.mts → parse-DaiwKCLz.d.mts} +1 -1
  51. package/dist/{parse-DZfi3d96.d.cts.map → parse-DaiwKCLz.d.mts.map} +1 -1
  52. package/dist/{parse-BGlhbY16.d.cts → parse-XXQfTfNE.d.mts} +1 -1
  53. package/dist/{parse-BGlhbY16.d.cts.map → parse-XXQfTfNE.d.mts.map} +1 -1
  54. package/dist/{parse-error-DpEv3vo_.d.mts → parse-error-CDt01Gvc.d.mts} +1 -1
  55. package/dist/parse-error-CDt01Gvc.d.mts.map +1 -0
  56. package/dist/{parse-error-7K8s4vWf.d.cts → parse-error-CGKcBkMJ.d.cts} +1 -1
  57. package/dist/parse-error-CGKcBkMJ.d.cts.map +1 -0
  58. package/dist/{parse-error-N7UE-HMh.cjs → parse-error-CUOf-YBA.cjs} +2 -2
  59. package/dist/{parse-error-Af4zHUQ_.mjs → parse-error-Cu6mjBS7.mjs} +2 -2
  60. package/dist/{parse-error-Af4zHUQ_.mjs.map → parse-error-Cu6mjBS7.mjs.map} +1 -1
  61. package/dist/{parse-fXy5pbmE.d.mts → parse-ygKFNauQ.d.cts} +1 -1
  62. package/dist/{parse-fXy5pbmE.d.mts.map → parse-ygKFNauQ.d.cts.map} +1 -1
  63. package/dist/pointer/find-reference.cjs +1 -1
  64. package/dist/pointer/find-reference.d.cts +1 -1
  65. package/dist/pointer/find-reference.d.mts +1 -1
  66. package/dist/pointer/find-reference.mjs +1 -1
  67. package/dist/pointer/index.cjs +3 -3
  68. package/dist/pointer/index.d.cts +2 -2
  69. package/dist/pointer/index.d.mts +2 -2
  70. package/dist/pointer/index.mjs +3 -3
  71. package/dist/pointer/parse.cjs +1 -1
  72. package/dist/pointer/parse.d.cts +1 -1
  73. package/dist/pointer/parse.d.mts +1 -1
  74. package/dist/pointer/parse.mjs +1 -1
  75. package/dist/{schema-DGmzxHja.mjs → schema-CMt54x11.mjs} +39 -3
  76. package/dist/schema-CMt54x11.mjs.map +1 -0
  77. package/dist/{schema-BO1HCrxv.d.cts → schema-CuBX00tF.d.cts} +33 -5
  78. package/dist/schema-CuBX00tF.d.cts.map +1 -0
  79. package/dist/{schema-Dl018Aq4.cjs → schema-CwyRhvHe.cjs} +61 -1
  80. package/dist/{schema-CmH1V_uI.d.mts → schema-D5wPTiM4.d.mts} +33 -5
  81. package/dist/schema-D5wPTiM4.d.mts.map +1 -0
  82. package/dist/schema.cjs +5 -1
  83. package/dist/schema.d.cts +2 -2
  84. package/dist/schema.d.mts +3 -3
  85. package/dist/schema.mjs +2 -2
  86. package/dist/{storm-json-BD6WFbrI.cjs → storm-json-BDPXNC_u.cjs} +5 -5
  87. package/dist/{storm-json-nkhJgTz4.mjs → storm-json-BmO91crX.mjs} +6 -6
  88. package/dist/{storm-json-nkhJgTz4.mjs.map → storm-json-BmO91crX.mjs.map} +1 -1
  89. package/dist/{storm-json-8F9CKpXu.d.mts → storm-json-DJwb3Ou-.d.mts} +2 -2
  90. package/dist/{storm-json-8F9CKpXu.d.mts.map → storm-json-DJwb3Ou-.d.mts.map} +1 -1
  91. package/dist/{storm-json-DvIEWMEH.d.cts → storm-json-DiBg5b6r.d.cts} +2 -2
  92. package/dist/{storm-json-DvIEWMEH.d.cts.map → storm-json-DiBg5b6r.d.cts.map} +1 -1
  93. package/dist/storm-json.cjs +2 -2
  94. package/dist/storm-json.d.cts +1 -1
  95. package/dist/storm-json.d.mts +2 -2
  96. package/dist/storm-json.mjs +2 -2
  97. package/dist/{stringify-CYHjAvWm.mjs → stringify-CfeAVjh8.mjs} +3 -3
  98. package/dist/{stringify-CYHjAvWm.mjs.map → stringify-CfeAVjh8.mjs.map} +1 -1
  99. package/dist/{stringify-BehjrfhS.cjs → stringify-DQOBApRO.cjs} +2 -2
  100. package/dist/{stringify-Bc8OkhIr.d.cts → stringify-DtMcg2Wy.d.mts} +1 -1
  101. package/dist/stringify-DtMcg2Wy.d.mts.map +1 -0
  102. package/dist/{stringify-CFT1K1LE.d.mts → stringify-mAxwby9q.d.cts} +1 -1
  103. package/dist/stringify-mAxwby9q.d.cts.map +1 -0
  104. package/dist/{strip-comments-BA8MS_Fs.d.mts → strip-comments-AOXnoydB.d.cts} +1 -1
  105. package/dist/{strip-comments-BA8MS_Fs.d.mts.map → strip-comments-AOXnoydB.d.cts.map} +1 -1
  106. package/dist/{strip-comments-Cz_Wc25t.d.cts → strip-comments-BNN6Uf4e.d.mts} +1 -1
  107. package/dist/{strip-comments-Cz_Wc25t.d.cts.map → strip-comments-BNN6Uf4e.d.mts.map} +1 -1
  108. package/dist/{strip-comments-Dq00N_Sg.mjs → strip-comments-DNTu6CWM.mjs} +1 -1
  109. package/dist/{strip-comments-Dq00N_Sg.mjs.map → strip-comments-DNTu6CWM.mjs.map} +1 -1
  110. package/dist/{types-CPQlxauZ.d.mts → types-BAtAPir9.d.mts} +1 -1
  111. package/dist/{types-Bn8rC098.d.cts.map → types-BAtAPir9.d.mts.map} +1 -1
  112. package/dist/{types-Bn8rC098.d.cts → types-BzNIRhpI.d.cts} +1 -1
  113. package/dist/{types-CPQlxauZ.d.mts.map → types-BzNIRhpI.d.cts.map} +1 -1
  114. package/dist/types.d.cts +1 -1
  115. package/dist/types.d.mts +1 -1
  116. package/dist/utils/code-frames.cjs +1 -1
  117. package/dist/utils/code-frames.d.cts +1 -1
  118. package/dist/utils/code-frames.d.mts +1 -1
  119. package/dist/utils/code-frames.mjs +1 -1
  120. package/dist/utils/index.cjs +6 -6
  121. package/dist/utils/index.d.cts +5 -5
  122. package/dist/utils/index.d.mts +6 -6
  123. package/dist/utils/index.mjs +6 -6
  124. package/dist/utils/parse-error.cjs +1 -1
  125. package/dist/utils/parse-error.d.cts +1 -1
  126. package/dist/utils/parse-error.d.mts +1 -1
  127. package/dist/utils/parse-error.mjs +1 -1
  128. package/dist/utils/parse.cjs +1 -1
  129. package/dist/utils/parse.d.cts +1 -1
  130. package/dist/utils/parse.d.mts +1 -1
  131. package/dist/utils/parse.mjs +1 -1
  132. package/dist/utils/stringify.cjs +1 -1
  133. package/dist/utils/stringify.d.cts +1 -1
  134. package/dist/utils/stringify.d.mts +1 -1
  135. package/dist/utils/stringify.mjs +1 -1
  136. package/dist/utils/strip-comments.cjs +1 -1
  137. package/dist/utils/strip-comments.d.cts +1 -1
  138. package/dist/utils/strip-comments.d.mts +1 -1
  139. package/dist/utils/strip-comments.mjs +1 -1
  140. package/package.json +6 -2
  141. package/dist/parse-error-7K8s4vWf.d.cts.map +0 -1
  142. package/dist/parse-error-DpEv3vo_.d.mts.map +0 -1
  143. package/dist/schema-BO1HCrxv.d.cts.map +0 -1
  144. package/dist/schema-CmH1V_uI.d.mts.map +0 -1
  145. package/dist/schema-DGmzxHja.mjs.map +0 -1
  146. package/dist/stringify-Bc8OkhIr.d.cts.map +0 -1
  147. package/dist/stringify-CFT1K1LE.d.mts.map +0 -1
  148. /package/dist/{code-frames-BmUvlJ0w.cjs → code-frames-ChE4PPdh.cjs} +0 -0
  149. /package/dist/{index-B_e8BwCm.d.cts → index-CsuikFeJ.d.mts} +0 -0
  150. /package/dist/{index-CCt0lwyI.d.mts → index-Dh6J9gb5.d.cts} +0 -0
  151. /package/dist/{index-CDAfh8Ew.d.cts → index-VmEFGBxN.d.cts} +0 -0
  152. /package/dist/{index-DvuJXuAN.d.mts → index-e6k85DKM.d.mts} +0 -0
  153. /package/dist/{is-number-c5xguIbS.cjs → is-number-CV8PbAUX.cjs} +0 -0
  154. /package/dist/{is-string-C2RK4Gjs.cjs → is-string-yY-B30hL.cjs} +0 -0
  155. /package/dist/{is-undefined-CnI0qe-z.cjs → is-undefined-DyZkA263.cjs} +0 -0
  156. /package/dist/{pointer-B3W_Sme3.cjs → pointer-Cvmor4sN.cjs} +0 -0
  157. /package/dist/{pointer-Dn__XOdY.mjs → pointer-DScQSL_a.mjs} +0 -0
  158. /package/dist/{strip-comments-CmEG_smS.cjs → strip-comments-CPoO4Wj2.cjs} +0 -0
  159. /package/dist/{utils-jN2UkvqB.cjs → utils-DrK7G5cq.cjs} +0 -0
  160. /package/dist/{utils-mEkKIcgl.mjs → utils-mO6p60ai.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- const require_is_set_object = require('./is-set-object-BmHip9em.cjs');
1
+ const require_is_set_object = require('./is-set-object-5lZPw_Pq.cjs');
2
2
 
3
3
  //#region src/schema.ts
4
4
  /**
@@ -22,6 +22,33 @@ function isJsonSchema7ObjectType(schema) {
22
22
  return "properties" in schema;
23
23
  }
24
24
  /**
25
+ * Type guard for {@link JsonSchema7StringType}
26
+ *
27
+ * @param schema - The schema to check
28
+ * @returns True if the schema is a {@link JsonSchema7StringType}, false otherwise
29
+ */
30
+ function isJsonSchema7StringType(schema) {
31
+ return "type" in schema && schema.type === "string";
32
+ }
33
+ /**
34
+ * Type guard for {@link JsonSchema7NumberType}
35
+ *
36
+ * @param schema - The schema to check
37
+ * @returns True if the schema is a {@link JsonSchema7NumberType}, false otherwise
38
+ */
39
+ function isJsonSchema7NumberType(schema) {
40
+ return "type" in schema && (schema.type === "number" || schema.type === "integer");
41
+ }
42
+ /**
43
+ * Type guard for {@link JsonSchema7BooleanType}
44
+ *
45
+ * @param schema - The schema to check
46
+ * @returns True if the schema is a {@link JsonSchema7BooleanType}, false otherwise
47
+ */
48
+ function isJsonSchema7BooleanType(schema) {
49
+ return "type" in schema && schema.type === "boolean";
50
+ }
51
+ /**
25
52
  * Type guard for {@link JsonSchema7ArrayType}
26
53
  *
27
54
  * @param schema - The schema to check
@@ -31,6 +58,15 @@ function isJsonSchema7ArrayType(schema) {
31
58
  return "type" in schema && schema.type === "array" && "items" in schema;
32
59
  }
33
60
  /**
61
+ * Type guard for {@link JsonSchema7TupleType}
62
+ *
63
+ * @param schema - The schema to check
64
+ * @returns True if the schema is a {@link JsonSchema7TupleType}, false otherwise
65
+ */
66
+ function isJsonSchema7TupleType(schema) {
67
+ return "type" in schema && schema.type === "array" && "items" in schema && Array.isArray(schema.items);
68
+ }
69
+ /**
34
70
  * Type guard for {@link JsonSchema7PrimitiveLiteralType}
35
71
  *
36
72
  * @param schema - The schema to check
@@ -80,12 +116,24 @@ Object.defineProperty(exports, 'isJsonSchema7ArrayType', {
80
116
  return isJsonSchema7ArrayType;
81
117
  }
82
118
  });
119
+ Object.defineProperty(exports, 'isJsonSchema7BooleanType', {
120
+ enumerable: true,
121
+ get: function () {
122
+ return isJsonSchema7BooleanType;
123
+ }
124
+ });
83
125
  Object.defineProperty(exports, 'isJsonSchema7LiteralType', {
84
126
  enumerable: true,
85
127
  get: function () {
86
128
  return isJsonSchema7LiteralType;
87
129
  }
88
130
  });
131
+ Object.defineProperty(exports, 'isJsonSchema7NumberType', {
132
+ enumerable: true,
133
+ get: function () {
134
+ return isJsonSchema7NumberType;
135
+ }
136
+ });
89
137
  Object.defineProperty(exports, 'isJsonSchema7ObjectType', {
90
138
  enumerable: true,
91
139
  get: function () {
@@ -98,6 +146,18 @@ Object.defineProperty(exports, 'isJsonSchema7PrimitiveLiteralType', {
98
146
  return isJsonSchema7PrimitiveLiteralType;
99
147
  }
100
148
  });
149
+ Object.defineProperty(exports, 'isJsonSchema7StringType', {
150
+ enumerable: true,
151
+ get: function () {
152
+ return isJsonSchema7StringType;
153
+ }
154
+ });
155
+ Object.defineProperty(exports, 'isJsonSchema7TupleType', {
156
+ enumerable: true,
157
+ get: function () {
158
+ return isJsonSchema7TupleType;
159
+ }
160
+ });
101
161
  Object.defineProperty(exports, 'isStandardJsonSchema', {
102
162
  enumerable: true,
103
163
  get: function () {
@@ -1,4 +1,4 @@
1
- import { A as JsonSchema7PrimitiveLiteralType, I as JsonSchema7StringType, O as JsonSchema7ObjectType, R as JsonSchema7Type, b as JsonSchema7LiteralType, f as JsonSchema7AllOfType, h as JsonSchema7ArrayType } from "./types-CPQlxauZ.mjs";
1
+ import { A as JsonSchema7PrimitiveLiteralType, D as JsonSchema7NumberType, I as JsonSchema7StringType, L as JsonSchema7TupleType, O as JsonSchema7ObjectType, R as JsonSchema7Type, _ as JsonSchema7BooleanType, b as JsonSchema7LiteralType, f as JsonSchema7AllOfType, h as JsonSchema7ArrayType } from "./types-BAtAPir9.mjs";
2
2
  import { StandardJSONSchemaV1 } from "@standard-schema/spec";
3
3
 
4
4
  //#region src/schema.d.ts
@@ -9,14 +9,35 @@ import { StandardJSONSchemaV1 } from "@standard-schema/spec";
9
9
  * @param schema - The schema to check
10
10
  * @returns True if the schema is a {@link JsonSchema7AllOfType}, false otherwise
11
11
  */
12
- declare function isJsonSchema7AllOfType(schema: JsonSchema7Type | JsonSchema7StringType): schema is JsonSchema7AllOfType;
12
+ declare function isJsonSchema7AllOfType(schema: JsonSchema7Type): schema is JsonSchema7AllOfType;
13
13
  /**
14
14
  * Type guard for {@link JsonSchema7ObjectType}
15
15
  *
16
16
  * @param schema - The schema to check
17
17
  * @returns True if the schema is a {@link JsonSchema7ObjectType}, false otherwise
18
18
  */
19
- declare function isJsonSchema7ObjectType(schema: JsonSchema7Type | JsonSchema7StringType): schema is JsonSchema7ObjectType;
19
+ declare function isJsonSchema7ObjectType(schema: JsonSchema7Type): schema is JsonSchema7ObjectType;
20
+ /**
21
+ * Type guard for {@link JsonSchema7StringType}
22
+ *
23
+ * @param schema - The schema to check
24
+ * @returns True if the schema is a {@link JsonSchema7StringType}, false otherwise
25
+ */
26
+ declare function isJsonSchema7StringType(schema: JsonSchema7Type): schema is JsonSchema7StringType;
27
+ /**
28
+ * Type guard for {@link JsonSchema7NumberType}
29
+ *
30
+ * @param schema - The schema to check
31
+ * @returns True if the schema is a {@link JsonSchema7NumberType}, false otherwise
32
+ */
33
+ declare function isJsonSchema7NumberType(schema: JsonSchema7Type): schema is JsonSchema7NumberType;
34
+ /**
35
+ * Type guard for {@link JsonSchema7BooleanType}
36
+ *
37
+ * @param schema - The schema to check
38
+ * @returns True if the schema is a {@link JsonSchema7BooleanType}, false otherwise
39
+ */
40
+ declare function isJsonSchema7BooleanType(schema: JsonSchema7Type): schema is JsonSchema7BooleanType;
20
41
  /**
21
42
  * Type guard for {@link JsonSchema7ArrayType}
22
43
  *
@@ -24,6 +45,13 @@ declare function isJsonSchema7ObjectType(schema: JsonSchema7Type | JsonSchema7St
24
45
  * @returns True if the schema is a {@link JsonSchema7ArrayType}, false otherwise
25
46
  */
26
47
  declare function isJsonSchema7ArrayType(schema: JsonSchema7Type): schema is JsonSchema7ArrayType;
48
+ /**
49
+ * Type guard for {@link JsonSchema7TupleType}
50
+ *
51
+ * @param schema - The schema to check
52
+ * @returns True if the schema is a {@link JsonSchema7TupleType}, false otherwise
53
+ */
54
+ declare function isJsonSchema7TupleType(schema: JsonSchema7Type): schema is JsonSchema7TupleType;
27
55
  /**
28
56
  * Type guard for {@link JsonSchema7PrimitiveLiteralType}
29
57
  *
@@ -51,5 +79,5 @@ declare function isJsonSchema7LiteralType(schema: JsonSchema7Type): schema is Js
51
79
  */
52
80
  declare function isStandardJsonSchema<Input = unknown, Output = Input>(value: any): value is StandardJSONSchemaV1<Input, Output>;
53
81
  //#endregion
54
- export { isJsonSchema7PrimitiveLiteralType as a, isJsonSchema7ObjectType as i, isJsonSchema7ArrayType as n, isStandardJsonSchema as o, isJsonSchema7LiteralType as r, isJsonSchema7AllOfType as t };
55
- //# sourceMappingURL=schema-CmH1V_uI.d.mts.map
82
+ export { isJsonSchema7NumberType as a, isJsonSchema7StringType as c, isJsonSchema7LiteralType as i, isJsonSchema7TupleType as l, isJsonSchema7ArrayType as n, isJsonSchema7ObjectType as o, isJsonSchema7BooleanType as r, isJsonSchema7PrimitiveLiteralType as s, isJsonSchema7AllOfType as t, isStandardJsonSchema as u };
83
+ //# sourceMappingURL=schema-D5wPTiM4.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-D5wPTiM4.d.mts","names":[],"sources":["../src/schema.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;AAgBA;AAgBA;AAYA;AAcgB,iBA1DA,sBAAA,CA2DN,MAAA,EA1DA,eA2DG,CAAA,EAAA,MAAA,IA1DA,oBA0DsB;AAUnC;AAYA;AAiBA;AAwBA;AAyBA;;AAEiC,iBAtIjB,uBAAA,CAsIiB,MAAA,EArIvB,eAqIuB,CAAA,EAAA,MAAA,IApIpB,qBAoIoB;;;;;;;iBAtHjB,uBAAA,SACN,4BACG;;;;;;;iBAUG,uBAAA,SACN,4BACG;;;;;;;iBAYG,wBAAA,SACN,4BACG;;;;;;;iBAUG,sBAAA,SACN,4BACG;;;;;;;iBAUG,sBAAA,SACN,4BACG;;;;;;;iBAeG,iCAAA,SACN,4BACG;;;;;;;iBAsBG,wBAAA,SACN,4BACG;;;;;;;;;;;;iBAuBG,+CAA+C,6BAEnD,qBAAqB,OAAO"}
package/dist/schema.cjs CHANGED
@@ -1,8 +1,12 @@
1
- const require_schema = require('./schema-Dl018Aq4.cjs');
1
+ const require_schema = require('./schema-CwyRhvHe.cjs');
2
2
 
3
3
  exports.isJsonSchema7AllOfType = require_schema.isJsonSchema7AllOfType;
4
4
  exports.isJsonSchema7ArrayType = require_schema.isJsonSchema7ArrayType;
5
+ exports.isJsonSchema7BooleanType = require_schema.isJsonSchema7BooleanType;
5
6
  exports.isJsonSchema7LiteralType = require_schema.isJsonSchema7LiteralType;
7
+ exports.isJsonSchema7NumberType = require_schema.isJsonSchema7NumberType;
6
8
  exports.isJsonSchema7ObjectType = require_schema.isJsonSchema7ObjectType;
7
9
  exports.isJsonSchema7PrimitiveLiteralType = require_schema.isJsonSchema7PrimitiveLiteralType;
10
+ exports.isJsonSchema7StringType = require_schema.isJsonSchema7StringType;
11
+ exports.isJsonSchema7TupleType = require_schema.isJsonSchema7TupleType;
8
12
  exports.isStandardJsonSchema = require_schema.isStandardJsonSchema;
package/dist/schema.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as isJsonSchema7PrimitiveLiteralType, i as isJsonSchema7ObjectType, n as isJsonSchema7ArrayType, o as isStandardJsonSchema, r as isJsonSchema7LiteralType, t as isJsonSchema7AllOfType } from "./schema-BO1HCrxv.cjs";
2
- export { isJsonSchema7AllOfType, isJsonSchema7ArrayType, isJsonSchema7LiteralType, isJsonSchema7ObjectType, isJsonSchema7PrimitiveLiteralType, isStandardJsonSchema };
1
+ import { a as isJsonSchema7NumberType, c as isJsonSchema7StringType, i as isJsonSchema7LiteralType, l as isJsonSchema7TupleType, n as isJsonSchema7ArrayType, o as isJsonSchema7ObjectType, r as isJsonSchema7BooleanType, s as isJsonSchema7PrimitiveLiteralType, t as isJsonSchema7AllOfType, u as isStandardJsonSchema } from "./schema-CuBX00tF.cjs";
2
+ export { isJsonSchema7AllOfType, isJsonSchema7ArrayType, isJsonSchema7BooleanType, isJsonSchema7LiteralType, isJsonSchema7NumberType, isJsonSchema7ObjectType, isJsonSchema7PrimitiveLiteralType, isJsonSchema7StringType, isJsonSchema7TupleType, isStandardJsonSchema };
package/dist/schema.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import "./types-CPQlxauZ.mjs";
2
- import { a as isJsonSchema7PrimitiveLiteralType, i as isJsonSchema7ObjectType, n as isJsonSchema7ArrayType, o as isStandardJsonSchema, r as isJsonSchema7LiteralType, t as isJsonSchema7AllOfType } from "./schema-CmH1V_uI.mjs";
3
- export { isJsonSchema7AllOfType, isJsonSchema7ArrayType, isJsonSchema7LiteralType, isJsonSchema7ObjectType, isJsonSchema7PrimitiveLiteralType, isStandardJsonSchema };
1
+ import "./types-BAtAPir9.mjs";
2
+ import { a as isJsonSchema7NumberType, c as isJsonSchema7StringType, i as isJsonSchema7LiteralType, l as isJsonSchema7TupleType, n as isJsonSchema7ArrayType, o as isJsonSchema7ObjectType, r as isJsonSchema7BooleanType, s as isJsonSchema7PrimitiveLiteralType, t as isJsonSchema7AllOfType, u as isStandardJsonSchema } from "./schema-D5wPTiM4.mjs";
3
+ export { isJsonSchema7AllOfType, isJsonSchema7ArrayType, isJsonSchema7BooleanType, isJsonSchema7LiteralType, isJsonSchema7NumberType, isJsonSchema7ObjectType, isJsonSchema7PrimitiveLiteralType, isJsonSchema7StringType, isJsonSchema7TupleType, isStandardJsonSchema };
package/dist/schema.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as isJsonSchema7PrimitiveLiteralType, i as isJsonSchema7ObjectType, n as isJsonSchema7ArrayType, o as isStandardJsonSchema, r as isJsonSchema7LiteralType, t as isJsonSchema7AllOfType } from "./schema-DGmzxHja.mjs";
1
+ import { a as isJsonSchema7NumberType, c as isJsonSchema7StringType, i as isJsonSchema7LiteralType, l as isJsonSchema7TupleType, n as isJsonSchema7ArrayType, o as isJsonSchema7ObjectType, r as isJsonSchema7BooleanType, s as isJsonSchema7PrimitiveLiteralType, t as isJsonSchema7AllOfType, u as isStandardJsonSchema } from "./schema-CMt54x11.mjs";
2
2
 
3
- export { isJsonSchema7AllOfType, isJsonSchema7ArrayType, isJsonSchema7LiteralType, isJsonSchema7ObjectType, isJsonSchema7PrimitiveLiteralType, isStandardJsonSchema };
3
+ export { isJsonSchema7AllOfType, isJsonSchema7ArrayType, isJsonSchema7BooleanType, isJsonSchema7LiteralType, isJsonSchema7NumberType, isJsonSchema7ObjectType, isJsonSchema7PrimitiveLiteralType, isJsonSchema7StringType, isJsonSchema7TupleType, isStandardJsonSchema };
@@ -25,11 +25,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
- const require_is_object = require('./is-object-umGh91v1.cjs');
29
- const require_is_string = require('./is-string-C2RK4Gjs.cjs');
30
- const require_parse = require('./parse-ByDxRup5.cjs');
31
- const require_parse_error = require('./parse-error-N7UE-HMh.cjs');
32
- const require_stringify = require('./stringify-BehjrfhS.cjs');
28
+ const require_is_object = require('./is-object-BbRMEXAo.cjs');
29
+ const require_is_string = require('./is-string-yY-B30hL.cjs');
30
+ const require_parse = require('./parse-CX9jPskm.cjs');
31
+ const require_parse_error = require('./parse-error-CUOf-YBA.cjs');
32
+ const require_stringify = require('./stringify-DQOBApRO.cjs');
33
33
  let jsonc_parser = require("jsonc-parser");
34
34
  let node_buffer = require("node:buffer");
35
35
  let superjson = require("superjson");
@@ -1,8 +1,8 @@
1
- import { t as isObject } from "./is-object-BpfmzHWa.mjs";
2
- import { t as isString } from "./is-string-CLiBUSKV.mjs";
3
- import { t as parse$1 } from "./parse-Dn43ZK9y.mjs";
4
- import { t as formatParseError } from "./parse-error-Af4zHUQ_.mjs";
5
- import { n as stringify } from "./stringify-CYHjAvWm.mjs";
1
+ import { t as isObject } from "./is-object-BYxzKTYU.mjs";
2
+ import { t as isString } from "./is-string--ny35huw.mjs";
3
+ import { t as parse$1 } from "./parse-BrChHTWb.mjs";
4
+ import { t as formatParseError } from "./parse-error-Cu6mjBS7.mjs";
5
+ import { n as stringify } from "./stringify-CfeAVjh8.mjs";
6
6
  import { parse } from "jsonc-parser";
7
7
  import { Buffer } from "node:buffer";
8
8
  import SuperJSON from "superjson";
@@ -113,4 +113,4 @@ StormJSON.instance.registerCustom({
113
113
 
114
114
  //#endregion
115
115
  export { StormJSON as t };
116
- //# sourceMappingURL=storm-json-nkhJgTz4.mjs.map
116
+ //# sourceMappingURL=storm-json-BmO91crX.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"storm-json-nkhJgTz4.mjs","names":["#instance","parseValue","stringifyValue","errors: ParseError[]"],"sources":["../src/storm-json.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ParseError } from \"jsonc-parser\";\nimport type {\n Class,\n JsonParseOptions,\n JsonParserResult,\n JsonSerializeOptions,\n JsonValue\n} from \"./types\";\n// import { Decimal } from \"decimal.js\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { parse } from \"jsonc-parser\";\nimport { Buffer } from \"node:buffer\";\nimport SuperJSON from \"superjson\";\nimport { parse as parseValue } from \"./utils/parse\";\nimport { formatParseError } from \"./utils/parse-error\";\nimport { stringify as stringifyValue } from \"./utils/stringify\";\n\n/**\n * A static JSON parser class used by Storm Software to serialize and deserialize JSON data\n *\n * @remarks\n * This class uses the [SuperJSON](https://github.com/blitz-js/superjson) library under the hood.\n */\nexport class StormJSON extends SuperJSON {\n static #instance: StormJSON;\n\n public static get instance(): StormJSON {\n if (!StormJSON.#instance) {\n StormJSON.#instance = new StormJSON();\n }\n\n return StormJSON.#instance;\n }\n\n /**\n * Deserialize the given value with superjson using the given metadata\n */\n public static override deserialize<TData = unknown>(\n payload: JsonParserResult\n ): TData {\n return StormJSON.instance.deserialize(payload);\n }\n\n /**\n * Serialize the given value with superjson\n */\n public static override serialize(object: JsonValue): JsonParserResult {\n return StormJSON.instance.serialize(object);\n }\n\n /**\n * Parse the given string value with superjson using the given metadata\n *\n * @param value - The string value to parse\n * @returns The parsed data\n */\n public static override parse<TData = unknown>(value: string): TData {\n return parseValue(value);\n }\n\n /**\n * Serializes the given data to a JSON string.\n * By default the JSON string is formatted with a 2 space indentation to be easy readable.\n *\n * @param value - Object which should be serialized to JSON\n * @param options - JSON serialize options\n * @returns the formatted JSON representation of the object\n */\n public static override stringify<T>(\n value: T,\n options?: JsonSerializeOptions\n ): string {\n const customTransformer =\n StormJSON.instance.customTransformerRegistry.findApplicable(value);\n\n let result = value;\n if (customTransformer && customTransformer.isApplicable(value)) {\n result = customTransformer.serialize(result) as T;\n }\n\n return stringifyValue(result, options?.spaces ?? 2);\n }\n\n /**\n * Parses the given JSON string and returns the object the JSON content represents.\n * By default javascript-style comments and trailing commas are allowed.\n *\n * @param strData - JSON content as string\n * @param options - JSON parse options\n * @returns Object the JSON content represents\n */\n public static parseJson<TData = unknown>(\n strData: string,\n options?: JsonParseOptions\n ): TData {\n try {\n if (options?.expectComments === false) {\n return StormJSON.instance.parse(strData);\n }\n } catch {\n // Do nothing\n }\n\n const errors: ParseError[] = [];\n const opts = {\n allowTrailingComma: true,\n ...options\n };\n const result = parse(strData, errors, opts) as TData;\n\n if (errors.length > 0 && errors[0]) {\n throw new Error(formatParseError(strData, errors[0]));\n }\n\n return result;\n }\n\n /**\n * Register a custom schema with superjson\n *\n * @param name - The name of the schema\n * @param serialize - The function to serialize the schema\n * @param deserialize - The function to deserialize the schema\n * @param isApplicable - The function to check if the schema is applicable\n */\n public static register<\n TData = any,\n TJsonObject extends JsonValue = JsonValue\n >(\n name: string,\n serialize: (data: TData) => TJsonObject,\n deserialize: (json: TJsonObject) => TData,\n isApplicable: (data: any) => data is TData\n ) {\n StormJSON.instance.registerCustom<TData, TJsonObject>(\n {\n isApplicable,\n serialize,\n deserialize\n },\n name\n );\n }\n\n /**\n * Register a class with superjson\n *\n * @param classConstructor - The class constructor to register\n */\n public static override registerClass(\n classConstructor: Class,\n options?: { identifier?: string; allowProps?: string[] } | string\n ) {\n StormJSON.instance.registerClass(classConstructor, {\n identifier: isString(options)\n ? options\n : options?.identifier || classConstructor.name,\n allowProps:\n options &&\n isObject(options) &&\n options?.allowProps &&\n Array.isArray(options.allowProps)\n ? options.allowProps\n : [\"__typename\"]\n });\n }\n\n private constructor() {\n super({ dedupe: true });\n }\n}\n\nStormJSON.instance.registerCustom<Buffer, string>(\n {\n isApplicable: (v): v is Buffer =>\n typeof Buffer.isBuffer === \"function\" && Buffer.isBuffer(v),\n serialize: v => v.toString(\"base64\"),\n deserialize: v => Buffer.from(v, \"base64\")\n },\n \"Bytes\"\n);\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,IAAa,YAAb,MAAa,kBAAkB,UAAU;CACvC,QAAOA;CAEP,WAAkB,WAAsB;AACtC,MAAI,CAAC,WAAUA,SACb,YAAUA,WAAY,IAAI,WAAW;AAGvC,SAAO,WAAUA;;;;;CAMnB,OAAuB,YACrB,SACO;AACP,SAAO,UAAU,SAAS,YAAY,QAAQ;;;;;CAMhD,OAAuB,UAAU,QAAqC;AACpE,SAAO,UAAU,SAAS,UAAU,OAAO;;;;;;;;CAS7C,OAAuB,MAAuB,OAAsB;AAClE,SAAOC,QAAW,MAAM;;;;;;;;;;CAW1B,OAAuB,UACrB,OACA,SACQ;EACR,MAAM,oBACJ,UAAU,SAAS,0BAA0B,eAAe,MAAM;EAEpE,IAAI,SAAS;AACb,MAAI,qBAAqB,kBAAkB,aAAa,MAAM,CAC5D,UAAS,kBAAkB,UAAU,OAAO;AAG9C,SAAOC,UAAe,QAAQ,SAAS,UAAU,EAAE;;;;;;;;;;CAWrD,OAAc,UACZ,SACA,SACO;AACP,MAAI;AACF,OAAI,SAAS,mBAAmB,MAC9B,QAAO,UAAU,SAAS,MAAM,QAAQ;UAEpC;EAIR,MAAMC,SAAuB,EAAE;EAK/B,MAAM,SAAS,MAAM,SAAS,QAJjB;GACX,oBAAoB;GACpB,GAAG;GACJ,CAC0C;AAE3C,MAAI,OAAO,SAAS,KAAK,OAAO,GAC9B,OAAM,IAAI,MAAM,iBAAiB,SAAS,OAAO,GAAG,CAAC;AAGvD,SAAO;;;;;;;;;;CAWT,OAAc,SAIZ,MACA,WACA,aACA,cACA;AACA,YAAU,SAAS,eACjB;GACE;GACA;GACA;GACD,EACD,KACD;;;;;;;CAQH,OAAuB,cACrB,kBACA,SACA;AACA,YAAU,SAAS,cAAc,kBAAkB;GACjD,YAAY,SAAS,QAAQ,GACzB,UACA,SAAS,cAAc,iBAAiB;GAC5C,YACE,WACA,SAAS,QAAQ,IACjB,SAAS,cACT,MAAM,QAAQ,QAAQ,WAAW,GAC7B,QAAQ,aACR,CAAC,aAAa;GACrB,CAAC;;CAGJ,AAAQ,cAAc;AACpB,QAAM,EAAE,QAAQ,MAAM,CAAC;;;AAI3B,UAAU,SAAS,eACjB;CACE,eAAe,MACb,OAAO,OAAO,aAAa,cAAc,OAAO,SAAS,EAAE;CAC7D,YAAW,MAAK,EAAE,SAAS,SAAS;CACpC,cAAa,MAAK,OAAO,KAAK,GAAG,SAAS;CAC3C,EACD,QACD"}
1
+ {"version":3,"file":"storm-json-BmO91crX.mjs","names":["#instance","parseValue","stringifyValue","errors: ParseError[]"],"sources":["../src/storm-json.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ParseError } from \"jsonc-parser\";\nimport type {\n Class,\n JsonParseOptions,\n JsonParserResult,\n JsonSerializeOptions,\n JsonValue\n} from \"./types\";\n// import { Decimal } from \"decimal.js\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { parse } from \"jsonc-parser\";\nimport { Buffer } from \"node:buffer\";\nimport SuperJSON from \"superjson\";\nimport { parse as parseValue } from \"./utils/parse\";\nimport { formatParseError } from \"./utils/parse-error\";\nimport { stringify as stringifyValue } from \"./utils/stringify\";\n\n/**\n * A static JSON parser class used by Storm Software to serialize and deserialize JSON data\n *\n * @remarks\n * This class uses the [SuperJSON](https://github.com/blitz-js/superjson) library under the hood.\n */\nexport class StormJSON extends SuperJSON {\n static #instance: StormJSON;\n\n public static get instance(): StormJSON {\n if (!StormJSON.#instance) {\n StormJSON.#instance = new StormJSON();\n }\n\n return StormJSON.#instance;\n }\n\n /**\n * Deserialize the given value with superjson using the given metadata\n */\n public static override deserialize<TData = unknown>(\n payload: JsonParserResult\n ): TData {\n return StormJSON.instance.deserialize(payload);\n }\n\n /**\n * Serialize the given value with superjson\n */\n public static override serialize(object: JsonValue): JsonParserResult {\n return StormJSON.instance.serialize(object);\n }\n\n /**\n * Parse the given string value with superjson using the given metadata\n *\n * @param value - The string value to parse\n * @returns The parsed data\n */\n public static override parse<TData = unknown>(value: string): TData {\n return parseValue(value);\n }\n\n /**\n * Serializes the given data to a JSON string.\n * By default the JSON string is formatted with a 2 space indentation to be easy readable.\n *\n * @param value - Object which should be serialized to JSON\n * @param options - JSON serialize options\n * @returns the formatted JSON representation of the object\n */\n public static override stringify<T>(\n value: T,\n options?: JsonSerializeOptions\n ): string {\n const customTransformer =\n StormJSON.instance.customTransformerRegistry.findApplicable(value);\n\n let result = value;\n if (customTransformer && customTransformer.isApplicable(value)) {\n result = customTransformer.serialize(result) as T;\n }\n\n return stringifyValue(result, options?.spaces ?? 2);\n }\n\n /**\n * Parses the given JSON string and returns the object the JSON content represents.\n * By default javascript-style comments and trailing commas are allowed.\n *\n * @param strData - JSON content as string\n * @param options - JSON parse options\n * @returns Object the JSON content represents\n */\n public static parseJson<TData = unknown>(\n strData: string,\n options?: JsonParseOptions\n ): TData {\n try {\n if (options?.expectComments === false) {\n return StormJSON.instance.parse(strData);\n }\n } catch {\n // Do nothing\n }\n\n const errors: ParseError[] = [];\n const opts = {\n allowTrailingComma: true,\n ...options\n };\n const result = parse(strData, errors, opts) as TData;\n\n if (errors.length > 0 && errors[0]) {\n throw new Error(formatParseError(strData, errors[0]));\n }\n\n return result;\n }\n\n /**\n * Register a custom schema with superjson\n *\n * @param name - The name of the schema\n * @param serialize - The function to serialize the schema\n * @param deserialize - The function to deserialize the schema\n * @param isApplicable - The function to check if the schema is applicable\n */\n public static register<\n TData = any,\n TJsonObject extends JsonValue = JsonValue\n >(\n name: string,\n serialize: (data: TData) => TJsonObject,\n deserialize: (json: TJsonObject) => TData,\n isApplicable: (data: any) => data is TData\n ) {\n StormJSON.instance.registerCustom<TData, TJsonObject>(\n {\n isApplicable,\n serialize,\n deserialize\n },\n name\n );\n }\n\n /**\n * Register a class with superjson\n *\n * @param classConstructor - The class constructor to register\n */\n public static override registerClass(\n classConstructor: Class,\n options?: { identifier?: string; allowProps?: string[] } | string\n ) {\n StormJSON.instance.registerClass(classConstructor, {\n identifier: isString(options)\n ? options\n : options?.identifier || classConstructor.name,\n allowProps:\n options &&\n isObject(options) &&\n options?.allowProps &&\n Array.isArray(options.allowProps)\n ? options.allowProps\n : [\"__typename\"]\n });\n }\n\n private constructor() {\n super({ dedupe: true });\n }\n}\n\nStormJSON.instance.registerCustom<Buffer, string>(\n {\n isApplicable: (v): v is Buffer =>\n typeof Buffer.isBuffer === \"function\" && Buffer.isBuffer(v),\n serialize: v => v.toString(\"base64\"),\n deserialize: v => Buffer.from(v, \"base64\")\n },\n \"Bytes\"\n);\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,IAAa,YAAb,MAAa,kBAAkB,UAAU;CACvC,QAAOA;CAEP,WAAkB,WAAsB;AACtC,MAAI,CAAC,WAAUA,SACb,YAAUA,WAAY,IAAI,WAAW;AAGvC,SAAO,WAAUA;;;;;CAMnB,OAAuB,YACrB,SACO;AACP,SAAO,UAAU,SAAS,YAAY,QAAQ;;;;;CAMhD,OAAuB,UAAU,QAAqC;AACpE,SAAO,UAAU,SAAS,UAAU,OAAO;;;;;;;;CAS7C,OAAuB,MAAuB,OAAsB;AAClE,SAAOC,QAAW,MAAM;;;;;;;;;;CAW1B,OAAuB,UACrB,OACA,SACQ;EACR,MAAM,oBACJ,UAAU,SAAS,0BAA0B,eAAe,MAAM;EAEpE,IAAI,SAAS;AACb,MAAI,qBAAqB,kBAAkB,aAAa,MAAM,CAC5D,UAAS,kBAAkB,UAAU,OAAO;AAG9C,SAAOC,UAAe,QAAQ,SAAS,UAAU,EAAE;;;;;;;;;;CAWrD,OAAc,UACZ,SACA,SACO;AACP,MAAI;AACF,OAAI,SAAS,mBAAmB,MAC9B,QAAO,UAAU,SAAS,MAAM,QAAQ;UAEpC;EAIR,MAAMC,SAAuB,EAAE;EAK/B,MAAM,SAAS,MAAM,SAAS,QAJjB;GACX,oBAAoB;GACpB,GAAG;GACJ,CAC0C;AAE3C,MAAI,OAAO,SAAS,KAAK,OAAO,GAC9B,OAAM,IAAI,MAAM,iBAAiB,SAAS,OAAO,GAAG,CAAC;AAGvD,SAAO;;;;;;;;;;CAWT,OAAc,SAIZ,MACA,WACA,aACA,cACA;AACA,YAAU,SAAS,eACjB;GACE;GACA;GACA;GACD,EACD,KACD;;;;;;;CAQH,OAAuB,cACrB,kBACA,SACA;AACA,YAAU,SAAS,cAAc,kBAAkB;GACjD,YAAY,SAAS,QAAQ,GACzB,UACA,SAAS,cAAc,iBAAiB;GAC5C,YACE,WACA,SAAS,QAAQ,IACjB,SAAS,cACT,MAAM,QAAQ,QAAQ,WAAW,GAC7B,QAAQ,aACR,CAAC,aAAa;GACrB,CAAC;;CAGJ,AAAQ,cAAc;AACpB,QAAM,EAAE,QAAQ,MAAM,CAAC;;;AAI3B,UAAU,SAAS,eACjB;CACE,eAAe,MACb,OAAO,OAAO,aAAa,cAAc,OAAO,SAAS,EAAE;CAC7D,YAAW,MAAK,EAAE,SAAS,SAAS;CACpC,cAAa,MAAK,OAAO,KAAK,GAAG,SAAS;CAC3C,EACD,QACD"}
@@ -1,4 +1,4 @@
1
- import { U as JsonSerializeOptions, W as JsonValue, d as JsonParserResult, l as JsonParseOptions, t as Class } from "./types-CPQlxauZ.mjs";
1
+ import { U as JsonSerializeOptions, W as JsonValue, d as JsonParserResult, l as JsonParseOptions, t as Class } from "./types-BAtAPir9.mjs";
2
2
  import SuperJSON from "superjson";
3
3
 
4
4
  //#region src/storm-json.d.ts
@@ -67,4 +67,4 @@ declare class StormJSON extends SuperJSON {
67
67
  }
68
68
  //#endregion
69
69
  export { StormJSON as t };
70
- //# sourceMappingURL=storm-json-8F9CKpXu.d.mts.map
70
+ //# sourceMappingURL=storm-json-DJwb3Ou-.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storm-json-8F9CKpXu.d.mts","names":[],"sources":["../src/storm-json.ts"],"sourcesContent":[],"mappings":";;;;;;;AA0CA;;;;AAuB2C,cAvB9B,SAAA,SAAkB,SAAA,CAuBY;EAAY,CAAA,OAAA;EAUS,WAAA,QAAA,CAAA,CAAA,EA9BhC,SA8BgC;EAarD;;;EAyBN,OAAA,WAAA,CAAA,QAAA,OAAA,CAAA,CAAA,OAAA,EAxDQ,gBAwDR,CAAA,EAvDA,KAuDA;EAiCmB;;;EAGQ,OAAA,SAAA,CAAA,MAAA,EApFW,SAoFX,CAAA,EApFuB,gBAoFvB;EACR;;;;;;gDA3EwC;;;;;;;;;6BAarD,aACG;;;;;;;;;+DAuBA,mBACT;;;;;;;;;mDAiCmB,YAAY,2CAGd,UAAU,iCACR,gBAAgB,4CACC;;;;;;yCAkBnB"}
1
+ {"version":3,"file":"storm-json-DJwb3Ou-.d.mts","names":[],"sources":["../src/storm-json.ts"],"sourcesContent":[],"mappings":";;;;;;;AA0CA;;;;AAuB2C,cAvB9B,SAAA,SAAkB,SAAA,CAuBY;EAAY,CAAA,OAAA;EAUS,WAAA,QAAA,CAAA,CAAA,EA9BhC,SA8BgC;EAarD;;;EAyBN,OAAA,WAAA,CAAA,QAAA,OAAA,CAAA,CAAA,OAAA,EAxDQ,gBAwDR,CAAA,EAvDA,KAuDA;EAiCmB;;;EAGQ,OAAA,SAAA,CAAA,MAAA,EApFW,SAoFX,CAAA,EApFuB,gBAoFvB;EACR;;;;;;gDA3EwC;;;;;;;;;6BAarD,aACG;;;;;;;;;+DAuBA,mBACT;;;;;;;;;mDAiCmB,YAAY,2CAGd,UAAU,iCACR,gBAAgB,4CACC;;;;;;yCAkBnB"}
@@ -1,4 +1,4 @@
1
- import { U as JsonSerializeOptions, W as JsonValue, d as JsonParserResult, l as JsonParseOptions, t as Class } from "./types-Bn8rC098.cjs";
1
+ import { U as JsonSerializeOptions, W as JsonValue, d as JsonParserResult, l as JsonParseOptions, t as Class } from "./types-BzNIRhpI.cjs";
2
2
  import SuperJSON from "superjson";
3
3
 
4
4
  //#region src/storm-json.d.ts
@@ -67,4 +67,4 @@ declare class StormJSON extends SuperJSON {
67
67
  }
68
68
  //#endregion
69
69
  export { StormJSON as t };
70
- //# sourceMappingURL=storm-json-DvIEWMEH.d.cts.map
70
+ //# sourceMappingURL=storm-json-DiBg5b6r.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storm-json-DvIEWMEH.d.cts","names":[],"sources":["../src/storm-json.ts"],"sourcesContent":[],"mappings":";;;;;;;AA0CA;;;;AAuB2C,cAvB9B,SAAA,SAAkB,SAAA,CAuBY;EAAY,CAAA,OAAA;EAUS,WAAA,QAAA,CAAA,CAAA,EA9BhC,SA8BgC;EAarD;;;EAyBN,OAAA,WAAA,CAAA,QAAA,OAAA,CAAA,CAAA,OAAA,EAxDQ,gBAwDR,CAAA,EAvDA,KAuDA;EAiCmB;;;EAGQ,OAAA,SAAA,CAAA,MAAA,EApFW,SAoFX,CAAA,EApFuB,gBAoFvB;EACR;;;;;;gDA3EwC;;;;;;;;;6BAarD,aACG;;;;;;;;;+DAuBA,mBACT;;;;;;;;;mDAiCmB,YAAY,2CAGd,UAAU,iCACR,gBAAgB,4CACC;;;;;;yCAkBnB"}
1
+ {"version":3,"file":"storm-json-DiBg5b6r.d.cts","names":[],"sources":["../src/storm-json.ts"],"sourcesContent":[],"mappings":";;;;;;;AA0CA;;;;AAuB2C,cAvB9B,SAAA,SAAkB,SAAA,CAuBY;EAAY,CAAA,OAAA;EAUS,WAAA,QAAA,CAAA,CAAA,EA9BhC,SA8BgC;EAarD;;;EAyBN,OAAA,WAAA,CAAA,QAAA,OAAA,CAAA,CAAA,OAAA,EAxDQ,gBAwDR,CAAA,EAvDA,KAuDA;EAiCmB;;;EAGQ,OAAA,SAAA,CAAA,MAAA,EApFW,SAoFX,CAAA,EApFuB,gBAoFvB;EACR;;;;;;gDA3EwC;;;;;;;;;6BAarD,aACG;;;;;;;;;+DAuBA,mBACT;;;;;;;;;mDAiCmB,YAAY,2CAGd,UAAU,iCACR,gBAAgB,4CACC;;;;;;yCAkBnB"}
@@ -1,4 +1,4 @@
1
- const require_storm_json = require('./storm-json-BD6WFbrI.cjs');
2
- require('./parse-error-N7UE-HMh.cjs');
1
+ const require_storm_json = require('./storm-json-BDPXNC_u.cjs');
2
+ require('./parse-error-CUOf-YBA.cjs');
3
3
 
4
4
  exports.StormJSON = require_storm_json.StormJSON;
@@ -1,2 +1,2 @@
1
- import { t as StormJSON } from "./storm-json-DvIEWMEH.cjs";
1
+ import { t as StormJSON } from "./storm-json-DiBg5b6r.cjs";
2
2
  export { StormJSON };
@@ -1,3 +1,3 @@
1
- import "./types-CPQlxauZ.mjs";
2
- import { t as StormJSON } from "./storm-json-8F9CKpXu.mjs";
1
+ import "./types-BAtAPir9.mjs";
2
+ import { t as StormJSON } from "./storm-json-DJwb3Ou-.mjs";
3
3
  export { StormJSON };
@@ -1,4 +1,4 @@
1
- import "./parse-error-Af4zHUQ_.mjs";
2
- import { t as StormJSON } from "./storm-json-nkhJgTz4.mjs";
1
+ import "./parse-error-Cu6mjBS7.mjs";
2
+ import { t as StormJSON } from "./storm-json-BmO91crX.mjs";
3
3
 
4
4
  export { StormJSON };
@@ -1,5 +1,5 @@
1
- import { t as isNumber } from "./is-number-BIwzZzyi.mjs";
2
- import { t as isUndefined } from "./is-undefined-CmyJWYGD.mjs";
1
+ import { t as isNumber } from "./is-number-BMxmACAS.mjs";
2
+ import { t as isUndefined } from "./is-undefined-CqNzBssC.mjs";
3
3
 
4
4
  //#region src/utils/stringify.ts
5
5
  const invalidKeyChars = [
@@ -65,4 +65,4 @@ const stringify = (value, spacing = 2) => {
65
65
 
66
66
  //#endregion
67
67
  export { stringify as n, invalidKeyChars as t };
68
- //# sourceMappingURL=stringify-CYHjAvWm.mjs.map
68
+ //# sourceMappingURL=stringify-CfeAVjh8.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"stringify-CYHjAvWm.mjs","names":[],"sources":["../src/utils/stringify.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport const invalidKeyChars = [\n \"@\",\n \"/\",\n \"#\",\n \"$\",\n \" \",\n \":\",\n \";\",\n \",\",\n \".\",\n \"!\",\n \"?\",\n \"&\",\n \"=\",\n \"+\",\n \"-\",\n \"*\",\n \"%\",\n \"^\",\n \"~\",\n \"|\",\n \"\\\\\",\n '\"',\n \"'\",\n \"`\",\n \"{\",\n \"}\",\n \"[\",\n \"]\",\n \"(\",\n \")\",\n \"<\",\n \">\"\n] as const;\n\n/**\n * Stringify a value to a JSON-like string.\n *\n * @param value - The value to stringify\n * @param spacing - The spacing to use for the stringification\n * @returns The stringified value\n */\nexport const stringify = (\n value: unknown,\n spacing: string | number = 2\n): string => {\n const space = isNumber(spacing) ? \" \".repeat(spacing) : spacing;\n\n switch (value) {\n case null: {\n return \"null\";\n }\n case undefined: {\n return '\"undefined\"';\n }\n case true: {\n return \"true\";\n }\n case false: {\n return \"false\";\n }\n case Number.POSITIVE_INFINITY: {\n return \"infinity\";\n }\n case Number.NEGATIVE_INFINITY: {\n return \"-infinity\";\n }\n }\n\n if (Array.isArray(value)) {\n return `[${space}${value.map(v => stringify(v, space)).join(`,${space}`)}${space}]`;\n }\n if (value instanceof Uint8Array) {\n return value.toString();\n }\n\n // eslint-disable-next-line ts/switch-exhaustiveness-check\n switch (typeof value) {\n case \"number\": {\n return `${value}`;\n }\n case \"string\": {\n return JSON.stringify(value);\n }\n case \"object\": {\n const keys = Object.keys(value as object).filter(\n key => !isUndefined((value as any)[key])\n );\n\n return `{${space}${keys\n .map(\n key =>\n `${invalidKeyChars.some(invalidKeyChar => key.includes(invalidKeyChar)) ? `\"${key}\"` : key}: ${space}${stringify((value as any)[key], space)}`\n )\n .join(`,${space}`)}${space}}`;\n }\n default:\n return \"null\";\n }\n};\n"],"mappings":";;;;AAqBA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;AASD,MAAa,aACX,OACA,UAA2B,MAChB;CACX,MAAM,QAAQ,SAAS,QAAQ,GAAG,IAAI,OAAO,QAAQ,GAAG;AAExD,SAAQ,OAAR;EACE,KAAK,KACH,QAAO;EAET,KAAK,OACH,QAAO;EAET,KAAK,KACH,QAAO;EAET,KAAK,MACH,QAAO;EAET,KAAK,OAAO,kBACV,QAAO;EAET,KAAK,OAAO,kBACV,QAAO;;AAIX,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,IAAI,QAAQ,MAAM,KAAI,MAAK,UAAU,GAAG,MAAM,CAAC,CAAC,KAAK,IAAI,QAAQ,GAAG,MAAM;AAEnF,KAAI,iBAAiB,WACnB,QAAO,MAAM,UAAU;AAIzB,SAAQ,OAAO,OAAf;EACE,KAAK,SACH,QAAO,GAAG;EAEZ,KAAK,SACH,QAAO,KAAK,UAAU,MAAM;EAE9B,KAAK,SAKH,QAAO,IAAI,QAJE,OAAO,KAAK,MAAgB,CAAC,QACxC,QAAO,CAAC,YAAa,MAAc,KAAK,CACzC,CAGE,KACC,QACE,GAAG,gBAAgB,MAAK,mBAAkB,IAAI,SAAS,eAAe,CAAC,GAAG,IAAI,IAAI,KAAK,IAAI,IAAI,QAAQ,UAAW,MAAc,MAAM,MAAM,GAC/I,CACA,KAAK,IAAI,QAAQ,GAAG,MAAM;EAE/B,QACE,QAAO"}
1
+ {"version":3,"file":"stringify-CfeAVjh8.mjs","names":[],"sources":["../src/utils/stringify.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport const invalidKeyChars = [\n \"@\",\n \"/\",\n \"#\",\n \"$\",\n \" \",\n \":\",\n \";\",\n \",\",\n \".\",\n \"!\",\n \"?\",\n \"&\",\n \"=\",\n \"+\",\n \"-\",\n \"*\",\n \"%\",\n \"^\",\n \"~\",\n \"|\",\n \"\\\\\",\n '\"',\n \"'\",\n \"`\",\n \"{\",\n \"}\",\n \"[\",\n \"]\",\n \"(\",\n \")\",\n \"<\",\n \">\"\n] as const;\n\n/**\n * Stringify a value to a JSON-like string.\n *\n * @param value - The value to stringify\n * @param spacing - The spacing to use for the stringification\n * @returns The stringified value\n */\nexport const stringify = (\n value: unknown,\n spacing: string | number = 2\n): string => {\n const space = isNumber(spacing) ? \" \".repeat(spacing) : spacing;\n\n switch (value) {\n case null: {\n return \"null\";\n }\n case undefined: {\n return '\"undefined\"';\n }\n case true: {\n return \"true\";\n }\n case false: {\n return \"false\";\n }\n case Number.POSITIVE_INFINITY: {\n return \"infinity\";\n }\n case Number.NEGATIVE_INFINITY: {\n return \"-infinity\";\n }\n }\n\n if (Array.isArray(value)) {\n return `[${space}${value.map(v => stringify(v, space)).join(`,${space}`)}${space}]`;\n }\n if (value instanceof Uint8Array) {\n return value.toString();\n }\n\n // eslint-disable-next-line ts/switch-exhaustiveness-check\n switch (typeof value) {\n case \"number\": {\n return `${value}`;\n }\n case \"string\": {\n return JSON.stringify(value);\n }\n case \"object\": {\n const keys = Object.keys(value as object).filter(\n key => !isUndefined((value as any)[key])\n );\n\n return `{${space}${keys\n .map(\n key =>\n `${invalidKeyChars.some(invalidKeyChar => key.includes(invalidKeyChar)) ? `\"${key}\"` : key}: ${space}${stringify((value as any)[key], space)}`\n )\n .join(`,${space}`)}${space}}`;\n }\n default:\n return \"null\";\n }\n};\n"],"mappings":";;;;AAqBA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;AASD,MAAa,aACX,OACA,UAA2B,MAChB;CACX,MAAM,QAAQ,SAAS,QAAQ,GAAG,IAAI,OAAO,QAAQ,GAAG;AAExD,SAAQ,OAAR;EACE,KAAK,KACH,QAAO;EAET,KAAK,OACH,QAAO;EAET,KAAK,KACH,QAAO;EAET,KAAK,MACH,QAAO;EAET,KAAK,OAAO,kBACV,QAAO;EAET,KAAK,OAAO,kBACV,QAAO;;AAIX,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,IAAI,QAAQ,MAAM,KAAI,MAAK,UAAU,GAAG,MAAM,CAAC,CAAC,KAAK,IAAI,QAAQ,GAAG,MAAM;AAEnF,KAAI,iBAAiB,WACnB,QAAO,MAAM,UAAU;AAIzB,SAAQ,OAAO,OAAf;EACE,KAAK,SACH,QAAO,GAAG;EAEZ,KAAK,SACH,QAAO,KAAK,UAAU,MAAM;EAE9B,KAAK,SAKH,QAAO,IAAI,QAJE,OAAO,KAAK,MAAgB,CAAC,QACxC,QAAO,CAAC,YAAa,MAAc,KAAK,CACzC,CAGE,KACC,QACE,GAAG,gBAAgB,MAAK,mBAAkB,IAAI,SAAS,eAAe,CAAC,GAAG,IAAI,IAAI,KAAK,IAAI,IAAI,QAAQ,UAAW,MAAc,MAAM,MAAM,GAC/I,CACA,KAAK,IAAI,QAAQ,GAAG,MAAM;EAE/B,QACE,QAAO"}
@@ -1,5 +1,5 @@
1
- const require_is_number = require('./is-number-c5xguIbS.cjs');
2
- const require_is_undefined = require('./is-undefined-CnI0qe-z.cjs');
1
+ const require_is_number = require('./is-number-CV8PbAUX.cjs');
2
+ const require_is_undefined = require('./is-undefined-DyZkA263.cjs');
3
3
 
4
4
  //#region src/utils/stringify.ts
5
5
  const invalidKeyChars = [
@@ -10,4 +10,4 @@ declare const invalidKeyChars: readonly ["@", "/", "#", "$", " ", ":", ";", ",",
10
10
  declare const stringify: (value: unknown, spacing?: string | number) => string;
11
11
  //#endregion
12
12
  export { stringify as n, invalidKeyChars as t };
13
- //# sourceMappingURL=stringify-Bc8OkhIr.d.cts.map
13
+ //# sourceMappingURL=stringify-DtMcg2Wy.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify-DtMcg2Wy.d.mts","names":[],"sources":["../src/utils/stringify.ts"],"sourcesContent":[],"mappings":";cAqBa;AAAb;AA0CA;;;;;;cAAa"}
@@ -10,4 +10,4 @@ declare const invalidKeyChars: readonly ["@", "/", "#", "$", " ", ":", ";", ",",
10
10
  declare const stringify: (value: unknown, spacing?: string | number) => string;
11
11
  //#endregion
12
12
  export { stringify as n, invalidKeyChars as t };
13
- //# sourceMappingURL=stringify-CFT1K1LE.d.mts.map
13
+ //# sourceMappingURL=stringify-mAxwby9q.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify-mAxwby9q.d.cts","names":[],"sources":["../src/utils/stringify.ts"],"sourcesContent":[],"mappings":";cAqBa;AAAb;AA0CA;;;;;;cAAa"}
@@ -8,4 +8,4 @@ declare function stripComments(value: string, {
8
8
  }): string;
9
9
  //#endregion
10
10
  export { stripComments as t };
11
- //# sourceMappingURL=strip-comments-BA8MS_Fs.d.mts.map
11
+ //# sourceMappingURL=strip-comments-AOXnoydB.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"strip-comments-BA8MS_Fs.d.mts","names":[],"sources":["../src/utils/strip-comments.ts"],"sourcesContent":[],"mappings":";iBAyCgB,aAAA;;;;EAAA,UAAA,CAAA,EAAA,OAAa,GAAA,SAEzB"}
1
+ {"version":3,"file":"strip-comments-AOXnoydB.d.cts","names":[],"sources":["../src/utils/strip-comments.ts"],"sourcesContent":[],"mappings":";iBAyCgB,aAAA;;;;EAAA,UAAA,CAAA,EAAA,OAAa,GAAA,SAEzB"}
@@ -8,4 +8,4 @@ declare function stripComments(value: string, {
8
8
  }): string;
9
9
  //#endregion
10
10
  export { stripComments as t };
11
- //# sourceMappingURL=strip-comments-Cz_Wc25t.d.cts.map
11
+ //# sourceMappingURL=strip-comments-BNN6Uf4e.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"strip-comments-Cz_Wc25t.d.cts","names":[],"sources":["../src/utils/strip-comments.ts"],"sourcesContent":[],"mappings":";iBAyCgB,aAAA;;;;EAAA,UAAA,CAAA,EAAA,OAAa,GAAA,SAEzB"}
1
+ {"version":3,"file":"strip-comments-BNN6Uf4e.d.mts","names":[],"sources":["../src/utils/strip-comments.ts"],"sourcesContent":[],"mappings":";iBAyCgB,aAAA;;;;EAAA,UAAA,CAAA,EAAA,OAAa,GAAA,SAEzB"}
@@ -86,4 +86,4 @@ function stripComments(value, { whitespace = true, trailingCommas = false } = {}
86
86
 
87
87
  //#endregion
88
88
  export { stripComments as t };
89
- //# sourceMappingURL=strip-comments-Dq00N_Sg.mjs.map
89
+ //# sourceMappingURL=strip-comments-DNTu6CWM.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"strip-comments-Dq00N_Sg.mjs","names":["isInsideString: boolean | symbol","isInsideComment: boolean | symbol"],"sources":["../../types/src/base.ts","../src/utils/strip-comments.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { TypedArray } from \"./array\";\n\nexport type SerializablePrimitive =\n | null\n | undefined\n | string\n | number\n | boolean\n | bigint;\nexport type Primitive = SerializablePrimitive | symbol;\n\n/**\n * Matches any primitive, `void`, `Date`, or `RegExp` value.\n */\nexport type BuiltIns = Primitive | void | Date | RegExp;\n\n/**\n * Matches any non-primitive object\n */\n// eslint-disable-next-line ts/no-unsafe-function-type\nexport type AtomicObject = Function | Promise<any> | Date | RegExp;\n\n/** Determines if the passed value is of a specific type */\nexport type TypeTester = (value: any) => boolean;\n\n/**\n * The interface for a type mapping (key =\\> function) to use for {@link getType}.\n * export * The key represents the name of the type. The function represents the {@link TypeTester | test method}.\n * The map should be ordered by testing preference, with more specific tests first.\n * If a test returns true, it is selected, and the key is returned as the type.\n */\nexport type TypeMap = Record<string, TypeTester>;\n\ndeclare const emptyObjectSymbol: unique symbol;\n\nexport type FunctionOrValue<Value> = Value extends () => infer X ? X : Value;\n\n/**\n * A [[List]]\n *\n * @example\n * ```ts\n * type list0 = [1, 2, 3]\n * type list1 = number[]\n * ```\n *\n * @param A - its type\n * @returns [[List]]\n */\nexport type List<A = any> = ReadonlyArray<A>;\n\n/**\n * Alias to create a [[Function]]\n *\n * @example\n * ```ts\n * import { FunctionLike } from '@stryke/types'\n *\n * type test0 = FunctionLike<[string, number], boolean>\n * /// (args_0: string, args_1: number) => boolean\n * ```\n *\n * @param P - parameters\n * @param R - return type\n * @returns [[Function]]\n */\nexport type FunctionLike<P extends List = any, R = any> = (...args: P) => R;\n\nexport type AnyFunction = FunctionLike<any, any>;\nexport type Nullish = undefined | null;\nexport type Nullishable<T> = T | Nullish;\nexport type NonNullishObject = object; // not null/undefined which are Object\nexport type NativeClass = abstract new (...args: any) => any;\nexport type AnyNumber = number | number;\nexport type AnyString = string | string;\nexport type AnyBoolean = boolean | boolean;\nexport type AnyArray = any[];\nexport type PlainObject = Record<any, object>; // https://stackoverflow.com/a/75052315/130638\nexport type AnyMap = Map<any, any>;\nexport type AnyWeakMap = WeakMap<WeakKey, any>;\nexport type EmptyArray = [];\nexport interface EmptyObject {\n [emptyObjectSymbol]?: never;\n}\n\nexport type Any =\n | boolean\n | number\n | bigint\n | string\n | null\n | undefined\n | void\n | symbol\n | object\n | PlainObject\n | AnyArray\n | AnyMap\n | AnyWeakMap;\n\n/**\n * The valid types of the index for an `Indexable` type object\n */\nexport type IndexType = string | number | symbol;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type TypedIndexable<T> = Record<IndexType, T>;\n\n/**\n * The declaration of a ***dictionary-type*** object\n *\n * @see {@link TypedIndexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type Indexable = TypedIndexable<any>;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link TypedIndexable}\n */\nexport type Dictionary<T> = Record<string, T>;\n\nexport const EMPTY_STRING = \"\";\nexport const NEWLINE_STRING = \"\\r\\n\";\nexport const EMPTY_OBJECT = {};\n\nexport type AnyCase<T extends IndexType> = string extends T\n ? string\n : T extends `${infer F1}${infer F2}${infer R}`\n ? `${Uppercase<F1> | Lowercase<F1>}${Uppercase<F2> | Lowercase<F2>}${AnyCase<R>}`\n : T extends `${infer F}${infer R}`\n ? `${Uppercase<F> | Lowercase<F>}${AnyCase<R>}`\n : typeof EMPTY_STRING;\n\nexport type Newable<T> = new (..._args: never[]) => T;\n\nexport interface Abstract<T> {\n prototype: T;\n}\n\nexport interface Clonable<T> {\n clone: () => T;\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ReducerFunction<TState, TAction> = (\n state: TState,\n action: TAction\n) => TState;\n\n// NOTE: for the file size optimization\nexport const TYPE_ARGUMENTS = \"Arguments\";\nexport const TYPE_ARRAY = \"Array\";\nexport const TYPE_OBJECT = \"Object\";\nexport const TYPE_MAP = \"Map\";\nexport const TYPE_SET = \"Set\";\n\nexport type Collection =\n | IArguments\n | unknown[]\n | Map<unknown, unknown>\n | Record<string | number | symbol, unknown>\n | Set<unknown>;\n\nexport type NonUndefined<T> = T extends undefined ? never : T;\n\nexport type BrowserNativeObject = Date | File;\n\nexport type DeepPartial<T> = T extends BrowserNativeObject | NestedValue\n ? T\n : {\n [K in keyof T]?: DeepPartial<T[K]>;\n };\n\nexport type Rollback = Record<\n string,\n (initialValue: any, currentValue: any) => any\n>;\n\n/**\n * Extract all required keys from the given type.\n *\n * @remarks\n * This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...\n */\nexport type RequiredKeysOf<BaseType extends object> = Exclude<\n {\n [Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>\n ? Key\n : never;\n }[keyof BaseType],\n undefined\n>;\n\n/**\n * Returns a boolean for whether the two given types are equal.\n *\n * @remarks\n * Use-cases: If you want to make a conditional branch based on the result of a comparison of two types.\n *\n * @see https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650\n * @see https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796\n */\nexport type IsEqual<A, B> =\n (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B ? 1 : 2\n ? true\n : false;\n\nexport type Filter<KeyType, ExcludeType> =\n IsEqual<KeyType, ExcludeType> extends true\n ? never\n : KeyType extends ExcludeType\n ? never\n : KeyType;\n\ninterface ExceptOptions {\n /**\n Disallow assigning non-specified properties.\n\n Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.\n\n @defaultValue false\n */\n requireExactProps?: boolean;\n}\n\n/**\n * Create a type from an object type without certain keys.\n *\n * @remarks\n * We recommend setting the `requireExactProps` option to `true`.\n *\n * This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.\n *\n * This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).\n */\nexport type Except<\n ObjectType,\n KeysType extends keyof ObjectType,\n Options extends ExceptOptions = { requireExactProps: false }\n> = {\n [KeyType in keyof ObjectType as Filter<\n KeyType,\n KeysType\n >]: ObjectType[KeyType];\n} & (Options[\"requireExactProps\"] extends true\n ? Partial<Record<KeysType, never>>\n : Record<string, never>);\n\n/**\n * Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.\n *\n * @remarks\n * Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.\n *\n * If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.\n *\n * @see https://github.com/microsoft/TypeScript/issues/15300\n */\nexport type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};\n\n/**\n * Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type.\n *\n * @remarks\n * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.\n */\nexport type SetRequired<\n BaseType,\n Keys extends keyof BaseType\n> = BaseType extends unknown // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). // union into a [distributive conditional // `extends unknown` is always going to be the case and is used to convert any\n ? Simplify<\n // Pick just the keys that are optional from the base type.\n Except<BaseType, Keys> &\n // Pick the keys that should be required from the base type and make them required.\n Required<Pick<BaseType, Keys>>\n >\n : never;\n\nexport const $NestedValue: unique symbol = Symbol(\"NestedValue\");\n\nexport type NestedValue<TValue extends object = object> = {\n [$NestedValue]: never;\n} & TValue;\n\nexport interface RefObject<T> {\n current: T;\n}\n\nexport interface Identity<T = string> {\n id: T;\n}\n\nexport interface Versioned {\n version: number;\n}\n\nexport interface Sequenced {\n /**\n * The sequence number (version, or event counter, etc.) of the record\n */\n sequence: number;\n}\n\nexport interface Typed {\n /**\n * The type of the record\n */\n __type: string;\n}\n\nexport interface ClassTypeCheckable<T> extends Typed {\n /**\n * Run type check on the given value\n * @param value - The value to check\n * @returns True if the value is of the type of the class\n */\n isTypeOf: (value: unknown) => value is T;\n}\n\n/**\n * Matches non-recursive types.\n */\nexport type NonRecursiveType =\n | BuiltIns\n // eslint-disable-next-line ts/no-unsafe-function-type\n | Function\n | (new (...arguments_: any[]) => unknown);\n\nexport type IsPrimitive<T> = [T] extends [Primitive] ? true : false;\nexport type IsNever<T> = [T] extends [never] ? true : false;\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\nexport type IsNull<T> = [T] extends [null] ? true : false;\nexport type IsUndefined<T> = T extends undefined ? true : false;\nexport type IsUnknown<T> = unknown extends T // `T` can be `unknown` or `any`\n ? IsNull<T> extends false // `any` can be `null`, but `unknown` can't be\n ? true\n : false\n : false;\nexport type IsNullish<T> = IsNull<T> & IsUndefined<T>;\nexport type IsFunction<T> = T extends AnyFunction ? true : false;\n\n/**\n * Declare locally scoped properties on `globalThis`.\n *\n * When defining a global variable in a declaration file is inappropriate, it can be helpful to define a `type` or `interface` (say `ExtraGlobals`) with the global variable and then cast `globalThis` via code like `globalThis as unknown as ExtraGlobals`.\n *\n * Instead of casting through `unknown`, you can update your `type` or `interface` to extend `GlobalThis` and then directly cast `globalThis`.\n *\n * @example\n * ```\n * import type { GlobalThis } from '@stryke/types';\n *\n * type ExtraGlobals = GlobalThis & {\n * readonly GLOBAL_TOKEN: string;\n * };\n *\n * (globalThis as ExtraGlobals).GLOBAL_TOKEN;\n * ```\n */\nexport type GlobalThis = typeof globalThis;\n\n/**\n * Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport interface Class<T, Arguments extends unknown[] = any[]> {\n prototype: Pick<T, keyof T>;\n new (...arguments_: Arguments): T;\n}\n\n/**\n * Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport type Constructor<T, Arguments extends unknown[] = any[]> = new (\n ...arguments_: Arguments\n) => T;\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/classes.html#abstract-classes).\n *\n * @privateRemarks\n * We cannot use a `type` here because TypeScript throws: 'abstract' modifier cannot appear on a type member. (1070)\n */\n\nexport interface AbstractClass<\n T,\n Arguments extends unknown[] = any[]\n> extends AbstractConstructor<T, Arguments> {\n prototype: Pick<T, keyof T>;\n}\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#abstract-construct-signatures) constructor.\n */\nexport type AbstractConstructor<\n T,\n Arguments extends unknown[] = any[]\n> = abstract new (...arguments_: Arguments) => T;\n\n/**\n * Create a tuple type of the given length `<L>` and fill it with the given type `<Fill>`.\n *\n * If `<Fill>` is not provided, it will default to `unknown`.\n *\n * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f\n */\nexport type BuildTuple<\n L extends number,\n Fill = unknown,\n T extends readonly unknown[] = []\n> = T[\"length\"] extends L ? T : BuildTuple<L, Fill, [...T, Fill]>;\n\n/**\n * Test if the given function has multiple call signatures.\n *\n * Needed to handle the case of a single call signature with properties.\n *\n * Multiple call signatures cannot currently be supported due to a TypeScript limitation.\n * @see https://github.com/microsoft/TypeScript/issues/29732\n */\nexport type HasMultipleCallSignatures<\n T extends (...arguments_: any[]) => unknown\n> = T extends {\n (...arguments_: infer A): unknown;\n (...arguments_: infer B): unknown;\n}\n ? B extends A\n ? A extends B\n ? false\n : true\n : true\n : false;\n\ntype StructuredCloneablePrimitive =\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | boolean\n | number\n | string;\n\ntype StructuredCloneableData =\n | ArrayBuffer\n | DataView\n | Date\n | Error\n | RegExp\n | TypedArray\n | Blob\n | File;\n\n// DOM exclusive types\n// | AudioData\n// | CropTarget\n// | CryptoKey\n// | DOMException\n// | DOMMatrix\n// | DOMMatrixReadOnly\n// | DOMPoint\n// | DOMPointReadOnly\n// | DOMQuad\n// | DOMRect\n// | DOMRectReadOnly\n// | FileList\n// | FileSystemDirectoryHandle\n// | FileSystemFileHandle\n// | FileSystemHandle\n// | GPUCompilationInfo\n// | GPUCompilationMessage\n// | ImageBitmap\n// | ImageData\n// | RTCCertificate\n// | VideoFrame\n\ntype StructuredCloneableCollection =\n | readonly StructuredCloneable[]\n | {\n readonly [key: string]: StructuredCloneable;\n readonly [key: number]: StructuredCloneable;\n }\n | ReadonlyMap<StructuredCloneable, StructuredCloneable>\n | ReadonlySet<StructuredCloneable>;\n\n/**\n * Matches a value that can be losslessly cloned using `structuredClone`.\n *\n * Note:\n * - Custom error types will be cloned as the base `Error` type\n * - This type doesn't include types exclusive to the TypeScript DOM library (e.g. `DOMRect` and `VideoFrame`)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\n *\n * @example\n * ```\n * import type { StructuredCloneable } from '@stryke/types';\n *\n * class CustomClass {}\n *\n * // @ts-expect-error\n * const error: StructuredCloneable = {\n * custom: new CustomClass(),\n * };\n *\n * structuredClone(error);\n * //=> {custom: {}}\n *\n * const good: StructuredCloneable = {\n * number: 3,\n * date: new Date(),\n * map: new Map<string, number>(),\n * }\n *\n * good.map.set('key', 1);\n *\n * structuredClone(good);\n * //=> {number: 3, date: Date(2022-10-17 22:22:35.920), map: Map {'key' -> 1}}\n * ```\n */\nexport type StructuredCloneable =\n | StructuredCloneablePrimitive\n | StructuredCloneableData\n | StructuredCloneableCollection;\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EMPTY_STRING } from \"@stryke/types/base\";\n\nconst singleComment = Symbol(\"singleComment\");\nconst multiComment = Symbol(\"multiComment\");\n\nfunction stripWithoutWhitespace() {\n return \"\";\n}\nfunction stripWithWhitespace(value: string, start?: number, end?: number) {\n return value.slice(start, end).replace(/\\S/g, \" \");\n}\n\nfunction isEscaped(value: string, quotePosition: number) {\n let index = quotePosition - 1;\n let backslashCount = 0;\n while (value[index] === \"\\\\\") {\n index -= 1;\n backslashCount += 1;\n }\n\n return Boolean(backslashCount % 2);\n}\n\nexport function stripComments(\n value: string,\n { whitespace = true, trailingCommas = false } = {}\n) {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `Expected argument \\`jsonString\\` to be a \\`string\\`, got \\`${typeof value}\\``\n );\n }\n\n const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;\n let isInsideString: boolean | symbol = false;\n let isInsideComment: boolean | symbol = false;\n let offset = 0;\n let buffer = \"\";\n let result = \"\";\n let commaIndex = -1;\n for (let index = 0; index < value.length; index++) {\n const currentCharacter = value[index];\n const nextCharacter = value[index + 1];\n if (!isInsideComment && currentCharacter === '\"') {\n const escaped = isEscaped(value, index);\n if (!escaped) {\n isInsideString = !isInsideString;\n }\n }\n if (isInsideString) {\n continue;\n }\n if (\n !isInsideComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"//\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n isInsideComment = singleComment;\n index++;\n } else if (\n isInsideComment === singleComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"\\r\\n\"\n ) {\n index++;\n isInsideComment = false;\n buffer += strip(value, offset, index);\n offset = index;\n } else if (isInsideComment === singleComment && currentCharacter === \"\\n\") {\n isInsideComment = false;\n buffer += strip(value, offset, index);\n offset = index;\n } else if (\n !isInsideComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"/*\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n isInsideComment = multiComment;\n index++;\n } else if (\n isInsideComment === multiComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"*/\"\n ) {\n index++;\n isInsideComment = false;\n buffer += strip(value, offset, index + 1);\n offset = index + 1;\n } else if (trailingCommas && !isInsideComment) {\n if (commaIndex !== -1) {\n if (currentCharacter === \"}\" || currentCharacter === \"]\") {\n buffer += value.slice(offset, index);\n result += strip(buffer, 0, 1) + buffer.slice(1);\n buffer = \"\";\n offset = index;\n commaIndex = -1;\n } else if (\n currentCharacter !== \" \" &&\n currentCharacter !== \"\t\" &&\n currentCharacter !== \"\\r\" &&\n currentCharacter !== \"\\n\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n commaIndex = -1;\n }\n } else if (currentCharacter === \",\") {\n result += buffer + value.slice(offset, index);\n buffer = \"\";\n offset = index;\n commaIndex = index;\n }\n }\n }\n\n return (\n result +\n buffer +\n (isInsideComment ? strip(value.slice(offset)) : value.slice(offset))\n );\n}\n"],"mappings":";AAsJA,MAAa,eAAe;;;;AClI5B,MAAM,gBAAgB,OAAO,gBAAgB;AAC7C,MAAM,eAAe,OAAO,eAAe;AAE3C,SAAS,yBAAyB;AAChC,QAAO;;AAET,SAAS,oBAAoB,OAAe,OAAgB,KAAc;AACxE,QAAO,MAAM,MAAM,OAAO,IAAI,CAAC,QAAQ,OAAO,IAAI;;AAGpD,SAAS,UAAU,OAAe,eAAuB;CACvD,IAAI,QAAQ,gBAAgB;CAC5B,IAAI,iBAAiB;AACrB,QAAO,MAAM,WAAW,MAAM;AAC5B,WAAS;AACT,oBAAkB;;AAGpB,QAAO,QAAQ,iBAAiB,EAAE;;AAGpC,SAAgB,cACd,OACA,EAAE,aAAa,MAAM,iBAAiB,UAAU,EAAE,EAClD;AACA,KAAI,OAAO,UAAU,SACnB,OAAM,IAAI,UACR,8DAA8D,OAAO,MAAM,IAC5E;CAGH,MAAM,QAAQ,aAAa,sBAAsB;CACjD,IAAIA,iBAAmC;CACvC,IAAIC,kBAAoC;CACxC,IAAI,SAAS;CACb,IAAI,SAAS;CACb,IAAI,SAAS;CACb,IAAI,aAAa;AACjB,MAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;EACjD,MAAM,mBAAmB,MAAM;EAC/B,MAAM,gBAAgB,MAAM,QAAQ;AACpC,MAAI,CAAC,mBAAmB,qBAAqB,MAE3C;OAAI,CADY,UAAU,OAAO,MAAM,CAErC,kBAAiB,CAAC;;AAGtB,MAAI,eACF;AAEF,MACE,CAAC,mBACD,oBAAoB,iBAAiB,kBAAkB,MACvD;AACA,aAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,YAAS;AACT,qBAAkB;AAClB;aAEA,oBAAoB,iBACpB,oBAAoB,iBAAiB,kBAAkB,QACvD;AACA;AACA,qBAAkB;AAClB,aAAU,MAAM,OAAO,QAAQ,MAAM;AACrC,YAAS;aACA,oBAAoB,iBAAiB,qBAAqB,MAAM;AACzE,qBAAkB;AAClB,aAAU,MAAM,OAAO,QAAQ,MAAM;AACrC,YAAS;aAET,CAAC,mBACD,oBAAoB,iBAAiB,kBAAkB,MACvD;AACA,aAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,YAAS;AACT,qBAAkB;AAClB;aAEA,oBAAoB,gBACpB,oBAAoB,iBAAiB,kBAAkB,MACvD;AACA;AACA,qBAAkB;AAClB,aAAU,MAAM,OAAO,QAAQ,QAAQ,EAAE;AACzC,YAAS,QAAQ;aACR,kBAAkB,CAAC,iBAC5B;OAAI,eAAe,IACjB;QAAI,qBAAqB,OAAO,qBAAqB,KAAK;AACxD,eAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,eAAU,MAAM,QAAQ,GAAG,EAAE,GAAG,OAAO,MAAM,EAAE;AAC/C,cAAS;AACT,cAAS;AACT,kBAAa;eAEb,qBAAqB,OACrB,qBAAqB,OACrB,qBAAqB,QACrB,qBAAqB,MACrB;AACA,eAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,cAAS;AACT,kBAAa;;cAEN,qBAAqB,KAAK;AACnC,cAAU,SAAS,MAAM,MAAM,QAAQ,MAAM;AAC7C,aAAS;AACT,aAAS;AACT,iBAAa;;;;AAKnB,QACE,SACA,UACC,kBAAkB,MAAM,MAAM,MAAM,OAAO,CAAC,GAAG,MAAM,MAAM,OAAO"}
1
+ {"version":3,"file":"strip-comments-DNTu6CWM.mjs","names":["isInsideString: boolean | symbol","isInsideComment: boolean | symbol"],"sources":["../../types/src/base.ts","../src/utils/strip-comments.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { TypedArray } from \"./array\";\n\nexport type SerializablePrimitive =\n | null\n | undefined\n | string\n | number\n | boolean\n | bigint;\nexport type Primitive = SerializablePrimitive | symbol;\n\n/**\n * Matches any primitive, `void`, `Date`, or `RegExp` value.\n */\nexport type BuiltIns = Primitive | void | Date | RegExp;\n\n/**\n * Matches any non-primitive object\n */\n// eslint-disable-next-line ts/no-unsafe-function-type\nexport type AtomicObject = Function | Promise<any> | Date | RegExp;\n\n/** Determines if the passed value is of a specific type */\nexport type TypeTester = (value: any) => boolean;\n\n/**\n * The interface for a type mapping (key =\\> function) to use for {@link getType}.\n * export * The key represents the name of the type. The function represents the {@link TypeTester | test method}.\n * The map should be ordered by testing preference, with more specific tests first.\n * If a test returns true, it is selected, and the key is returned as the type.\n */\nexport type TypeMap = Record<string, TypeTester>;\n\ndeclare const emptyObjectSymbol: unique symbol;\n\nexport type FunctionOrValue<Value> = Value extends () => infer X ? X : Value;\n\n/**\n * A [[List]]\n *\n * @example\n * ```ts\n * type list0 = [1, 2, 3]\n * type list1 = number[]\n * ```\n *\n * @param A - its type\n * @returns [[List]]\n */\nexport type List<A = any> = ReadonlyArray<A>;\n\n/**\n * Alias to create a [[Function]]\n *\n * @example\n * ```ts\n * import { FunctionLike } from '@stryke/types'\n *\n * type test0 = FunctionLike<[string, number], boolean>\n * /// (args_0: string, args_1: number) => boolean\n * ```\n *\n * @param P - parameters\n * @param R - return type\n * @returns [[Function]]\n */\nexport type FunctionLike<P extends List = any, R = any> = (...args: P) => R;\n\nexport type AnyFunction = FunctionLike<any, any>;\nexport type Nullish = undefined | null;\nexport type Nullishable<T> = T | Nullish;\nexport type NonNullishObject = object; // not null/undefined which are Object\nexport type NativeClass = abstract new (...args: any) => any;\nexport type AnyNumber = number | number;\nexport type AnyString = string | string;\nexport type AnyBoolean = boolean | boolean;\nexport type AnyArray = any[];\nexport type PlainObject = Record<any, object>; // https://stackoverflow.com/a/75052315/130638\nexport type AnyMap = Map<any, any>;\nexport type AnyWeakMap = WeakMap<WeakKey, any>;\nexport type EmptyArray = [];\nexport interface EmptyObject {\n [emptyObjectSymbol]?: never;\n}\n\nexport type Any =\n | boolean\n | number\n | bigint\n | string\n | null\n | undefined\n | void\n | symbol\n | object\n | PlainObject\n | AnyArray\n | AnyMap\n | AnyWeakMap;\n\n/**\n * The valid types of the index for an `Indexable` type object\n */\nexport type IndexType = string | number | symbol;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type TypedIndexable<T> = Record<IndexType, T>;\n\n/**\n * The declaration of a ***dictionary-type*** object\n *\n * @see {@link TypedIndexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type Indexable = TypedIndexable<any>;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link TypedIndexable}\n */\nexport type Dictionary<T> = Record<string, T>;\n\nexport const EMPTY_STRING = \"\";\nexport const NEWLINE_STRING = \"\\r\\n\";\nexport const EMPTY_OBJECT = {};\n\nexport type AnyCase<T extends IndexType> = string extends T\n ? string\n : T extends `${infer F1}${infer F2}${infer R}`\n ? `${Uppercase<F1> | Lowercase<F1>}${Uppercase<F2> | Lowercase<F2>}${AnyCase<R>}`\n : T extends `${infer F}${infer R}`\n ? `${Uppercase<F> | Lowercase<F>}${AnyCase<R>}`\n : typeof EMPTY_STRING;\n\nexport type Newable<T> = new (..._args: never[]) => T;\n\nexport interface Abstract<T> {\n prototype: T;\n}\n\nexport interface Clonable<T> {\n clone: () => T;\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ReducerFunction<TState, TAction> = (\n state: TState,\n action: TAction\n) => TState;\n\n// NOTE: for the file size optimization\nexport const TYPE_ARGUMENTS = \"Arguments\";\nexport const TYPE_ARRAY = \"Array\";\nexport const TYPE_OBJECT = \"Object\";\nexport const TYPE_MAP = \"Map\";\nexport const TYPE_SET = \"Set\";\n\nexport type Collection =\n | IArguments\n | unknown[]\n | Map<unknown, unknown>\n | Record<string | number | symbol, unknown>\n | Set<unknown>;\n\nexport type NonUndefined<T> = T extends undefined ? never : T;\n\nexport type BrowserNativeObject = Date | File;\n\nexport type DeepPartial<T> = T extends BrowserNativeObject | NestedValue\n ? T\n : {\n [K in keyof T]?: DeepPartial<T[K]>;\n };\n\nexport type Rollback = Record<\n string,\n (initialValue: any, currentValue: any) => any\n>;\n\n/**\n * Extract all required keys from the given type.\n *\n * @remarks\n * This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...\n */\nexport type RequiredKeysOf<BaseType extends object> = Exclude<\n {\n [Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>\n ? Key\n : never;\n }[keyof BaseType],\n undefined\n>;\n\n/**\n * Returns a boolean for whether the two given types are equal.\n *\n * @remarks\n * Use-cases: If you want to make a conditional branch based on the result of a comparison of two types.\n *\n * @see https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650\n * @see https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796\n */\nexport type IsEqual<A, B> =\n (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B ? 1 : 2\n ? true\n : false;\n\nexport type Filter<KeyType, ExcludeType> =\n IsEqual<KeyType, ExcludeType> extends true\n ? never\n : KeyType extends ExcludeType\n ? never\n : KeyType;\n\ninterface ExceptOptions {\n /**\n Disallow assigning non-specified properties.\n\n Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.\n\n @defaultValue false\n */\n requireExactProps?: boolean;\n}\n\n/**\n * Create a type from an object type without certain keys.\n *\n * @remarks\n * We recommend setting the `requireExactProps` option to `true`.\n *\n * This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.\n *\n * This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).\n */\nexport type Except<\n ObjectType,\n KeysType extends keyof ObjectType,\n Options extends ExceptOptions = { requireExactProps: false }\n> = {\n [KeyType in keyof ObjectType as Filter<\n KeyType,\n KeysType\n >]: ObjectType[KeyType];\n} & (Options[\"requireExactProps\"] extends true\n ? Partial<Record<KeysType, never>>\n : Record<string, never>);\n\n/**\n * Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.\n *\n * @remarks\n * Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.\n *\n * If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.\n *\n * @see https://github.com/microsoft/TypeScript/issues/15300\n */\nexport type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};\n\n/**\n * Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type.\n *\n * @remarks\n * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.\n */\nexport type SetRequired<\n BaseType,\n Keys extends keyof BaseType\n> = BaseType extends unknown // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). // union into a [distributive conditional // `extends unknown` is always going to be the case and is used to convert any\n ? Simplify<\n // Pick just the keys that are optional from the base type.\n Except<BaseType, Keys> &\n // Pick the keys that should be required from the base type and make them required.\n Required<Pick<BaseType, Keys>>\n >\n : never;\n\nexport const $NestedValue: unique symbol = Symbol(\"NestedValue\");\n\nexport type NestedValue<TValue extends object = object> = {\n [$NestedValue]: never;\n} & TValue;\n\nexport interface RefObject<T> {\n current: T;\n}\n\nexport interface Identity<T = string> {\n id: T;\n}\n\nexport interface Versioned {\n version: number;\n}\n\nexport interface Sequenced {\n /**\n * The sequence number (version, or event counter, etc.) of the record\n */\n sequence: number;\n}\n\nexport interface Typed {\n /**\n * The type of the record\n */\n __type: string;\n}\n\nexport interface ClassTypeCheckable<T> extends Typed {\n /**\n * Run type check on the given value\n * @param value - The value to check\n * @returns True if the value is of the type of the class\n */\n isTypeOf: (value: unknown) => value is T;\n}\n\n/**\n * Matches non-recursive types.\n */\nexport type NonRecursiveType =\n | BuiltIns\n // eslint-disable-next-line ts/no-unsafe-function-type\n | Function\n | (new (...arguments_: any[]) => unknown);\n\nexport type IsPrimitive<T> = [T] extends [Primitive] ? true : false;\nexport type IsNever<T> = [T] extends [never] ? true : false;\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\nexport type IsNull<T> = [T] extends [null] ? true : false;\nexport type IsUndefined<T> = T extends undefined ? true : false;\nexport type IsUnknown<T> = unknown extends T // `T` can be `unknown` or `any`\n ? IsNull<T> extends false // `any` can be `null`, but `unknown` can't be\n ? true\n : false\n : false;\nexport type IsNullish<T> = IsNull<T> & IsUndefined<T>;\nexport type IsFunction<T> = T extends AnyFunction ? true : false;\n\n/**\n * Declare locally scoped properties on `globalThis`.\n *\n * When defining a global variable in a declaration file is inappropriate, it can be helpful to define a `type` or `interface` (say `ExtraGlobals`) with the global variable and then cast `globalThis` via code like `globalThis as unknown as ExtraGlobals`.\n *\n * Instead of casting through `unknown`, you can update your `type` or `interface` to extend `GlobalThis` and then directly cast `globalThis`.\n *\n * @example\n * ```\n * import type { GlobalThis } from '@stryke/types';\n *\n * type ExtraGlobals = GlobalThis & {\n * readonly GLOBAL_TOKEN: string;\n * };\n *\n * (globalThis as ExtraGlobals).GLOBAL_TOKEN;\n * ```\n */\nexport type GlobalThis = typeof globalThis;\n\n/**\n * Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport interface Class<T, Arguments extends unknown[] = any[]> {\n prototype: Pick<T, keyof T>;\n new (...arguments_: Arguments): T;\n}\n\n/**\n * Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport type Constructor<T, Arguments extends unknown[] = any[]> = new (\n ...arguments_: Arguments\n) => T;\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/classes.html#abstract-classes).\n *\n * @privateRemarks\n * We cannot use a `type` here because TypeScript throws: 'abstract' modifier cannot appear on a type member. (1070)\n */\n\nexport interface AbstractClass<\n T,\n Arguments extends unknown[] = any[]\n> extends AbstractConstructor<T, Arguments> {\n prototype: Pick<T, keyof T>;\n}\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#abstract-construct-signatures) constructor.\n */\nexport type AbstractConstructor<\n T,\n Arguments extends unknown[] = any[]\n> = abstract new (...arguments_: Arguments) => T;\n\n/**\n * Create a tuple type of the given length `<L>` and fill it with the given type `<Fill>`.\n *\n * If `<Fill>` is not provided, it will default to `unknown`.\n *\n * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f\n */\nexport type BuildTuple<\n L extends number,\n Fill = unknown,\n T extends readonly unknown[] = []\n> = T[\"length\"] extends L ? T : BuildTuple<L, Fill, [...T, Fill]>;\n\n/**\n * Test if the given function has multiple call signatures.\n *\n * Needed to handle the case of a single call signature with properties.\n *\n * Multiple call signatures cannot currently be supported due to a TypeScript limitation.\n * @see https://github.com/microsoft/TypeScript/issues/29732\n */\nexport type HasMultipleCallSignatures<\n T extends (...arguments_: any[]) => unknown\n> = T extends {\n (...arguments_: infer A): unknown;\n (...arguments_: infer B): unknown;\n}\n ? B extends A\n ? A extends B\n ? false\n : true\n : true\n : false;\n\ntype StructuredCloneablePrimitive =\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | boolean\n | number\n | string;\n\ntype StructuredCloneableData =\n | ArrayBuffer\n | DataView\n | Date\n | Error\n | RegExp\n | TypedArray\n | Blob\n | File;\n\n// DOM exclusive types\n// | AudioData\n// | CropTarget\n// | CryptoKey\n// | DOMException\n// | DOMMatrix\n// | DOMMatrixReadOnly\n// | DOMPoint\n// | DOMPointReadOnly\n// | DOMQuad\n// | DOMRect\n// | DOMRectReadOnly\n// | FileList\n// | FileSystemDirectoryHandle\n// | FileSystemFileHandle\n// | FileSystemHandle\n// | GPUCompilationInfo\n// | GPUCompilationMessage\n// | ImageBitmap\n// | ImageData\n// | RTCCertificate\n// | VideoFrame\n\ntype StructuredCloneableCollection =\n | readonly StructuredCloneable[]\n | {\n readonly [key: string]: StructuredCloneable;\n readonly [key: number]: StructuredCloneable;\n }\n | ReadonlyMap<StructuredCloneable, StructuredCloneable>\n | ReadonlySet<StructuredCloneable>;\n\n/**\n * Matches a value that can be losslessly cloned using `structuredClone`.\n *\n * Note:\n * - Custom error types will be cloned as the base `Error` type\n * - This type doesn't include types exclusive to the TypeScript DOM library (e.g. `DOMRect` and `VideoFrame`)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\n *\n * @example\n * ```\n * import type { StructuredCloneable } from '@stryke/types';\n *\n * class CustomClass {}\n *\n * // @ts-expect-error\n * const error: StructuredCloneable = {\n * custom: new CustomClass(),\n * };\n *\n * structuredClone(error);\n * //=> {custom: {}}\n *\n * const good: StructuredCloneable = {\n * number: 3,\n * date: new Date(),\n * map: new Map<string, number>(),\n * }\n *\n * good.map.set('key', 1);\n *\n * structuredClone(good);\n * //=> {number: 3, date: Date(2022-10-17 22:22:35.920), map: Map {'key' -> 1}}\n * ```\n */\nexport type StructuredCloneable =\n | StructuredCloneablePrimitive\n | StructuredCloneableData\n | StructuredCloneableCollection;\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EMPTY_STRING } from \"@stryke/types/base\";\n\nconst singleComment = Symbol(\"singleComment\");\nconst multiComment = Symbol(\"multiComment\");\n\nfunction stripWithoutWhitespace() {\n return \"\";\n}\nfunction stripWithWhitespace(value: string, start?: number, end?: number) {\n return value.slice(start, end).replace(/\\S/g, \" \");\n}\n\nfunction isEscaped(value: string, quotePosition: number) {\n let index = quotePosition - 1;\n let backslashCount = 0;\n while (value[index] === \"\\\\\") {\n index -= 1;\n backslashCount += 1;\n }\n\n return Boolean(backslashCount % 2);\n}\n\nexport function stripComments(\n value: string,\n { whitespace = true, trailingCommas = false } = {}\n) {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `Expected argument \\`jsonString\\` to be a \\`string\\`, got \\`${typeof value}\\``\n );\n }\n\n const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;\n let isInsideString: boolean | symbol = false;\n let isInsideComment: boolean | symbol = false;\n let offset = 0;\n let buffer = \"\";\n let result = \"\";\n let commaIndex = -1;\n for (let index = 0; index < value.length; index++) {\n const currentCharacter = value[index];\n const nextCharacter = value[index + 1];\n if (!isInsideComment && currentCharacter === '\"') {\n const escaped = isEscaped(value, index);\n if (!escaped) {\n isInsideString = !isInsideString;\n }\n }\n if (isInsideString) {\n continue;\n }\n if (\n !isInsideComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"//\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n isInsideComment = singleComment;\n index++;\n } else if (\n isInsideComment === singleComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"\\r\\n\"\n ) {\n index++;\n isInsideComment = false;\n buffer += strip(value, offset, index);\n offset = index;\n } else if (isInsideComment === singleComment && currentCharacter === \"\\n\") {\n isInsideComment = false;\n buffer += strip(value, offset, index);\n offset = index;\n } else if (\n !isInsideComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"/*\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n isInsideComment = multiComment;\n index++;\n } else if (\n isInsideComment === multiComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"*/\"\n ) {\n index++;\n isInsideComment = false;\n buffer += strip(value, offset, index + 1);\n offset = index + 1;\n } else if (trailingCommas && !isInsideComment) {\n if (commaIndex !== -1) {\n if (currentCharacter === \"}\" || currentCharacter === \"]\") {\n buffer += value.slice(offset, index);\n result += strip(buffer, 0, 1) + buffer.slice(1);\n buffer = \"\";\n offset = index;\n commaIndex = -1;\n } else if (\n currentCharacter !== \" \" &&\n currentCharacter !== \"\t\" &&\n currentCharacter !== \"\\r\" &&\n currentCharacter !== \"\\n\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n commaIndex = -1;\n }\n } else if (currentCharacter === \",\") {\n result += buffer + value.slice(offset, index);\n buffer = \"\";\n offset = index;\n commaIndex = index;\n }\n }\n }\n\n return (\n result +\n buffer +\n (isInsideComment ? strip(value.slice(offset)) : value.slice(offset))\n );\n}\n"],"mappings":";AAsJA,MAAa,eAAe;;;;AClI5B,MAAM,gBAAgB,OAAO,gBAAgB;AAC7C,MAAM,eAAe,OAAO,eAAe;AAE3C,SAAS,yBAAyB;AAChC,QAAO;;AAET,SAAS,oBAAoB,OAAe,OAAgB,KAAc;AACxE,QAAO,MAAM,MAAM,OAAO,IAAI,CAAC,QAAQ,OAAO,IAAI;;AAGpD,SAAS,UAAU,OAAe,eAAuB;CACvD,IAAI,QAAQ,gBAAgB;CAC5B,IAAI,iBAAiB;AACrB,QAAO,MAAM,WAAW,MAAM;AAC5B,WAAS;AACT,oBAAkB;;AAGpB,QAAO,QAAQ,iBAAiB,EAAE;;AAGpC,SAAgB,cACd,OACA,EAAE,aAAa,MAAM,iBAAiB,UAAU,EAAE,EAClD;AACA,KAAI,OAAO,UAAU,SACnB,OAAM,IAAI,UACR,8DAA8D,OAAO,MAAM,IAC5E;CAGH,MAAM,QAAQ,aAAa,sBAAsB;CACjD,IAAIA,iBAAmC;CACvC,IAAIC,kBAAoC;CACxC,IAAI,SAAS;CACb,IAAI,SAAS;CACb,IAAI,SAAS;CACb,IAAI,aAAa;AACjB,MAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;EACjD,MAAM,mBAAmB,MAAM;EAC/B,MAAM,gBAAgB,MAAM,QAAQ;AACpC,MAAI,CAAC,mBAAmB,qBAAqB,MAE3C;OAAI,CADY,UAAU,OAAO,MAAM,CAErC,kBAAiB,CAAC;;AAGtB,MAAI,eACF;AAEF,MACE,CAAC,mBACD,oBAAoB,iBAAiB,kBAAkB,MACvD;AACA,aAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,YAAS;AACT,qBAAkB;AAClB;aAEA,oBAAoB,iBACpB,oBAAoB,iBAAiB,kBAAkB,QACvD;AACA;AACA,qBAAkB;AAClB,aAAU,MAAM,OAAO,QAAQ,MAAM;AACrC,YAAS;aACA,oBAAoB,iBAAiB,qBAAqB,MAAM;AACzE,qBAAkB;AAClB,aAAU,MAAM,OAAO,QAAQ,MAAM;AACrC,YAAS;aAET,CAAC,mBACD,oBAAoB,iBAAiB,kBAAkB,MACvD;AACA,aAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,YAAS;AACT,qBAAkB;AAClB;aAEA,oBAAoB,gBACpB,oBAAoB,iBAAiB,kBAAkB,MACvD;AACA;AACA,qBAAkB;AAClB,aAAU,MAAM,OAAO,QAAQ,QAAQ,EAAE;AACzC,YAAS,QAAQ;aACR,kBAAkB,CAAC,iBAC5B;OAAI,eAAe,IACjB;QAAI,qBAAqB,OAAO,qBAAqB,KAAK;AACxD,eAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,eAAU,MAAM,QAAQ,GAAG,EAAE,GAAG,OAAO,MAAM,EAAE;AAC/C,cAAS;AACT,cAAS;AACT,kBAAa;eAEb,qBAAqB,OACrB,qBAAqB,OACrB,qBAAqB,QACrB,qBAAqB,MACrB;AACA,eAAU,MAAM,MAAM,QAAQ,MAAM;AACpC,cAAS;AACT,kBAAa;;cAEN,qBAAqB,KAAK;AACnC,cAAU,SAAS,MAAM,MAAM,QAAQ,MAAM;AAC7C,aAAS;AACT,aAAS;AACT,iBAAa;;;;AAKnB,QACE,SACA,UACC,kBAAkB,MAAM,MAAM,MAAM,OAAO,CAAC,GAAG,MAAM,MAAM,OAAO"}
@@ -219,4 +219,4 @@ type JsonSchema7TypeUnion = JsonSchema7StringType | JsonSchema7ArrayType | JsonS
219
219
  type JsonSchema7Type = JsonSchema7TypeUnion & JsonSchema7Meta;
220
220
  //#endregion
221
221
  export { TypeAnnotation as $, JsonSchema7PrimitiveLiteralType as A, JsonSchema7UndefinedType as B, JsonSchema7NativeEnumType as C, JsonSchema7NumberType as D, JsonSchema7NullableType as E, JsonSchema7SetType as F, Leaf as G, JsonSchema7UnknownType as H, JsonSchema7StringType as I, PrimitiveTypeAnnotation as J, LeafTypeAnnotation as K, JsonSchema7TupleType as L, JsonSchema7RecordPropertyNamesType as M, JsonSchema7RecordType as N, JsonSchema7ObjectType as O, JsonSchema7RefType as P, Tree as Q, JsonSchema7Type as R, JsonSchema7Meta as S, JsonSchema7NullType as T, JsonSerializeOptions as U, JsonSchema7UnionType as V, JsonValue as W, SimpleTypeAnnotation as X, SerializableJsonValue as Y, SymbolTypeAnnotation as Z, JsonSchema7BooleanType as _, CustomTypeAnnotation as a, JsonSchema7LiteralType as b, JsonObject as c, JsonParserResult as d, TypedArrayAnnotation as et, JsonSchema7AllOfType as f, JsonSchema7BigintType as g, JsonSchema7ArrayType as h, CompositeTypeAnnotation as i, JsonSchema7PrimitiveUnionType as j, JsonSchema7Primitive as k, JsonParseOptions as l, JsonSchema7AnyType as m, ClassInstance as n, InnerNode as o, JsonSchema7AnyOfType as p, PrimitiveJsonValue as q, ClassTypeAnnotation as r, JsonArray as s, Class as t, JsonParserInterface as u, JsonSchema7DateType as v, JsonSchema7NeverType as w, JsonSchema7MapType as x, JsonSchema7EnumType as y, JsonSchema7TypeUnion as z };
222
- //# sourceMappingURL=types-CPQlxauZ.d.mts.map
222
+ //# sourceMappingURL=types-BAtAPir9.d.mts.map