@stryke/json 0.9.43 → 0.10.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 (201) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/code-frames-BMkA9i6j.d.mts +17 -0
  3. package/dist/code-frames-BMkA9i6j.d.mts.map +1 -0
  4. package/dist/code-frames-BUtrssZ5.d.cts +17 -0
  5. package/dist/code-frames-BUtrssZ5.d.cts.map +1 -0
  6. package/dist/code-frames-Cv8r5tSN.cjs +82 -0
  7. package/dist/code-frames-DISWdYL6.mjs +77 -0
  8. package/dist/code-frames-DISWdYL6.mjs.map +1 -0
  9. package/dist/find-reference-BCg3dQx1.cjs +157 -0
  10. package/dist/find-reference-C-YleCds.d.cts +52 -0
  11. package/dist/find-reference-C-YleCds.d.cts.map +1 -0
  12. package/dist/find-reference-b7rRdLFx.d.mts +52 -0
  13. package/dist/find-reference-b7rRdLFx.d.mts.map +1 -0
  14. package/dist/find-reference-woYMiWzN.mjs +135 -0
  15. package/dist/find-reference-woYMiWzN.mjs.map +1 -0
  16. package/dist/index-B_e8BwCm.d.cts +1 -0
  17. package/dist/index-CDAfh8Ew.d.cts +1 -0
  18. package/dist/index-DwO9IdNa.d.mts +1 -0
  19. package/dist/index-VWno75SQ.d.mts +1 -0
  20. package/dist/index.cjs +32 -14
  21. package/dist/index.d.cts +11 -8
  22. package/dist/index.d.mts +12 -9
  23. package/dist/index.mjs +13 -8
  24. package/dist/is-number-BIwzZzyi.mjs +31 -0
  25. package/dist/is-number-BIwzZzyi.mjs.map +1 -0
  26. package/dist/is-number-c5xguIbS.cjs +42 -0
  27. package/dist/{type-checks/src/is-plain-object.mjs → is-object-BpfmzHWa.mjs} +19 -3
  28. package/dist/is-object-BpfmzHWa.mjs.map +1 -0
  29. package/dist/{type-checks/src/is-plain-object.cjs → is-object-umGh91v1.cjs} +24 -3
  30. package/dist/{type-checks/src/is-string.mjs → is-string-C2RK4Gjs.cjs} +7 -2
  31. package/dist/{type-checks/src/is-string.cjs → is-string-CLiBUSKV.mjs} +2 -2
  32. package/dist/is-string-CLiBUSKV.mjs.map +1 -0
  33. package/dist/{type-checks/src/is-undefined.cjs → is-undefined-CmyJWYGD.mjs} +2 -2
  34. package/dist/is-undefined-CmyJWYGD.mjs.map +1 -0
  35. package/dist/{type-checks/src/is-undefined.mjs → is-undefined-CnI0qe-z.cjs} +7 -2
  36. package/dist/parse-BGlhbY16.d.cts +9 -0
  37. package/dist/parse-BGlhbY16.d.cts.map +1 -0
  38. package/dist/parse-Crgv3Nl1.mjs +81 -0
  39. package/dist/parse-Crgv3Nl1.mjs.map +1 -0
  40. package/dist/parse-DZfi3d96.d.cts +51 -0
  41. package/dist/parse-DZfi3d96.d.cts.map +1 -0
  42. package/dist/parse-DgYW5BBj.d.mts +9 -0
  43. package/dist/parse-DgYW5BBj.d.mts.map +1 -0
  44. package/dist/parse-KiRakdIR.cjs +127 -0
  45. package/dist/parse-ZRTh45ZI.d.mts +51 -0
  46. package/dist/parse-ZRTh45ZI.d.mts.map +1 -0
  47. package/dist/parse-error-7K8s4vWf.d.cts +15 -0
  48. package/dist/parse-error-7K8s4vWf.d.cts.map +1 -0
  49. package/dist/parse-error-C3Qmubee.mjs +34 -0
  50. package/dist/parse-error-C3Qmubee.mjs.map +1 -0
  51. package/dist/parse-error-DY_MelEh.d.mts +15 -0
  52. package/dist/parse-error-DY_MelEh.d.mts.map +1 -0
  53. package/dist/parse-error-Dzwg4sdE.cjs +39 -0
  54. package/dist/parse-obdkJfj5.mjs +52 -0
  55. package/dist/parse-obdkJfj5.mjs.map +1 -0
  56. package/dist/parse-wxSDzBPf.cjs +62 -0
  57. package/dist/pointer/find-reference.cjs +5 -65
  58. package/dist/pointer/find-reference.d.cts +2 -52
  59. package/dist/pointer/find-reference.d.mts +2 -52
  60. package/dist/pointer/find-reference.mjs +2 -63
  61. package/dist/pointer/index.cjs +15 -14
  62. package/dist/pointer/index.d.cts +2 -2
  63. package/dist/pointer/index.d.mts +2 -2
  64. package/dist/pointer/index.mjs +3 -2
  65. package/dist/pointer/parse.cjs +9 -86
  66. package/dist/pointer/parse.d.cts +2 -44
  67. package/dist/pointer/parse.d.mts +2 -44
  68. package/dist/pointer/parse.mjs +2 -80
  69. package/dist/pointer-Cc7IR0Bj.cjs +0 -0
  70. package/dist/pointer-CiTXvh1G.mjs +0 -0
  71. package/dist/schema-B1RVJHzJ.d.cts +7 -0
  72. package/dist/schema-B1RVJHzJ.d.cts.map +1 -0
  73. package/dist/schema-CfhPLy30.mjs +9 -0
  74. package/dist/schema-CfhPLy30.mjs.map +1 -0
  75. package/dist/schema-D5Aqvh2i.cjs +14 -0
  76. package/dist/schema-ai_NU-JC.d.mts +7 -0
  77. package/dist/schema-ai_NU-JC.d.mts.map +1 -0
  78. package/dist/schema.cjs +3 -0
  79. package/dist/schema.d.cts +2 -0
  80. package/dist/schema.d.mts +3 -0
  81. package/dist/schema.mjs +3 -0
  82. package/dist/storm-json-6WpS7qnH.cjs +154 -0
  83. package/dist/storm-json-AaFeOao2.d.cts +70 -0
  84. package/dist/storm-json-AaFeOao2.d.cts.map +1 -0
  85. package/dist/storm-json-BvRkzAlR.d.mts +70 -0
  86. package/dist/storm-json-BvRkzAlR.d.mts.map +1 -0
  87. package/dist/storm-json-Cy3PuAhj.mjs +116 -0
  88. package/dist/storm-json-Cy3PuAhj.mjs.map +1 -0
  89. package/dist/storm-json.cjs +3 -116
  90. package/dist/storm-json.d.cts +2 -70
  91. package/dist/storm-json.d.mts +3 -70
  92. package/dist/storm-json.mjs +3 -115
  93. package/dist/stringify-B6iAeg0u.d.mts +13 -0
  94. package/dist/stringify-B6iAeg0u.d.mts.map +1 -0
  95. package/dist/stringify-Bc8OkhIr.d.cts +13 -0
  96. package/dist/stringify-Bc8OkhIr.d.cts.map +1 -0
  97. package/dist/stringify-D5baUfEe.mjs +68 -0
  98. package/dist/stringify-D5baUfEe.mjs.map +1 -0
  99. package/dist/stringify-DEw3S4_Z.cjs +78 -0
  100. package/dist/strip-comments-Bg3R_Y4S.d.mts +11 -0
  101. package/dist/strip-comments-Bg3R_Y4S.d.mts.map +1 -0
  102. package/dist/strip-comments-CMaAgTqz.mjs +89 -0
  103. package/dist/strip-comments-CMaAgTqz.mjs.map +1 -0
  104. package/dist/strip-comments-CtFoX0xG.cjs +94 -0
  105. package/dist/strip-comments-Cz_Wc25t.d.cts +11 -0
  106. package/dist/strip-comments-Cz_Wc25t.d.cts.map +1 -0
  107. package/dist/types-BUeTTE_U.d.cts +222 -0
  108. package/dist/types-BUeTTE_U.d.cts.map +1 -0
  109. package/dist/types-C_KlcCNw.d.mts +222 -0
  110. package/dist/types-C_KlcCNw.d.mts.map +1 -0
  111. package/dist/types.d.cts +2 -69
  112. package/dist/types.d.mts +2 -69
  113. package/dist/types.mjs +0 -1
  114. package/dist/utils/code-frames.cjs +2 -76
  115. package/dist/utils/code-frames.d.cts +2 -17
  116. package/dist/utils/code-frames.d.mts +2 -17
  117. package/dist/utils/code-frames.mjs +2 -76
  118. package/dist/utils/index.cjs +13 -12
  119. package/dist/utils/index.d.cts +5 -5
  120. package/dist/utils/index.d.mts +6 -5
  121. package/dist/utils/index.mjs +6 -5
  122. package/dist/utils/parse-error.cjs +2 -33
  123. package/dist/utils/parse-error.d.cts +2 -15
  124. package/dist/utils/parse-error.d.mts +2 -15
  125. package/dist/utils/parse-error.mjs +2 -33
  126. package/dist/utils/parse.cjs +3 -51
  127. package/dist/utils/parse.d.cts +2 -9
  128. package/dist/utils/parse.d.mts +2 -9
  129. package/dist/utils/parse.mjs +2 -51
  130. package/dist/utils/stringify.cjs +3 -67
  131. package/dist/utils/stringify.d.cts +2 -13
  132. package/dist/utils/stringify.d.mts +2 -13
  133. package/dist/utils/stringify.mjs +2 -67
  134. package/dist/utils/strip-comments.cjs +2 -85
  135. package/dist/utils/strip-comments.d.cts +2 -11
  136. package/dist/utils/strip-comments.d.mts +2 -11
  137. package/dist/utils/strip-comments.mjs +2 -86
  138. package/dist/utils-CVcIdLuL.mjs +0 -0
  139. package/dist/utils-Cz3OCwUK.cjs +0 -0
  140. package/package.json +8 -3
  141. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  142. package/dist/pointer/find-reference.d.cts.map +0 -1
  143. package/dist/pointer/find-reference.d.mts.map +0 -1
  144. package/dist/pointer/find-reference.mjs.map +0 -1
  145. package/dist/pointer/parse.d.cts.map +0 -1
  146. package/dist/pointer/parse.d.mts.map +0 -1
  147. package/dist/pointer/parse.mjs.map +0 -1
  148. package/dist/storm-json.d.cts.map +0 -1
  149. package/dist/storm-json.d.mts.map +0 -1
  150. package/dist/storm-json.mjs.map +0 -1
  151. package/dist/type-checks/src/get-object-tag.cjs +0 -15
  152. package/dist/type-checks/src/get-object-tag.mjs +0 -15
  153. package/dist/type-checks/src/get-object-tag.mjs.map +0 -1
  154. package/dist/type-checks/src/is-empty.cjs +0 -20
  155. package/dist/type-checks/src/is-empty.mjs +0 -21
  156. package/dist/type-checks/src/is-empty.mjs.map +0 -1
  157. package/dist/type-checks/src/is-non-null-object.cjs +0 -16
  158. package/dist/type-checks/src/is-non-null-object.mjs +0 -17
  159. package/dist/type-checks/src/is-non-null-object.mjs.map +0 -1
  160. package/dist/type-checks/src/is-null.cjs +0 -12
  161. package/dist/type-checks/src/is-null.mjs +0 -12
  162. package/dist/type-checks/src/is-null.mjs.map +0 -1
  163. package/dist/type-checks/src/is-number.cjs +0 -18
  164. package/dist/type-checks/src/is-number.mjs +0 -18
  165. package/dist/type-checks/src/is-number.mjs.map +0 -1
  166. package/dist/type-checks/src/is-object.cjs +0 -19
  167. package/dist/type-checks/src/is-object.mjs +0 -20
  168. package/dist/type-checks/src/is-object.mjs.map +0 -1
  169. package/dist/type-checks/src/is-plain-object.mjs.map +0 -1
  170. package/dist/type-checks/src/is-set-object.cjs +0 -19
  171. package/dist/type-checks/src/is-set-object.mjs +0 -20
  172. package/dist/type-checks/src/is-set-object.mjs.map +0 -1
  173. package/dist/type-checks/src/is-set.cjs +0 -19
  174. package/dist/type-checks/src/is-set.mjs +0 -20
  175. package/dist/type-checks/src/is-set.mjs.map +0 -1
  176. package/dist/type-checks/src/is-string.mjs.map +0 -1
  177. package/dist/type-checks/src/is-undefined.mjs.map +0 -1
  178. package/dist/types/src/base.cjs +0 -6
  179. package/dist/types/src/base.mjs +0 -6
  180. package/dist/types/src/base.mjs.map +0 -1
  181. package/dist/types/src/json.d.cts +0 -12
  182. package/dist/types/src/json.d.cts.map +0 -1
  183. package/dist/types/src/json.d.mts +0 -12
  184. package/dist/types/src/json.d.mts.map +0 -1
  185. package/dist/types.d.cts.map +0 -1
  186. package/dist/types.d.mts.map +0 -1
  187. package/dist/utils/code-frames.d.cts.map +0 -1
  188. package/dist/utils/code-frames.d.mts.map +0 -1
  189. package/dist/utils/code-frames.mjs.map +0 -1
  190. package/dist/utils/parse-error.d.cts.map +0 -1
  191. package/dist/utils/parse-error.d.mts.map +0 -1
  192. package/dist/utils/parse-error.mjs.map +0 -1
  193. package/dist/utils/parse.d.cts.map +0 -1
  194. package/dist/utils/parse.d.mts.map +0 -1
  195. package/dist/utils/parse.mjs.map +0 -1
  196. package/dist/utils/stringify.d.cts.map +0 -1
  197. package/dist/utils/stringify.d.mts.map +0 -1
  198. package/dist/utils/stringify.mjs.map +0 -1
  199. package/dist/utils/strip-comments.d.cts.map +0 -1
  200. package/dist/utils/strip-comments.d.mts.map +0 -1
  201. package/dist/utils/strip-comments.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.cjs CHANGED
@@ -1,16 +1,34 @@
1
- const require_utils_strip_comments = require('./utils/strip-comments.cjs');
2
- const require_utils_parse = require('./utils/parse.cjs');
3
- const require_utils_code_frames = require('./utils/code-frames.cjs');
4
- const require_utils_parse_error = require('./utils/parse-error.cjs');
5
- const require_utils_stringify = require('./utils/stringify.cjs');
6
- const require_storm_json = require('./storm-json.cjs');
7
- require('./utils/index.cjs');
1
+ const require_storm_json = require('./storm-json-6WpS7qnH.cjs');
2
+ const require_find_reference = require('./find-reference-BCg3dQx1.cjs');
3
+ const require_parse = require('./parse-KiRakdIR.cjs');
4
+ require('./pointer-Cc7IR0Bj.cjs');
5
+ const require_schema = require('./schema-D5Aqvh2i.cjs');
6
+ const require_strip_comments = require('./strip-comments-CtFoX0xG.cjs');
7
+ const require_parse$1 = require('./parse-wxSDzBPf.cjs');
8
+ const require_code_frames = require('./code-frames-Cv8r5tSN.cjs');
9
+ const require_parse_error = require('./parse-error-Dzwg4sdE.cjs');
10
+ const require_stringify = require('./stringify-DEw3S4_Z.cjs');
11
+ require('./types.cjs');
12
+ require('./utils-Cz3OCwUK.cjs');
8
13
 
9
14
  exports.StormJSON = require_storm_json.StormJSON;
10
- exports.codeFrameColumns = require_utils_code_frames.codeFrameColumns;
11
- exports.formatParseError = require_utils_parse_error.formatParseError;
12
- exports.invalidKeyChars = require_utils_stringify.invalidKeyChars;
13
- exports.parse = require_utils_parse.parse;
14
- exports.safeParse = require_utils_parse.safeParse;
15
- exports.stringify = require_utils_stringify.stringify;
16
- exports.stripComments = require_utils_strip_comments.stripComments;
15
+ exports.codeFrameColumns = require_code_frames.codeFrameColumns;
16
+ exports.escapePointerSegment = require_parse.escapePointerSegment;
17
+ exports.find = require_find_reference.find;
18
+ exports.formatJsonPointer = require_parse.formatJsonPointer;
19
+ exports.formatParseError = require_parse_error.formatParseError;
20
+ exports.invalidKeyChars = require_stringify.invalidKeyChars;
21
+ exports.isArrayEnd = require_find_reference.isArrayEnd;
22
+ exports.isArrayReference = require_find_reference.isArrayReference;
23
+ exports.isInteger = require_parse.isInteger;
24
+ exports.isJsonSchema7AllOfType = require_schema.isJsonSchema7AllOfType;
25
+ exports.isObjectReference = require_find_reference.isObjectReference;
26
+ exports.isRoot = require_parse.isRoot;
27
+ exports.isValidIndex = require_parse.isValidIndex;
28
+ exports.parent = require_parse.parent;
29
+ exports.parse = require_parse$1.parse;
30
+ exports.parseJsonPointer = require_parse.parseJsonPointer;
31
+ exports.safeParse = require_parse$1.safeParse;
32
+ exports.stringify = require_stringify.stringify;
33
+ exports.stripComments = require_strip_comments.stripComments;
34
+ exports.unescapePointerSegment = require_parse.unescapePointerSegment;
package/dist/index.d.cts CHANGED
@@ -1,8 +1,11 @@
1
- import { Class, ClassInstance, ClassTypeAnnotation, CompositeTypeAnnotation, CustomTypeAnnotation, InnerNode, JsonArray, JsonObject, JsonParseOptions, JsonParserInterface, JsonParserResult, JsonSerializeOptions, JsonValue, Leaf, LeafTypeAnnotation, PrimitiveJsonValue, PrimitiveTypeAnnotation, SerializableJsonValue, SimpleTypeAnnotation, SymbolTypeAnnotation, Tree, TypeAnnotation, TypedArrayAnnotation } from "./types.cjs";
2
- import { StormJSON } from "./storm-json.cjs";
3
- import { codeFrameColumns } from "./utils/code-frames.cjs";
4
- import { Options, parse, safeParse } from "./utils/parse.cjs";
5
- import { formatParseError } from "./utils/parse-error.cjs";
6
- import { invalidKeyChars, stringify } from "./utils/stringify.cjs";
7
- import { stripComments } from "./utils/strip-comments.cjs";
8
- export { Class, ClassInstance, ClassTypeAnnotation, CompositeTypeAnnotation, CustomTypeAnnotation, InnerNode, JsonArray, JsonObject, JsonParseOptions, JsonParserInterface, JsonParserResult, JsonSerializeOptions, JsonValue, Leaf, LeafTypeAnnotation, Options, PrimitiveJsonValue, PrimitiveTypeAnnotation, SerializableJsonValue, SimpleTypeAnnotation, StormJSON, SymbolTypeAnnotation, Tree, TypeAnnotation, TypedArrayAnnotation, codeFrameColumns, formatParseError, invalidKeyChars, parse, safeParse, stringify, stripComments };
1
+ import { a as isArrayEnd, i as find, n as ObjectReference, o as isArrayReference, r as Reference, s as isObjectReference, t as ArrayReference } from "./find-reference-C-YleCds.cjs";
2
+ import { a as isValidIndex, c as unescapePointerSegment, i as isRoot, n as formatJsonPointer, o as parent, r as isInteger, s as parseJsonPointer, t as escapePointerSegment } from "./parse-DZfi3d96.cjs";
3
+ import { $ as TypedArrayAnnotation, A as JsonSchema7PrimitiveUnionType, B as JsonSchema7UnionType, C as JsonSchema7NativeEnumType, D as JsonSchema7NumberType, E as JsonSchema7NullableType, F as JsonSchema7StringType, G as LeafTypeAnnotation, H as JsonSerializeOptions, I as JsonSchema7TupleType, J as SerializableJsonValue, K as PrimitiveJsonValue, L as JsonSchema7Type, M as JsonSchema7RecordType, N as JsonSchema7RefType, O as JsonSchema7ObjectType, P as JsonSchema7SetType, Q as TypeAnnotation, R as JsonSchema7TypeUnion, S as JsonSchema7Meta, T as JsonSchema7NullType, U as JsonValue, V as JsonSchema7UnknownType, W as Leaf, X as SymbolTypeAnnotation, Y as SimpleTypeAnnotation, Z as Tree, _ as JsonSchema7BooleanType, a as CustomTypeAnnotation, b as JsonSchema7LiteralType, c as JsonObject, d as JsonParserResult, f as JsonSchema7AllOfType, g as JsonSchema7BigintType, h as JsonSchema7ArrayType, i as CompositeTypeAnnotation, j as JsonSchema7RecordPropertyNamesType, k as JsonSchema7Primitive, l as JsonParseOptions, m as JsonSchema7AnyType, n as ClassInstance, o as InnerNode, p as JsonSchema7AnyOfType, q as PrimitiveTypeAnnotation, r as ClassTypeAnnotation, s as JsonArray, t as Class, u as JsonParserInterface, v as JsonSchema7DateType, w as JsonSchema7NeverType, x as JsonSchema7MapType, y as JsonSchema7EnumType, z as JsonSchema7UndefinedType } from "./types-BUeTTE_U.cjs";
4
+ import { t as isJsonSchema7AllOfType } from "./schema-B1RVJHzJ.cjs";
5
+ import { t as StormJSON } from "./storm-json-AaFeOao2.cjs";
6
+ import { t as codeFrameColumns } from "./code-frames-BUtrssZ5.cjs";
7
+ import { n as parse, r as safeParse, t as Options } from "./parse-BGlhbY16.cjs";
8
+ import { t as formatParseError } from "./parse-error-7K8s4vWf.cjs";
9
+ import { n as stringify, t as invalidKeyChars } from "./stringify-Bc8OkhIr.cjs";
10
+ import { t as stripComments } from "./strip-comments-Cz_Wc25t.cjs";
11
+ export { ArrayReference, Class, ClassInstance, ClassTypeAnnotation, CompositeTypeAnnotation, CustomTypeAnnotation, InnerNode, JsonArray, JsonObject, JsonParseOptions, JsonParserInterface, JsonParserResult, JsonSchema7AllOfType, JsonSchema7AnyOfType, JsonSchema7AnyType, JsonSchema7ArrayType, JsonSchema7BigintType, JsonSchema7BooleanType, JsonSchema7DateType, JsonSchema7EnumType, JsonSchema7LiteralType, JsonSchema7MapType, JsonSchema7Meta, JsonSchema7NativeEnumType, JsonSchema7NeverType, JsonSchema7NullType, JsonSchema7NullableType, JsonSchema7NumberType, JsonSchema7ObjectType, JsonSchema7Primitive, JsonSchema7PrimitiveUnionType, JsonSchema7RecordPropertyNamesType, JsonSchema7RecordType, JsonSchema7RefType, JsonSchema7SetType, JsonSchema7StringType, JsonSchema7TupleType, JsonSchema7Type, JsonSchema7TypeUnion, JsonSchema7UndefinedType, JsonSchema7UnionType, JsonSchema7UnknownType, JsonSerializeOptions, JsonValue, Leaf, LeafTypeAnnotation, ObjectReference, Options, PrimitiveJsonValue, PrimitiveTypeAnnotation, Reference, SerializableJsonValue, SimpleTypeAnnotation, StormJSON, SymbolTypeAnnotation, Tree, TypeAnnotation, TypedArrayAnnotation, codeFrameColumns, escapePointerSegment, find, formatJsonPointer, formatParseError, invalidKeyChars, isArrayEnd, isArrayReference, isInteger, isJsonSchema7AllOfType, isObjectReference, isRoot, isValidIndex, parent, parse, parseJsonPointer, safeParse, stringify, stripComments, unescapePointerSegment };
package/dist/index.d.mts CHANGED
@@ -1,9 +1,12 @@
1
- import { Class, ClassInstance, ClassTypeAnnotation, CompositeTypeAnnotation, CustomTypeAnnotation, InnerNode, JsonArray, JsonObject, JsonParseOptions, JsonParserInterface, JsonParserResult, JsonSerializeOptions, JsonValue, Leaf, LeafTypeAnnotation, PrimitiveJsonValue, PrimitiveTypeAnnotation, SerializableJsonValue, SimpleTypeAnnotation, SymbolTypeAnnotation, Tree, TypeAnnotation, TypedArrayAnnotation } from "./types.mjs";
2
- import { StormJSON } from "./storm-json.mjs";
3
- import { codeFrameColumns } from "./utils/code-frames.mjs";
4
- import { Options, parse, safeParse } from "./utils/parse.mjs";
5
- import { formatParseError } from "./utils/parse-error.mjs";
6
- import { invalidKeyChars, stringify } from "./utils/stringify.mjs";
7
- import { stripComments } from "./utils/strip-comments.mjs";
8
- import "./utils/index.mjs";
9
- export { Class, ClassInstance, ClassTypeAnnotation, CompositeTypeAnnotation, CustomTypeAnnotation, InnerNode, JsonArray, JsonObject, JsonParseOptions, JsonParserInterface, JsonParserResult, JsonSerializeOptions, JsonValue, Leaf, LeafTypeAnnotation, Options, PrimitiveJsonValue, PrimitiveTypeAnnotation, SerializableJsonValue, SimpleTypeAnnotation, StormJSON, SymbolTypeAnnotation, Tree, TypeAnnotation, TypedArrayAnnotation, codeFrameColumns, formatParseError, invalidKeyChars, parse, safeParse, stringify, stripComments };
1
+ import { a as isArrayEnd, i as find, n as ObjectReference, o as isArrayReference, r as Reference, s as isObjectReference, t as ArrayReference } from "./find-reference-b7rRdLFx.mjs";
2
+ import { a as isValidIndex, c as unescapePointerSegment, i as isRoot, n as formatJsonPointer, o as parent, r as isInteger, s as parseJsonPointer, t as escapePointerSegment } from "./parse-ZRTh45ZI.mjs";
3
+ import { $ as TypedArrayAnnotation, A as JsonSchema7PrimitiveUnionType, B as JsonSchema7UnionType, C as JsonSchema7NativeEnumType, D as JsonSchema7NumberType, E as JsonSchema7NullableType, F as JsonSchema7StringType, G as LeafTypeAnnotation, H as JsonSerializeOptions, I as JsonSchema7TupleType, J as SerializableJsonValue, K as PrimitiveJsonValue, L as JsonSchema7Type, M as JsonSchema7RecordType, N as JsonSchema7RefType, O as JsonSchema7ObjectType, P as JsonSchema7SetType, Q as TypeAnnotation, R as JsonSchema7TypeUnion, S as JsonSchema7Meta, T as JsonSchema7NullType, U as JsonValue, V as JsonSchema7UnknownType, W as Leaf, X as SymbolTypeAnnotation, Y as SimpleTypeAnnotation, Z as Tree, _ as JsonSchema7BooleanType, a as CustomTypeAnnotation, b as JsonSchema7LiteralType, c as JsonObject, d as JsonParserResult, f as JsonSchema7AllOfType, g as JsonSchema7BigintType, h as JsonSchema7ArrayType, i as CompositeTypeAnnotation, j as JsonSchema7RecordPropertyNamesType, k as JsonSchema7Primitive, l as JsonParseOptions, m as JsonSchema7AnyType, n as ClassInstance, o as InnerNode, p as JsonSchema7AnyOfType, q as PrimitiveTypeAnnotation, r as ClassTypeAnnotation, s as JsonArray, t as Class, u as JsonParserInterface, v as JsonSchema7DateType, w as JsonSchema7NeverType, x as JsonSchema7MapType, y as JsonSchema7EnumType, z as JsonSchema7UndefinedType } from "./types-C_KlcCNw.mjs";
4
+ import { t as isJsonSchema7AllOfType } from "./schema-ai_NU-JC.mjs";
5
+ import { t as StormJSON } from "./storm-json-BvRkzAlR.mjs";
6
+ import { t as codeFrameColumns } from "./code-frames-BMkA9i6j.mjs";
7
+ import { n as parse, r as safeParse, t as Options } from "./parse-DgYW5BBj.mjs";
8
+ import { t as formatParseError } from "./parse-error-DY_MelEh.mjs";
9
+ import { n as stringify, t as invalidKeyChars } from "./stringify-B6iAeg0u.mjs";
10
+ import { t as stripComments } from "./strip-comments-Bg3R_Y4S.mjs";
11
+ import "./index-VWno75SQ.mjs";
12
+ export { ArrayReference, Class, ClassInstance, ClassTypeAnnotation, CompositeTypeAnnotation, CustomTypeAnnotation, InnerNode, JsonArray, JsonObject, JsonParseOptions, JsonParserInterface, JsonParserResult, JsonSchema7AllOfType, JsonSchema7AnyOfType, JsonSchema7AnyType, JsonSchema7ArrayType, JsonSchema7BigintType, JsonSchema7BooleanType, JsonSchema7DateType, JsonSchema7EnumType, JsonSchema7LiteralType, JsonSchema7MapType, JsonSchema7Meta, JsonSchema7NativeEnumType, JsonSchema7NeverType, JsonSchema7NullType, JsonSchema7NullableType, JsonSchema7NumberType, JsonSchema7ObjectType, JsonSchema7Primitive, JsonSchema7PrimitiveUnionType, JsonSchema7RecordPropertyNamesType, JsonSchema7RecordType, JsonSchema7RefType, JsonSchema7SetType, JsonSchema7StringType, JsonSchema7TupleType, JsonSchema7Type, JsonSchema7TypeUnion, JsonSchema7UndefinedType, JsonSchema7UnionType, JsonSchema7UnknownType, JsonSerializeOptions, JsonValue, Leaf, LeafTypeAnnotation, ObjectReference, Options, PrimitiveJsonValue, PrimitiveTypeAnnotation, Reference, SerializableJsonValue, SimpleTypeAnnotation, StormJSON, SymbolTypeAnnotation, Tree, TypeAnnotation, TypedArrayAnnotation, codeFrameColumns, escapePointerSegment, find, formatJsonPointer, formatParseError, invalidKeyChars, isArrayEnd, isArrayReference, isInteger, isJsonSchema7AllOfType, isObjectReference, isRoot, isValidIndex, parent, parse, parseJsonPointer, safeParse, stringify, stripComments, unescapePointerSegment };
package/dist/index.mjs CHANGED
@@ -1,9 +1,14 @@
1
- import { stripComments } from "./utils/strip-comments.mjs";
2
- import { parse, safeParse } from "./utils/parse.mjs";
3
- import { codeFrameColumns } from "./utils/code-frames.mjs";
4
- import { formatParseError } from "./utils/parse-error.mjs";
5
- import { invalidKeyChars, stringify } from "./utils/stringify.mjs";
6
- import { StormJSON } from "./storm-json.mjs";
7
- import "./utils/index.mjs";
1
+ import { i as isObjectReference, n as isArrayEnd, r as isArrayReference, t as find } from "./find-reference-woYMiWzN.mjs";
2
+ import { a as isValidIndex, c as unescapePointerSegment, i as isRoot, n as formatJsonPointer, o as parent, r as isInteger, s as parseJsonPointer, t as escapePointerSegment } from "./parse-Crgv3Nl1.mjs";
3
+ import "./pointer-CiTXvh1G.mjs";
4
+ import { t as isJsonSchema7AllOfType } from "./schema-CfhPLy30.mjs";
5
+ import { t as stripComments } from "./strip-comments-CMaAgTqz.mjs";
6
+ import { n as safeParse, t as parse } from "./parse-obdkJfj5.mjs";
7
+ import { t as codeFrameColumns } from "./code-frames-DISWdYL6.mjs";
8
+ import { t as formatParseError } from "./parse-error-C3Qmubee.mjs";
9
+ import { n as stringify, t as invalidKeyChars } from "./stringify-D5baUfEe.mjs";
10
+ import { t as StormJSON } from "./storm-json-Cy3PuAhj.mjs";
11
+ import "./types.mjs";
12
+ import "./utils-CVcIdLuL.mjs";
8
13
 
9
- export { StormJSON, codeFrameColumns, formatParseError, invalidKeyChars, parse, safeParse, stringify, stripComments };
14
+ export { StormJSON, codeFrameColumns, escapePointerSegment, find, formatJsonPointer, formatParseError, invalidKeyChars, isArrayEnd, isArrayReference, isInteger, isJsonSchema7AllOfType, isObjectReference, isRoot, isValidIndex, parent, parse, parseJsonPointer, safeParse, stringify, stripComments, unescapePointerSegment };
@@ -0,0 +1,31 @@
1
+ //#region ../type-checks/src/get-object-tag.ts
2
+ /**
3
+ * Gets the `toStringTag` of `obj`.
4
+ *
5
+ * @param value - The obj to query.
6
+ * @returns Returns the `toStringTag`.
7
+ */
8
+ const getObjectTag = (value) => {
9
+ if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
10
+ return Object.prototype.toString.call(value);
11
+ };
12
+
13
+ //#endregion
14
+ //#region ../type-checks/src/is-number.ts
15
+ /**
16
+ * Check if the provided value's type is `number`
17
+ *
18
+ * @param value - The value to type check
19
+ * @returns An indicator specifying if the value provided is of type `number`
20
+ */
21
+ const isNumber = (value) => {
22
+ try {
23
+ return value instanceof Number || typeof value === "number" || Number(value) === value;
24
+ } catch {
25
+ return false;
26
+ }
27
+ };
28
+
29
+ //#endregion
30
+ export { getObjectTag as n, isNumber as t };
31
+ //# sourceMappingURL=is-number-BIwzZzyi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-number-BIwzZzyi.mjs","names":[],"sources":["../../type-checks/src/get-object-tag.ts","../../type-checks/src/is-number.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\n/**\n * Gets the `toStringTag` of `obj`.\n *\n * @param value - The obj to query.\n * @returns Returns the `toStringTag`.\n */\nexport const getObjectTag = (value: unknown): string => {\n if (value == null) {\n return value === undefined ? \"[object Undefined]\" : \"[object Null]\";\n }\n return Object.prototype.toString.call(value);\n};\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 type { AnyNumber } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Check if the provided value's type is `number`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number`\n */\nexport const isNumber = (value: unknown): value is number => {\n try {\n return (\n value instanceof Number ||\n typeof value === \"number\" ||\n Number(value) === value\n );\n } catch {\n return false;\n }\n};\n\n/**\n * Check if the provided value's type is `AnyNumber`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `AnyNumber`\n */\nexport function isAnyNumber(value?: any): value is AnyNumber {\n return isNumber(value) || getObjectTag(value) === \"[object Number]\";\n}\n"],"mappings":";;;;;;;AAwBA,MAAa,gBAAgB,UAA2B;AACtD,KAAI,SAAS,KACX,QAAO,UAAU,SAAY,uBAAuB;AAEtD,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM;;;;;;;;;;;ACD9C,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SACE,iBAAiB,UACjB,OAAO,UAAU,YACjB,OAAO,MAAM,KAAK;SAEd;AACN,SAAO"}
@@ -0,0 +1,42 @@
1
+
2
+ //#region ../type-checks/src/get-object-tag.ts
3
+ /**
4
+ * Gets the `toStringTag` of `obj`.
5
+ *
6
+ * @param value - The obj to query.
7
+ * @returns Returns the `toStringTag`.
8
+ */
9
+ const getObjectTag = (value) => {
10
+ if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
11
+ return Object.prototype.toString.call(value);
12
+ };
13
+
14
+ //#endregion
15
+ //#region ../type-checks/src/is-number.ts
16
+ /**
17
+ * Check if the provided value's type is `number`
18
+ *
19
+ * @param value - The value to type check
20
+ * @returns An indicator specifying if the value provided is of type `number`
21
+ */
22
+ const isNumber = (value) => {
23
+ try {
24
+ return value instanceof Number || typeof value === "number" || Number(value) === value;
25
+ } catch {
26
+ return false;
27
+ }
28
+ };
29
+
30
+ //#endregion
31
+ Object.defineProperty(exports, 'getObjectTag', {
32
+ enumerable: true,
33
+ get: function () {
34
+ return getObjectTag;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, 'isNumber', {
38
+ enumerable: true,
39
+ get: function () {
40
+ return isNumber;
41
+ }
42
+ });
@@ -1,4 +1,4 @@
1
- import { getObjectTag } from "./get-object-tag.mjs";
1
+ import { n as getObjectTag } from "./is-number-BIwzZzyi.mjs";
2
2
 
3
3
  //#region ../type-checks/src/is-plain-object.ts
4
4
  /**
@@ -60,5 +60,21 @@ const isPlainObject = (obj) => {
60
60
  };
61
61
 
62
62
  //#endregion
63
- export { isPlainObject };
64
- //# sourceMappingURL=is-plain-object.mjs.map
63
+ //#region ../type-checks/src/is-object.ts
64
+ /**
65
+ * Check if the provided value's type is `Object`
66
+ *
67
+ * @param value - The value to type check
68
+ * @returns An indicator specifying if the value provided is of type `Object`
69
+ */
70
+ const isObject = (value) => {
71
+ try {
72
+ return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
73
+ } catch {
74
+ return false;
75
+ }
76
+ };
77
+
78
+ //#endregion
79
+ export { isObject as t };
80
+ //# sourceMappingURL=is-object-BpfmzHWa.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-object-BpfmzHWa.mjs","names":[],"sources":["../../type-checks/src/is-plain-object.ts","../../type-checks/src/is-object.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 { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (obj: unknown) => {\n return typeof obj === \"object\" && obj !== null;\n};\n\n/**\n * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @example\n * ```typescript\n * function Foo() {\n * this.a = 1\n * }\n *\n * isPlainObject(new Foo)\n * // => false\n *\n * isPlainObject([1, 2, 3])\n * // => false\n *\n * isPlainObject({ 'x': 0, 'y': 0 })\n * // => true\n *\n * isPlainObject(Object.create(null))\n * // => true\n * ```\n *\n * @param obj - The value to check.\n * @returns Returns `true` if `obj` is a plain object, else `false`.\n */\nexport const isPlainObject = (obj: unknown): obj is PlainObject => {\n if (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") {\n return false;\n }\n if (Object.getPrototypeOf(obj) === null) {\n return true;\n }\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\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\n/* eslint-disable ts/no-unsafe-function-type */\n/* eslint-disable ts/no-unsafe-call */\n\nimport type { NativeClass } from \"@stryke/types/base\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n// Prepare\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n\n/** Is ES6+ class */\nexport function isNativeClass(value?: any): value is NativeClass {\n // NOTE TO DEVELOPER: If any of this changes, isClass must also be updated\n return (\n typeof value === \"function\" && isNativeClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is a conventional class\n *\n * @remarks\n * Is Conventional Class\n * Looks for function with capital first letter MyClass\n * First letter is the 9th character\n * If changed, isClass must also be updated\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a conventional class\n */\nexport function isConventionalClass(value?: any): value is Function {\n return (\n typeof value === \"function\" &&\n isConventionalClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport function isClass(value?: any): value is Function | NativeClass; // only guarantee of truth type, not of validity\nexport function isClass(value?: any): boolean {\n return typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport const isObject = (value: unknown): value is object => {\n try {\n return (\n typeof value === \"object\" ||\n (Boolean(value) && value?.constructor === Object) ||\n isPlainObject(value)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,gBAAgB,QAAiB;AAC5C,QAAO,OAAO,QAAQ,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B5C,MAAa,iBAAiB,QAAqC;AACjE,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAC9C,QAAO;AAET,KAAI,OAAO,eAAe,IAAI,KAAK,KACjC,QAAO;CAET,IAAI,QAAQ;AACZ,QAAO,OAAO,eAAe,MAAM,KAAK,KACtC,SAAQ,OAAO,eAAe,MAAM;AAEtC,QAAO,OAAO,eAAe,IAAI,KAAK;;;;;;;;;;;ACVxC,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SACE,OAAO,UAAU,YAChB,QAAQ,MAAM,IAAI,OAAO,gBAAgB,UAC1C,cAAc,MAAM;SAEhB;AACN,SAAO"}
@@ -1,4 +1,4 @@
1
- const require_get_object_tag = require('./get-object-tag.cjs');
1
+ const require_is_number = require('./is-number-c5xguIbS.cjs');
2
2
 
3
3
  //#region ../type-checks/src/is-plain-object.ts
4
4
  /**
@@ -52,7 +52,7 @@ const isObjectLike = (obj) => {
52
52
  * @returns Returns `true` if `obj` is a plain object, else `false`.
53
53
  */
54
54
  const isPlainObject = (obj) => {
55
- if (!isObjectLike(obj) || require_get_object_tag.getObjectTag(obj) !== "[object Object]") return false;
55
+ if (!isObjectLike(obj) || require_is_number.getObjectTag(obj) !== "[object Object]") return false;
56
56
  if (Object.getPrototypeOf(obj) === null) return true;
57
57
  let proto = obj;
58
58
  while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
@@ -60,4 +60,25 @@ const isPlainObject = (obj) => {
60
60
  };
61
61
 
62
62
  //#endregion
63
- exports.isPlainObject = isPlainObject;
63
+ //#region ../type-checks/src/is-object.ts
64
+ /**
65
+ * Check if the provided value's type is `Object`
66
+ *
67
+ * @param value - The value to type check
68
+ * @returns An indicator specifying if the value provided is of type `Object`
69
+ */
70
+ const isObject = (value) => {
71
+ try {
72
+ return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
73
+ } catch {
74
+ return false;
75
+ }
76
+ };
77
+
78
+ //#endregion
79
+ Object.defineProperty(exports, 'isObject', {
80
+ enumerable: true,
81
+ get: function () {
82
+ return isObject;
83
+ }
84
+ });
@@ -1,3 +1,4 @@
1
+
1
2
  //#region ../type-checks/src/is-string.ts
2
3
  const isString = (value) => {
3
4
  try {
@@ -8,5 +9,9 @@ const isString = (value) => {
8
9
  };
9
10
 
10
11
  //#endregion
11
- export { isString };
12
- //# sourceMappingURL=is-string.mjs.map
12
+ Object.defineProperty(exports, 'isString', {
13
+ enumerable: true,
14
+ get: function () {
15
+ return isString;
16
+ }
17
+ });
@@ -1,4 +1,3 @@
1
-
2
1
  //#region ../type-checks/src/is-string.ts
3
2
  const isString = (value) => {
4
3
  try {
@@ -9,4 +8,5 @@ const isString = (value) => {
9
8
  };
10
9
 
11
10
  //#endregion
12
- exports.isString = isString;
11
+ export { isString as t };
12
+ //# sourceMappingURL=is-string-CLiBUSKV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-string-CLiBUSKV.mjs","names":[],"sources":["../../type-checks/src/is-string.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\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SAAO,OAAO,UAAU;SAClB;AACN,SAAO"}
@@ -1,8 +1,8 @@
1
-
2
1
  //#region ../type-checks/src/is-undefined.ts
3
2
  const isUndefined = (value) => {
4
3
  return value === void 0;
5
4
  };
6
5
 
7
6
  //#endregion
8
- exports.isUndefined = isUndefined;
7
+ export { isUndefined as t };
8
+ //# sourceMappingURL=is-undefined-CmyJWYGD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-undefined-CmyJWYGD.mjs","names":[],"sources":["../../type-checks/src/is-undefined.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\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n"],"mappings":";AAkBA,MAAa,eAAe,UAAuC;AACjE,QAAO,UAAU"}
@@ -1,8 +1,13 @@
1
+
1
2
  //#region ../type-checks/src/is-undefined.ts
2
3
  const isUndefined = (value) => {
3
4
  return value === void 0;
4
5
  };
5
6
 
6
7
  //#endregion
7
- export { isUndefined };
8
- //# sourceMappingURL=is-undefined.mjs.map
8
+ Object.defineProperty(exports, 'isUndefined', {
9
+ enumerable: true,
10
+ get: function () {
11
+ return isUndefined;
12
+ }
13
+ });
@@ -0,0 +1,9 @@
1
+ //#region src/utils/parse.d.ts
2
+ interface Options {
3
+ strict?: boolean;
4
+ }
5
+ declare function parse<T = unknown>(value: any, options?: Options): T;
6
+ declare function safeParse<T = unknown>(value: any, options?: Options): T;
7
+ //#endregion
8
+ export { parse as n, safeParse as r, Options as t };
9
+ //# sourceMappingURL=parse-BGlhbY16.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-BGlhbY16.d.cts","names":[],"sources":["../src/utils/parse.ts"],"sourcesContent":[],"mappings":";UA4CiB,OAAA;EAAA,MAAA,CAAA,EAAA,OAAO;AAIxB;AAmEgB,iBAnEA,KAmE4C,CAAA,IAAA,OAAgB,CAAA,CAAA,KAAA,EAAA,GAAA,EAAA,OAAA,CAAA,EAnEpB,OAmEoB,CAAA,EAnEL,CAmEK;iBAA5D,6CAA4C,UAAe"}
@@ -0,0 +1,81 @@
1
+ import { t as isNumber } from "./is-number-BIwzZzyi.mjs";
2
+ import { t as isString } from "./is-string-CLiBUSKV.mjs";
3
+
4
+ //#region src/pointer/parse.ts
5
+ const TILDE_ONE = /~1/g;
6
+ const TILDE_ZERO = /~0/g;
7
+ const TILDE = /~/g;
8
+ const FORWARD_SLASH = /\//g;
9
+ /**
10
+ * Escapes a JSON pointer path segment.
11
+ *
12
+ * @param segment - JSON pointer path segment.
13
+ * @returns Escaped JSON pointer path segment.
14
+ */
15
+ function escapePointerSegment(segment) {
16
+ if (!segment.includes("/") && !segment.includes("~")) return segment;
17
+ return segment.replace(TILDE, "~0").replace(FORWARD_SLASH, "~1");
18
+ }
19
+ /**
20
+ * Unescapes a JSON pointer path segment.
21
+ *
22
+ * @param segment - JSON pointer path segment.
23
+ * @returns Unescaped JSON pointer path segment.
24
+ */
25
+ function unescapePointerSegment(segment) {
26
+ if (!segment.includes("~")) return segment;
27
+ return segment.replace(TILDE_ONE, "/").replace(TILDE_ZERO, "~");
28
+ }
29
+ /**
30
+ * Convert JSON pointer like "/foo/bar" to array like ["", "foo", "bar"], while
31
+ * also un-escaping reserved characters.
32
+ */
33
+ function parseJsonPointer(pointer) {
34
+ if (!pointer) return [];
35
+ return pointer.slice(1).split("/").map((segment) => unescapePointerSegment(segment));
36
+ }
37
+ /**
38
+ * Escape and format a path array like ["", "foo", "bar"] to JSON pointer
39
+ * like "/foo/bar".
40
+ */
41
+ function formatJsonPointer(path) {
42
+ if (isRoot(path)) return "";
43
+ return `/${path.map((segment) => escapePointerSegment(String(segment))).join("/")}`;
44
+ }
45
+ /**
46
+ * Returns true if JSON Pointer points to root value, false otherwise.
47
+ */
48
+ const isRoot = (path) => isString(path) ? path === "" : isNumber(path) ? path === 0 : Array.isArray(path) && path.length === 0;
49
+ /**
50
+ * Returns parent path, e.g. for ['foo', 'bar', 'baz'] returns ['foo', 'bar'].
51
+ */
52
+ function parent(path) {
53
+ if (path.length === 0) throw new Error("NO_PARENT");
54
+ return path.slice(0, -1);
55
+ }
56
+ /**
57
+ * Check if path component can be a valid array index.
58
+ */
59
+ function isValidIndex(index) {
60
+ if (isNumber(index)) return true;
61
+ const n = Number.parseInt(index, 10);
62
+ return String(n) === index && n >= 0;
63
+ }
64
+ const isInteger = (str) => {
65
+ const len = str.length;
66
+ let i = 0;
67
+ let charCode;
68
+ while (i < len) {
69
+ charCode = str.codePointAt(i);
70
+ if (charCode >= 48 && charCode <= 57) {
71
+ i++;
72
+ continue;
73
+ }
74
+ return false;
75
+ }
76
+ return true;
77
+ };
78
+
79
+ //#endregion
80
+ export { isValidIndex as a, unescapePointerSegment as c, isRoot as i, formatJsonPointer as n, parent as o, isInteger as r, parseJsonPointer as s, escapePointerSegment as t };
81
+ //# sourceMappingURL=parse-Crgv3Nl1.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-Crgv3Nl1.mjs","names":["charCode: any"],"sources":["../src/pointer/parse.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 { isString } from \"@stryke/type-checks/is-string\";\nimport type { JsonPointerPath } from \"@stryke/types/json\";\n\nconst TILDE_ONE = /~1/g;\nconst TILDE_ZERO = /~0/g;\nconst TILDE = /~/g;\nconst FORWARD_SLASH = /\\//g;\n\n/**\n * Escapes a JSON pointer path segment.\n *\n * @param segment - JSON pointer path segment.\n * @returns Escaped JSON pointer path segment.\n */\nexport function escapePointerSegment(segment: string): string {\n if (!segment.includes(\"/\") && !segment.includes(\"~\")) {\n return segment;\n }\n\n return segment.replace(TILDE, \"~0\").replace(FORWARD_SLASH, \"~1\");\n}\n\n/**\n * Unescapes a JSON pointer path segment.\n *\n * @param segment - JSON pointer path segment.\n * @returns Unescaped JSON pointer path segment.\n */\nexport function unescapePointerSegment(segment: string): string {\n if (!segment.includes(\"~\")) {\n return segment;\n }\n\n return segment.replace(TILDE_ONE, \"/\").replace(TILDE_ZERO, \"~\");\n}\n\n/**\n * Convert JSON pointer like \"/foo/bar\" to array like [\"\", \"foo\", \"bar\"], while\n * also un-escaping reserved characters.\n */\nexport function parseJsonPointer(pointer: string): JsonPointerPath {\n if (!pointer) return [];\n // TODO: Performance of this line can be improved: (1) don't use .split(); (2) don't use .map().\n return pointer\n .slice(1)\n .split(\"/\")\n .map(segment => unescapePointerSegment(segment));\n}\n\n/**\n * Escape and format a path array like [\"\", \"foo\", \"bar\"] to JSON pointer\n * like \"/foo/bar\".\n */\nexport function formatJsonPointer(path: JsonPointerPath): string {\n // eslint-disable-next-line ts/no-use-before-define\n if (isRoot(path)) {\n return \"\";\n }\n\n return `/${path.map(segment => escapePointerSegment(String(segment))).join(\"/\")}`;\n}\n\n/**\n * Returns true if JSON Pointer points to root value, false otherwise.\n */\nexport const isRoot = (path: string | number | JsonPointerPath): boolean =>\n isString(path)\n ? path === \"\"\n : isNumber(path)\n ? path === 0\n : Array.isArray(path) && path.length === 0;\n\n/**\n * Returns parent path, e.g. for ['foo', 'bar', 'baz'] returns ['foo', 'bar'].\n */\nexport function parent(path: JsonPointerPath): JsonPointerPath {\n if (path.length === 0) {\n throw new Error(\"NO_PARENT\");\n }\n\n return path.slice(0, -1);\n}\n\n/**\n * Check if path component can be a valid array index.\n */\nexport function isValidIndex(index: string | number): boolean {\n if (isNumber(index)) {\n return true;\n }\n\n const n = Number.parseInt(index, 10);\n\n return String(n) === index && n >= 0;\n}\n\nexport const isInteger = (str: string): boolean => {\n const len = str.length;\n let i = 0;\n let charCode: any;\n while (i < len) {\n charCode = str.codePointAt(i);\n if (charCode >= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n};\n"],"mappings":";;;;AAsBA,MAAM,YAAY;AAClB,MAAM,aAAa;AACnB,MAAM,QAAQ;AACd,MAAM,gBAAgB;;;;;;;AAQtB,SAAgB,qBAAqB,SAAyB;AAC5D,KAAI,CAAC,QAAQ,SAAS,IAAI,IAAI,CAAC,QAAQ,SAAS,IAAI,CAClD,QAAO;AAGT,QAAO,QAAQ,QAAQ,OAAO,KAAK,CAAC,QAAQ,eAAe,KAAK;;;;;;;;AASlE,SAAgB,uBAAuB,SAAyB;AAC9D,KAAI,CAAC,QAAQ,SAAS,IAAI,CACxB,QAAO;AAGT,QAAO,QAAQ,QAAQ,WAAW,IAAI,CAAC,QAAQ,YAAY,IAAI;;;;;;AAOjE,SAAgB,iBAAiB,SAAkC;AACjE,KAAI,CAAC,QAAS,QAAO,EAAE;AAEvB,QAAO,QACJ,MAAM,EAAE,CACR,MAAM,IAAI,CACV,KAAI,YAAW,uBAAuB,QAAQ,CAAC;;;;;;AAOpD,SAAgB,kBAAkB,MAA+B;AAE/D,KAAI,OAAO,KAAK,CACd,QAAO;AAGT,QAAO,IAAI,KAAK,KAAI,YAAW,qBAAqB,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI;;;;;AAMjF,MAAa,UAAU,SACrB,SAAS,KAAK,GACV,SAAS,KACT,SAAS,KAAK,GACZ,SAAS,IACT,MAAM,QAAQ,KAAK,IAAI,KAAK,WAAW;;;;AAK/C,SAAgB,OAAO,MAAwC;AAC7D,KAAI,KAAK,WAAW,EAClB,OAAM,IAAI,MAAM,YAAY;AAG9B,QAAO,KAAK,MAAM,GAAG,GAAG;;;;;AAM1B,SAAgB,aAAa,OAAiC;AAC5D,KAAI,SAAS,MAAM,CACjB,QAAO;CAGT,MAAM,IAAI,OAAO,SAAS,OAAO,GAAG;AAEpC,QAAO,OAAO,EAAE,KAAK,SAAS,KAAK;;AAGrC,MAAa,aAAa,QAAyB;CACjD,MAAM,MAAM,IAAI;CAChB,IAAI,IAAI;CACR,IAAIA;AACJ,QAAO,IAAI,KAAK;AACd,aAAW,IAAI,YAAY,EAAE;AAC7B,MAAI,YAAY,MAAM,YAAY,IAAI;AACpC;AACA;;AAEF,SAAO;;AAET,QAAO"}
@@ -0,0 +1,51 @@
1
+ //#region ../types/src/json.d.ts
2
+
3
+ /**
4
+ * Matches a JSON pointer's path segments.
5
+ *
6
+ * @remarks
7
+ * These segments are used to navigate through the JSON object structure and point to a specific, referenced value.
8
+ */
9
+ type JsonPointerPath = (string | number)[];
10
+ //#endregion
11
+ //#region src/pointer/parse.d.ts
12
+ /**
13
+ * Escapes a JSON pointer path segment.
14
+ *
15
+ * @param segment - JSON pointer path segment.
16
+ * @returns Escaped JSON pointer path segment.
17
+ */
18
+ declare function escapePointerSegment(segment: string): string;
19
+ /**
20
+ * Unescapes a JSON pointer path segment.
21
+ *
22
+ * @param segment - JSON pointer path segment.
23
+ * @returns Unescaped JSON pointer path segment.
24
+ */
25
+ declare function unescapePointerSegment(segment: string): string;
26
+ /**
27
+ * Convert JSON pointer like "/foo/bar" to array like ["", "foo", "bar"], while
28
+ * also un-escaping reserved characters.
29
+ */
30
+ declare function parseJsonPointer(pointer: string): JsonPointerPath;
31
+ /**
32
+ * Escape and format a path array like ["", "foo", "bar"] to JSON pointer
33
+ * like "/foo/bar".
34
+ */
35
+ declare function formatJsonPointer(path: JsonPointerPath): string;
36
+ /**
37
+ * Returns true if JSON Pointer points to root value, false otherwise.
38
+ */
39
+ declare const isRoot: (path: string | number | JsonPointerPath) => boolean;
40
+ /**
41
+ * Returns parent path, e.g. for ['foo', 'bar', 'baz'] returns ['foo', 'bar'].
42
+ */
43
+ declare function parent(path: JsonPointerPath): JsonPointerPath;
44
+ /**
45
+ * Check if path component can be a valid array index.
46
+ */
47
+ declare function isValidIndex(index: string | number): boolean;
48
+ declare const isInteger: (str: string) => boolean;
49
+ //#endregion
50
+ export { isValidIndex as a, unescapePointerSegment as c, isRoot as i, formatJsonPointer as n, parent as o, isInteger as r, parseJsonPointer as s, escapePointerSegment as t };
51
+ //# sourceMappingURL=parse-DZfi3d96.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-DZfi3d96.d.cts","names":[],"sources":["../../types/src/json.ts","../src/pointer/parse.ts"],"sourcesContent":[],"mappings":";;;;;;;;KA6CY,eAAA;;;AAAZ;;;;ACZA;AAcA;AAYgB,iBA1BA,oBAAA,CA0BmC,OAAe,EAAA,MAAA,CAAA,EAAA,MAAA;AAalE;AAYA;AAUA;AAWA;AAUA;;iBApEgB,sBAAA;;;;;iBAYA,gBAAA,mBAAmC;;;;;iBAanC,iBAAA,OAAwB;;;;cAY3B,iCAAkC;;;;iBAU/B,MAAA,OAAa,kBAAkB;;;;iBAW/B,YAAA;cAUH"}
@@ -0,0 +1,9 @@
1
+ //#region src/utils/parse.d.ts
2
+ interface Options {
3
+ strict?: boolean;
4
+ }
5
+ declare function parse<T = unknown>(value: any, options?: Options): T;
6
+ declare function safeParse<T = unknown>(value: any, options?: Options): T;
7
+ //#endregion
8
+ export { parse as n, safeParse as r, Options as t };
9
+ //# sourceMappingURL=parse-DgYW5BBj.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-DgYW5BBj.d.mts","names":[],"sources":["../src/utils/parse.ts"],"sourcesContent":[],"mappings":";UA4CiB,OAAA;EAAA,MAAA,CAAA,EAAA,OAAO;AAIxB;AAmEgB,iBAnEA,KAmE4C,CAAA,IAAA,OAAgB,CAAA,CAAA,KAAA,EAAA,GAAA,EAAA,OAAA,CAAA,EAnEpB,OAmEoB,CAAA,EAnEL,CAmEK;iBAA5D,6CAA4C,UAAe"}