@stryke/json 0.9.16 → 0.9.24

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 (139) hide show
  1. package/CHANGELOG.md +411 -0
  2. package/README.md +18 -9
  3. package/dist/code-frames-BQI7PKd_.mjs +4 -0
  4. package/dist/code-frames-BQI7PKd_.mjs.map +1 -0
  5. package/dist/code-frames-CXX37tnR.d.mts +17 -0
  6. package/dist/code-frames-CXX37tnR.d.mts.map +1 -0
  7. package/dist/code-frames-DEWi5iIn.cjs +3 -0
  8. package/dist/code-frames-DViwqU8S.d.cts +17 -0
  9. package/dist/code-frames-DViwqU8S.d.cts.map +1 -0
  10. package/dist/find-reference-AvNORSzC.d.mts +52 -0
  11. package/dist/find-reference-AvNORSzC.d.mts.map +1 -0
  12. package/dist/find-reference-BUIYIOS4.mjs +2 -0
  13. package/dist/find-reference-BUIYIOS4.mjs.map +1 -0
  14. package/dist/find-reference-ChoPoDcB.d.cts +52 -0
  15. package/dist/find-reference-ChoPoDcB.d.cts.map +1 -0
  16. package/dist/find-reference-DQJK1LbJ.cjs +1 -0
  17. package/dist/index-CMuRFTR3.d.mts +1 -0
  18. package/dist/index-uTS5iDq_.d.cts +1 -0
  19. package/dist/index.cjs +1 -38
  20. package/dist/index.d.cts +8 -0
  21. package/dist/index.d.mts +9 -0
  22. package/dist/index.mjs +1 -1
  23. package/dist/is-number-CebQk_B0.mjs +2 -0
  24. package/dist/is-number-CebQk_B0.mjs.map +1 -0
  25. package/dist/is-number-wfNPC3Mj.cjs +1 -0
  26. package/dist/is-object-CGB7EeiA.cjs +1 -0
  27. package/dist/is-object-DDPbtSWR.mjs +2 -0
  28. package/dist/is-object-DDPbtSWR.mjs.map +1 -0
  29. package/dist/is-string-D5yKZC0U.cjs +1 -0
  30. package/dist/is-string-VB7nGKjX.mjs +2 -0
  31. package/dist/is-string-VB7nGKjX.mjs.map +1 -0
  32. package/dist/is-undefined-D6sfLkFq.mjs +2 -0
  33. package/dist/is-undefined-D6sfLkFq.mjs.map +1 -0
  34. package/dist/is-undefined-Pevixi0g.cjs +1 -0
  35. package/dist/parse-BYhuR8fo.mjs +2 -0
  36. package/dist/parse-BYhuR8fo.mjs.map +1 -0
  37. package/dist/parse-BpylFCf0.mjs +2 -0
  38. package/dist/parse-BpylFCf0.mjs.map +1 -0
  39. package/dist/parse-BwhwGAkA.cjs +1 -0
  40. package/dist/parse-D-7TqXVh.d.mts +51 -0
  41. package/dist/parse-D-7TqXVh.d.mts.map +1 -0
  42. package/dist/parse-DU-kIQN6.d.cts +51 -0
  43. package/dist/parse-DU-kIQN6.d.cts.map +1 -0
  44. package/dist/parse-DmriuGKI.cjs +1 -0
  45. package/dist/parse-error-0BAtatMf.cjs +1 -0
  46. package/dist/parse-error-CJTV0jdn.d.mts +15 -0
  47. package/dist/parse-error-CJTV0jdn.d.mts.map +1 -0
  48. package/dist/parse-error-DLuqEXmf.d.cts +15 -0
  49. package/dist/parse-error-DLuqEXmf.d.cts.map +1 -0
  50. package/dist/parse-error-DrJJkemH.mjs +2 -0
  51. package/dist/parse-error-DrJJkemH.mjs.map +1 -0
  52. package/dist/parse-fX7NFKdt.d.cts +9 -0
  53. package/dist/parse-fX7NFKdt.d.cts.map +1 -0
  54. package/dist/parse-xFkFesIF.d.mts +9 -0
  55. package/dist/parse-xFkFesIF.d.mts.map +1 -0
  56. package/dist/pointer/find-reference.cjs +1 -39
  57. package/dist/pointer/find-reference.d.cts +2 -0
  58. package/dist/pointer/find-reference.d.mts +2 -0
  59. package/dist/pointer/find-reference.mjs +1 -1
  60. package/dist/pointer/index.cjs +1 -27
  61. package/dist/pointer/index.d.cts +3 -0
  62. package/dist/pointer/index.d.mts +3 -0
  63. package/dist/pointer/index.mjs +1 -1
  64. package/dist/pointer/parse.cjs +1 -55
  65. package/dist/pointer/parse.d.cts +2 -0
  66. package/dist/pointer/parse.d.mts +2 -0
  67. package/dist/pointer/parse.mjs +1 -1
  68. package/dist/storm-json-BsdLpzM_.mjs +2 -0
  69. package/dist/storm-json-BsdLpzM_.mjs.map +1 -0
  70. package/dist/storm-json-CfqJ0KzG.d.mts +70 -0
  71. package/dist/storm-json-CfqJ0KzG.d.mts.map +1 -0
  72. package/dist/storm-json-DBxiMujR.cjs +1 -0
  73. package/dist/storm-json-Q1bOIv3-.d.cts +70 -0
  74. package/dist/storm-json-Q1bOIv3-.d.cts.map +1 -0
  75. package/dist/storm-json.cjs +1 -72
  76. package/dist/storm-json.d.cts +2 -0
  77. package/dist/storm-json.d.mts +3 -0
  78. package/dist/storm-json.mjs +1 -1
  79. package/dist/stringify-BpBMOhle.d.cts +13 -0
  80. package/dist/stringify-BpBMOhle.d.cts.map +1 -0
  81. package/dist/stringify-DjBDt8SC.mjs +2 -0
  82. package/dist/stringify-DjBDt8SC.mjs.map +1 -0
  83. package/dist/stringify-Dp0lF-wN.cjs +1 -0
  84. package/dist/stringify-ln223ZC9.d.mts +13 -0
  85. package/dist/stringify-ln223ZC9.d.mts.map +1 -0
  86. package/dist/strip-comments-BhdK_E8s.cjs +4 -0
  87. package/dist/strip-comments-CKLSXchM.d.cts +11 -0
  88. package/dist/strip-comments-CKLSXchM.d.cts.map +1 -0
  89. package/dist/strip-comments-DdsCzji6.d.mts +11 -0
  90. package/dist/strip-comments-DdsCzji6.d.mts.map +1 -0
  91. package/dist/strip-comments-LcqiBhvo.mjs +5 -0
  92. package/dist/strip-comments-LcqiBhvo.mjs.map +1 -0
  93. package/dist/types-CEiKQHlk.d.cts +69 -0
  94. package/dist/types-CEiKQHlk.d.cts.map +1 -0
  95. package/dist/types-CQHq94S4.d.mts +69 -0
  96. package/dist/types-CQHq94S4.d.mts.map +1 -0
  97. package/dist/types.cjs +0 -1
  98. package/dist/types.d.cts +2 -0
  99. package/dist/types.d.mts +2 -0
  100. package/dist/types.mjs +1 -0
  101. package/dist/utils/code-frames.cjs +1 -72
  102. package/dist/utils/code-frames.d.cts +2 -0
  103. package/dist/utils/code-frames.d.mts +2 -0
  104. package/dist/utils/code-frames.mjs +1 -3
  105. package/dist/utils/index.cjs +1 -60
  106. package/dist/utils/index.d.cts +6 -0
  107. package/dist/utils/index.d.mts +7 -0
  108. package/dist/utils/index.mjs +1 -1
  109. package/dist/utils/parse-error.cjs +1 -31
  110. package/dist/utils/parse-error.d.cts +2 -0
  111. package/dist/utils/parse-error.d.mts +2 -0
  112. package/dist/utils/parse-error.mjs +1 -3
  113. package/dist/utils/parse.cjs +1 -59
  114. package/dist/utils/parse.d.cts +2 -0
  115. package/dist/utils/parse.d.mts +2 -0
  116. package/dist/utils/parse.mjs +1 -1
  117. package/dist/utils/stringify.cjs +1 -42
  118. package/dist/utils/stringify.d.cts +2 -0
  119. package/dist/utils/stringify.d.mts +2 -0
  120. package/dist/utils/stringify.mjs +1 -1
  121. package/dist/utils/strip-comments.cjs +1 -43
  122. package/dist/utils/strip-comments.d.cts +2 -0
  123. package/dist/utils/strip-comments.d.mts +2 -0
  124. package/dist/utils/strip-comments.mjs +1 -4
  125. package/dist/utils-BkLHzBxb.mjs +1 -0
  126. package/dist/utils-DFU9Wltn.cjs +0 -0
  127. package/package.json +44 -238
  128. package/dist/index.d.ts +0 -11
  129. package/dist/pointer/find-reference.d.ts +0 -48
  130. package/dist/pointer/index.d.ts +0 -2
  131. package/dist/pointer/parse.d.ts +0 -38
  132. package/dist/storm-json.d.ts +0 -64
  133. package/dist/types.d.ts +0 -64
  134. package/dist/utils/code-frames.d.ts +0 -14
  135. package/dist/utils/index.d.ts +0 -5
  136. package/dist/utils/parse-error.d.ts +0 -9
  137. package/dist/utils/parse.d.ts +0 -5
  138. package/dist/utils/stringify.d.ts +0 -9
  139. package/dist/utils/strip-comments.d.ts +0 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,411 @@
1
+ ![Storm Software's logo banner](https://public.storm-cdn.com/storm-software/banner-1280x320-optimized.gif)
2
+
3
+ # Changelog for Stryke - JSON
4
+
5
+ ## [0.9.23](https://github.com/storm-software/stryke/releases/tag/json%400.9.23) (12/07/2025)
6
+
7
+ ### Updated Dependencies
8
+
9
+ - Updated **type-checks** to **v0.5.5**
10
+ - Updated **types** to **v0.10.19**
11
+
12
+ ## [0.9.22](https://github.com/storm-software/stryke/releases/tag/json%400.9.22) (12/07/2025)
13
+
14
+ ### Updated Dependencies
15
+
16
+ - Updated **type-checks** to **v0.5.4**
17
+ - Updated **types** to **v0.10.18**
18
+
19
+ ## [0.9.21](https://github.com/storm-software/stryke/releases/tag/json%400.9.21) (12/07/2025)
20
+
21
+ ### Miscellaneous
22
+
23
+ - **monorepo:** Format monorepo source files
24
+ ([9428936](https://github.com/storm-software/stryke/commit/9428936))
25
+
26
+ ### Updated Dependencies
27
+
28
+ - Updated **type-checks** to **v0.5.3**
29
+ - Updated **types** to **v0.10.17**
30
+
31
+ ## [0.9.20](https://github.com/storm-software/stryke/releases/tag/json%400.9.20) (12/06/2025)
32
+
33
+ ### Features
34
+
35
+ - **tools-nx:** Resolved issue inferring build command-line arguments for local
36
+ packages ([de00278](https://github.com/storm-software/stryke/commit/de00278))
37
+
38
+ ### Updated Dependencies
39
+
40
+ - Updated **type-checks** to **v0.5.2**
41
+ - Updated **types** to **v0.10.16**
42
+
43
+ ## [0.9.19](https://github.com/storm-software/stryke/releases/tag/json%400.9.19) (12/06/2025)
44
+
45
+ ### Updated Dependencies
46
+
47
+ - Updated **type-checks** to **v0.5.1**
48
+ - Updated **types** to **v0.10.15**
49
+
50
+ ## [0.9.18](https://github.com/storm-software/stryke/releases/tag/json%400.9.18) (12/05/2025)
51
+
52
+ ### Updated Dependencies
53
+
54
+ - Updated **type-checks** to **v0.5.0**
55
+
56
+ ## [0.9.17](https://github.com/storm-software/stryke/releases/tag/json%400.9.17) (12/05/2025)
57
+
58
+ ### Features
59
+
60
+ - **monorepo:** Update repository to use `tsdown` to build/bundle packages
61
+ ([8ceb909](https://github.com/storm-software/stryke/commit/8ceb909))
62
+
63
+ ### Updated Dependencies
64
+
65
+ - Updated **type-checks** to **v0.4.5**
66
+ - Updated **types** to **v0.10.14**
67
+
68
+ ## [0.9.16](https://github.com/storm-software/stryke/releases/tag/json%400.9.16) (12/01/2025)
69
+
70
+ ### Updated Dependencies
71
+
72
+ - Updated **type-checks** to **v0.4.4**
73
+ - Updated **types** to **v0.10.13**
74
+
75
+ ## [0.9.15](https://github.com/storm-software/stryke/releases/tag/json%400.9.15) (11/30/2025)
76
+
77
+ ### Updated Dependencies
78
+
79
+ - Updated **type-checks** to **v0.4.3**
80
+ - Updated **types** to **v0.10.12**
81
+
82
+ ## [0.9.14](https://github.com/storm-software/stryke/releases/tag/json%400.9.14) (11/30/2025)
83
+
84
+ ### Updated Dependencies
85
+
86
+ - Updated **type-checks** to **v0.4.2**
87
+ - Updated **types** to **v0.10.11**
88
+
89
+ ## [0.9.13](https://github.com/storm-software/stryke/releases/tag/json%400.9.13) (11/30/2025)
90
+
91
+ ### Updated Dependencies
92
+
93
+ - Updated **type-checks** to **v0.4.1**
94
+ - Updated **types** to **v0.10.10**
95
+
96
+ ## [0.9.12](https://github.com/storm-software/stryke/releases/tag/json%400.9.12) (11/30/2025)
97
+
98
+ ### Updated Dependencies
99
+
100
+ - Updated **type-checks** to **v0.4.0**
101
+ - Updated **types** to **v0.10.9**
102
+
103
+ ## [0.9.11](https://github.com/storm-software/stryke/releases/tag/json%400.9.11) (11/24/2025)
104
+
105
+ ### Updated Dependencies
106
+
107
+ - Updated **type-checks** to **v0.3.18**
108
+ - Updated **types** to **v0.10.8**
109
+
110
+ ## [0.9.10](https://github.com/storm-software/stryke/releases/tag/json%400.9.10) (11/21/2025)
111
+
112
+ ### Updated Dependencies
113
+
114
+ - Updated **type-checks** to **v0.3.17**
115
+ - Updated **types** to **v0.10.7**
116
+
117
+ ## [0.9.9](https://github.com/storm-software/stryke/releases/tag/json%400.9.9) (11/21/2025)
118
+
119
+ ### Updated Dependencies
120
+
121
+ - Updated **type-checks** to **v0.3.16**
122
+ - Updated **types** to **v0.10.6**
123
+
124
+ ## [0.9.8](https://github.com/storm-software/stryke/releases/tag/json%400.9.8) (11/21/2025)
125
+
126
+ ### Updated Dependencies
127
+
128
+ - Updated **type-checks** to **v0.3.15**
129
+ - Updated **types** to **v0.10.5**
130
+
131
+ ## [0.9.7](https://github.com/storm-software/stryke/releases/tag/json%400.9.7) (11/21/2025)
132
+
133
+ ### Updated Dependencies
134
+
135
+ - Updated **type-checks** to **v0.3.14**
136
+ - Updated **types** to **v0.10.4**
137
+
138
+ ## [0.9.6](https://github.com/storm-software/stryke/releases/tag/json%400.9.6) (11/21/2025)
139
+
140
+ ### Updated Dependencies
141
+
142
+ - Updated **type-checks** to **v0.3.13**
143
+ - Updated **types** to **v0.10.3**
144
+
145
+ ## [0.9.5](https://github.com/storm-software/stryke/releases/tag/json%400.9.5) (11/16/2025)
146
+
147
+ ### Updated Dependencies
148
+
149
+ - Updated **type-checks** to **v0.3.12**
150
+ - Updated **types** to **v0.10.2**
151
+
152
+ ## [0.9.4](https://github.com/storm-software/stryke/releases/tag/json%400.9.4) (11/08/2025)
153
+
154
+ ### Updated Dependencies
155
+
156
+ - Updated **type-checks** to **v0.3.11**
157
+ - Updated **types** to **v0.10.1**
158
+
159
+ ![Storm Software](https://public.storm-cdn.com/brand-banner.png)
160
+
161
+ # Changelog for Stryke - JSON
162
+
163
+ ## [0.9.3](https://github.com/storm-software/stryke/releases/tag/json%400.9.3) (2025-08-04)
164
+
165
+ ### Bug Fixes
166
+
167
+ - **monorepo:** Resolved repository type-check failures
168
+ ([d196ace](https://github.com/storm-software/stryke/commit/d196ace))
169
+
170
+ ![Storm Software](https://public.storm-cdn.com/brand-banner.png)
171
+
172
+ # Changelog for Stryke - Json
173
+
174
+ ## [0.9.2](https://github.com/storm-software/stryke/releases/tag/json%400.9.2) (2025-06-17)
175
+
176
+ ### Miscellaneous
177
+
178
+ - **monorepo:** Reformat repository packages
179
+
180
+ ## [0.9.1](https://github.com/storm-software/stryke/releases/tag/json%400.9.1) (2025-06-12)
181
+
182
+ ### Miscellaneous
183
+
184
+ - **monorepo:** Reformat the repository's README markdown files
185
+ - **monorepo:** Run format script on repository
186
+
187
+ ## [0.9.0](https://github.com/storm-software/stryke/releases/tag/json%400.9.0) (2025-06-02)
188
+
189
+ ### Features
190
+
191
+ - **fs:** Improve the `loadTsConfig` handler function
192
+
193
+ ## [0.8.3](https://github.com/storm-software/stryke/releases/tag/json%400.8.3) (2025-05-27)
194
+
195
+ ### Bug Fixes
196
+
197
+ - **json:** Remove the invalid `Buffer` import path
198
+
199
+ ## [0.8.2](https://github.com/storm-software/stryke/releases/tag/json%400.8.2) (2025-05-12)
200
+
201
+ ### Miscellaneous
202
+
203
+ - **monorepo:** Reformat monorepo source code
204
+
205
+ ## [0.8.1](https://github.com/storm-software/stryke/releases/tag/json%400.8.1) (2025-04-25)
206
+
207
+ ### Bug Fixes
208
+
209
+ - **json:** Added missing characters to invalid key list
210
+ ([3b83500](https://github.com/storm-software/stryke/commit/3b83500))
211
+
212
+ ## [0.8.0](https://github.com/storm-software/stryke/releases/tag/json%400.8.0) (2025-04-25)
213
+
214
+ ### Features
215
+
216
+ - **json:** Update `stringify` to handle invalid characters
217
+ ([2163417](https://github.com/storm-software/stryke/commit/2163417))
218
+
219
+ ## [0.7.3](https://github.com/storm-software/stryke/releases/tag/json%400.7.3) (2025-04-23)
220
+
221
+ ### Miscellaneous
222
+
223
+ - **json:** Only export `StormJSON` and types from index
224
+ ([d96dd89](https://github.com/storm-software/stryke/commit/d96dd89))
225
+
226
+ ## [0.7.2](https://github.com/storm-software/stryke/releases/tag/json%400.7.2) (2025-04-22)
227
+
228
+ ### Bug Fixes
229
+
230
+ - **json:** Resolve issue with serializing `undefined` values in JSONs
231
+ ([0f6acec](https://github.com/storm-software/stryke/commit/0f6acec))
232
+
233
+ ## [0.7.1](https://github.com/storm-software/stryke/releases/tag/json%400.7.1) (2025-04-10)
234
+
235
+ ### Miscellaneous
236
+
237
+ - **monorepo:** Format the repository's files
238
+ ([1384f3e](https://github.com/storm-software/stryke/commit/1384f3e))
239
+
240
+ ## [0.7.0](https://github.com/storm-software/stryke/releases/tag/json%400.7.0) (2025-04-07)
241
+
242
+ ### Features
243
+
244
+ - **http:** Added the `StormURL` helper class
245
+ ([03643b0](https://github.com/storm-software/stryke/commit/03643b0))
246
+
247
+ ## [0.6.1](https://github.com/storm-software/stryke/releases/tag/json%400.6.1) (2025-04-07)
248
+
249
+ ### Miscellaneous
250
+
251
+ - **json:** Improve json parsing helper
252
+ ([81a7e12](https://github.com/storm-software/stryke/commit/81a7e12))
253
+
254
+ ## [0.6.0](https://github.com/storm-software/stryke/releases/tag/json%400.6.0) (2025-04-07)
255
+
256
+ ### Features
257
+
258
+ - **json:** Added custom parsing logic
259
+ ([fd5a86a](https://github.com/storm-software/stryke/commit/fd5a86a))
260
+
261
+ ## [0.5.8](https://github.com/storm-software/stryke/releases/tag/json%400.5.8) (2025-04-07)
262
+
263
+ ### Bug Fixes
264
+
265
+ - **json:** Resolve issue with invalid json parsing
266
+ ([5e57aaa](https://github.com/storm-software/stryke/commit/5e57aaa))
267
+
268
+ ## [0.5.7](https://github.com/storm-software/stryke/releases/tag/json%400.5.7) (2025-04-07)
269
+
270
+ ### Bug Fixes
271
+
272
+ - **json:** Resolve issue with nested string value
273
+ ([f7a1043](https://github.com/storm-software/stryke/commit/f7a1043))
274
+
275
+ ## [0.5.6](https://github.com/storm-software/stryke/releases/tag/json%400.5.6) (2025-04-07)
276
+
277
+ ### Bug Fixes
278
+
279
+ - **json:** Resolve issue with `json` prefix in string result
280
+ ([23ca1c5](https://github.com/storm-software/stryke/commit/23ca1c5))
281
+
282
+ ## [0.5.5](https://github.com/storm-software/stryke/releases/tag/json%400.5.5) (2025-04-07)
283
+
284
+ ### Bug Fixes
285
+
286
+ - **json:** Resovle issue with `stringify` function handler
287
+ ([72fbdb9](https://github.com/storm-software/stryke/commit/72fbdb9))
288
+
289
+ ## [0.5.4](https://github.com/storm-software/stryke/releases/tag/json%400.5.4) (2025-03-28)
290
+
291
+ ### Miscellaneous
292
+
293
+ - **monorepo:** Reformat the source files in repository
294
+ ([bb8df2c](https://github.com/storm-software/stryke/commit/bb8df2c))
295
+
296
+ ## [0.5.3](https://github.com/storm-software/stryke/releases/tag/json%400.5.3) (2025-03-23)
297
+
298
+ ### Bug Fixes
299
+
300
+ - **monorepo:** Resolve issue with TypeScript compilation
301
+ ([72e995f](https://github.com/storm-software/stryke/commit/72e995f))
302
+
303
+ ## [0.5.2](https://github.com/storm-software/stryke/releases/tag/json%400.5.2) (2025-03-23)
304
+
305
+ ### Miscellaneous
306
+
307
+ - **monorepo:** Update base storm software packages
308
+ ([8942201](https://github.com/storm-software/stryke/commit/8942201))
309
+
310
+ ## 0.5.1 (2025-03-13)
311
+
312
+ ### Miscellaneous
313
+
314
+ - **monorepo:** Format monorepo project files
315
+ ([f28fdbe](https://github.com/storm-software/stryke/commit/f28fdbe))
316
+
317
+ ## 0.5.0 (2025-03-13)
318
+
319
+ ### Features
320
+
321
+ - **monorepo:** Split `types` project into `type-checks` and `convert` packages
322
+ ([fcc5832](https://github.com/storm-software/stryke/commit/fcc5832))
323
+
324
+ ## 0.4.3 (2025-03-13)
325
+
326
+ ### Miscellaneous
327
+
328
+ - **monorepo:** Reformat monorepo package files
329
+ ([a453428](https://github.com/storm-software/stryke/commit/a453428))
330
+
331
+ ## 0.4.2 (2025-02-26)
332
+
333
+ ### Miscellaneous
334
+
335
+ - **monorepo:** Reformat monorepo files with `prettier`
336
+ ([b5d0302](https://github.com/storm-software/stryke/commit/b5d0302))
337
+
338
+ ## 0.4.1 (2025-02-24)
339
+
340
+ ### Bug Fixes
341
+
342
+ - **json:** Update JSON stringify method
343
+ ([06a7482](https://github.com/storm-software/stryke/commit/06a7482))
344
+
345
+ ## 0.4.0 (2025-02-24)
346
+
347
+ ### Features
348
+
349
+ - **json:** Update the JSON stringify function signature
350
+ ([3f2c1c8](https://github.com/storm-software/stryke/commit/3f2c1c8))
351
+
352
+ ### Bug Fixes
353
+
354
+ - **json:** Resolve issue stringifying json result
355
+ ([99a05a9](https://github.com/storm-software/stryke/commit/99a05a9))
356
+
357
+ ## 0.3.0 (2025-02-24)
358
+
359
+ ### Features
360
+
361
+ - **json:** Update method signature on stringify functions
362
+ ([f4b9300](https://github.com/storm-software/stryke/commit/f4b9300))
363
+
364
+ ## 0.2.1 (2025-02-24)
365
+
366
+ ### Bug Fixes
367
+
368
+ - **json:** Resolve issue with stringifying json values
369
+ ([df99f22](https://github.com/storm-software/stryke/commit/df99f22))
370
+
371
+ ## 0.2.0 (2025-02-23)
372
+
373
+ ### Features
374
+
375
+ - **monorepo:** Update base ESLint packages and run on files
376
+ ([c59cb8e](https://github.com/storm-software/stryke/commit/c59cb8e))
377
+
378
+ ## 0.1.4 (2025-02-17)
379
+
380
+ ### Miscellaneous
381
+
382
+ - **monorepo:** Reformat monorepo files
383
+ ([1db5e06](https://github.com/storm-software/stryke/commit/1db5e06))
384
+
385
+ ## 0.1.3 (2025-02-15)
386
+
387
+ ### Miscellaneous
388
+
389
+ - **monorepo:** Reformat monorepo files
390
+ ([69ed6b7](https://github.com/storm-software/stryke/commit/69ed6b7))
391
+
392
+ ## 0.1.2 (2025-02-15)
393
+
394
+ ### Miscellaneous
395
+
396
+ - **monorepo:** Reformat workspace files
397
+ ([ad2d6a9](https://github.com/storm-software/stryke/commit/ad2d6a9))
398
+
399
+ ## 0.1.1 (2025-02-09)
400
+
401
+ ### Miscellaneous
402
+
403
+ - **monorepo:** Regenerate repository markdown files
404
+ ([e61e39e](https://github.com/storm-software/stryke/commit/e61e39e))
405
+
406
+ ## 0.1.0 (2025-02-07)
407
+
408
+ ### Bug Fixes
409
+
410
+ - **cli:** Resolve typing issue with `figlet` dependency
411
+ ([2ad7747](https://github.com/storm-software/stryke/commit/2ad7747))
package/README.md CHANGED
@@ -3,7 +3,13 @@
3
3
  <!-- markdownlint-disable -->
4
4
 
5
5
 
6
- <div align="center"><img src="https://public.storm-cdn.com/storm-banner.gif" width="100%" alt="Storm Software" /></div>
6
+ <div align="center">
7
+ <picture>
8
+ <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x640-dark-optimized.gif">
9
+ <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x640-light-optimized.gif">
10
+ <img src="https://public.storm-cdn.com/storm-software/banner-1280x640-dark-optimized.gif" width="100%" alt="Storm Software" />
11
+ </picture>
12
+ </div>
7
13
  <br />
8
14
 
9
15
  <div align="center">
@@ -16,13 +22,13 @@
16
22
  </div>
17
23
 
18
24
  <br />
19
- This package is part of Storm Software's **🌩️ Stryke** monorepo. Stryke packages TypeScript utility packages with shared functionality common to many Storm Software applications.
25
+ This package is part of Storm Software's **💥 Stryke** monorepo. Stryke packages TypeScript utility packages with shared functionality common to many Storm Software applications.
20
26
 
21
27
  <br />
22
28
 
23
29
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
24
30
 
25
- [![Version](https://img.shields.io/badge/version-0.9.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
+ [![Version](https://img.shields.io/badge/version-0.9.20-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
26
32
 
27
33
  > [!IMPORTANT] Important
28
34
  > This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
@@ -94,10 +100,10 @@ yarn add -D @stryke/json
94
100
 
95
101
  ## Reduced Package Size
96
102
 
97
- This project uses [tsup](https://tsup.egoist.dev/) to package the source code
98
- due to its ability to remove unused code and ship smaller javascript files
99
- thanks to code splitting. This helps to greatly reduce the size of the package
100
- and to make it easier to use in other projects.
103
+ This project uses [tsdown](https://tsdown.dev) to package the source code due to
104
+ its ability to remove unused code and ship smaller javascript files thanks to
105
+ code splitting. This helps to greatly reduce the size of the package and to make
106
+ it easier to use in other projects.
101
107
 
102
108
  ## Development
103
109
 
@@ -238,10 +244,13 @@ specification. Contributions of any kind welcome!
238
244
  <br />
239
245
 
240
246
  <hr />
241
- <br />
242
247
 
243
248
  <div align="center">
244
- <img src="https://public.storm-cdn.com/logo-banner.png" width="100%" alt="Storm Software" />
249
+ <picture>
250
+ <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x320-dark-optimized.webp">
251
+ <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x320-light-optimized.webp">
252
+ <img src="https://public.storm-cdn.com/storm-software/banner-1280x320-dark-optimized.webp" width="100%" alt="Storm Software" />
253
+ </picture>
245
254
  </div>
246
255
  <br />
247
256
 
@@ -0,0 +1,4 @@
1
+ const e=/\r\n|[\n\r\u2028\u2029]/;function t(e,t,n={}){let r={column:0,line:-1,...e.start},i={...r,...e.end},{linesAbove:a=2,linesBelow:o=3}=n||{},s=r.line,c=r.column,l=i.line,u=i.column,d=Math.max(s-(a+1),0),f=Math.min(t.length,l+o);s===-1&&(d=0),l===-1&&(f=t.length);let p=l-s,m={};if(p)for(let e=0;e<=p;e++){let n=e+s;c?e===0?m[n]=[c,(t[n-1]?.length??0)-c+1]:e===p?m[n]=[0,u]:m[n]=[0,t[n-e]?.length??0]:m[n]=!0}else c===u?m[s]=c?[c,0]:!0:m[s]=[c,u-c];return{start:d,end:f,markerLines:m}}function n(n,r,i={}){let{start:a,end:o,markerLines:s}=t(r,n.split(e),i),c=String(o).length;return(i.highlight?i.highlight(n):n).split(e).slice(a,o).map((e,t)=>{let n=a+1+t,r=` ${` ${n}`.slice(-c)} | `,i=!!(s[n]??!1);if(i){let t=``;if(Array.isArray(i)){let n=e.slice(0,Math.max(i[0]-1,0)).replace(/[^\t]/g,` `),a=i[1]||1;t=[`
2
+ `,r.replace(/\d/g,` `),n,`^`.repeat(a)].join(``)}return[`>`,r,e,t].join(``)}return` ${r}${e}`}).join(`
3
+ `)}export{n as t};
4
+ //# sourceMappingURL=code-frames-BQI7PKd_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-frames-BQI7PKd_.mjs","names":["startLoc: Location","endLoc: Location"],"sources":["../src/utils/code-frames.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\ninterface Location {\n column: number;\n line: number;\n}\n\ninterface NodeLocation {\n end?: Location;\n start?: Location;\n}\n\n// Adapted from https://raw.githubusercontent.com/babel/babel/4108524/packages/babel-code-frame/src/index.js\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\nfunction getMarkerLines(\n loc: NodeLocation,\n source: string[],\n opts: { linesAbove?: number; linesBelow?: number } = {}\n): {\n start: number;\n end: number;\n markerLines: Record<number, boolean | [number, number]>;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines = {} as Record<number, boolean | [number, number]>;\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1]?.length ?? 0;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i]?.length ?? 0;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else if (startColumn === endColumn) {\n markerLines[startLine] = startColumn ? [startColumn, 0] : true;\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n\n return {\n start,\n end,\n markerLines\n };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: {\n linesAbove?: number;\n linesBelow?: number;\n highlight?: (rawLines: string) => string;\n } = {}\n): string {\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n\n const numberMaxWidth = String(end).length;\n const highlightedLines = opts.highlight ? opts.highlight(rawLines) : rawLines;\n\n const frame = highlightedLines\n .split(NEWLINE)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} | `;\n const hasMarker = Boolean(markerLines[number] ?? false);\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n gutter.replace(/\\d/g, \" \"),\n markerSpacing,\n \"^\".repeat(numberOfMarkers)\n ].join(\"\");\n }\n return [\">\", gutter, line, markerLine].join(\"\");\n }\n return ` ${gutter}${line}`;\n })\n .join(\"\\n\");\n\n return frame;\n}\n"],"mappings":"AAiCA,MAAM,EAAU,0BAKhB,SAAS,EACP,EACA,EACA,EAAqD,EAAE,CAKvD,CACA,IAAMA,EAAqB,CACzB,OAAQ,EACR,KAAM,GACN,GAAG,EAAI,MACR,CACKC,EAAmB,CACvB,GAAG,EACH,GAAG,EAAI,IACR,CACK,CAAE,aAAa,EAAG,aAAa,GAAM,GAAQ,EAAE,CAC/C,EAAY,EAAS,KACrB,EAAc,EAAS,OACvB,EAAU,EAAO,KACjB,EAAY,EAAO,OAErB,EAAQ,KAAK,IAAI,GAAa,EAAa,GAAI,EAAE,CACjD,EAAM,KAAK,IAAI,EAAO,OAAQ,EAAU,EAAW,CAEnD,IAAc,KAChB,EAAQ,GAGN,IAAY,KACd,EAAM,EAAO,QAGf,IAAM,EAAW,EAAU,EACrB,EAAc,EAAE,CAEtB,GAAI,EACF,IAAK,IAAI,EAAI,EAAG,GAAK,EAAU,IAAK,CAClC,IAAM,EAAa,EAAI,EAElB,EAEM,IAAM,EAGf,EAAY,GAAc,CAAC,GAFN,EAAO,EAAa,IAAI,QAAU,GAEA,EAAc,EAAE,CAC9D,IAAM,EACf,EAAY,GAAc,CAAC,EAAG,EAAU,CAIxC,EAAY,GAAc,CAAC,EAFN,EAAO,EAAa,IAAI,QAAU,EAEZ,CAV3C,EAAY,GAAc,QAarB,IAAgB,EACzB,EAAY,GAAa,EAAc,CAAC,EAAa,EAAE,CAAG,GAE1D,EAAY,GAAa,CAAC,EAAa,EAAY,EAAY,CAGjE,MAAO,CACL,QACA,MACA,cACD,CAGH,SAAgB,EACd,EACA,EACA,EAII,EAAE,CACE,CAER,GAAM,CAAE,QAAO,MAAK,eAAgB,EAAe,EADrC,EAAS,MAAM,EAAQ,CAC0B,EAAK,CAE9D,EAAiB,OAAO,EAAI,CAAC,OAgCnC,OA/ByB,EAAK,UAAY,EAAK,UAAU,EAAS,CAAG,GAGlE,MAAM,EAAQ,CACd,MAAM,EAAO,EAAI,CACjB,KAAK,EAAM,IAAU,CACpB,IAAM,EAAS,EAAQ,EAAI,EAErB,EAAS,IADM,IAAI,IAAS,MAAM,CAAC,EAAe,CACxB,KAC1B,EAAY,GAAQ,EAAY,IAAW,IACjD,GAAI,EAAW,CACb,IAAI,EAAa,GACjB,GAAI,MAAM,QAAQ,EAAU,CAAE,CAC5B,IAAM,EAAgB,EACnB,MAAM,EAAG,KAAK,IAAI,EAAU,GAAK,EAAG,EAAE,CAAC,CACvC,QAAQ,SAAU,IAAI,CACnB,EAAkB,EAAU,IAAM,EAExC,EAAa,CACX;GACA,EAAO,QAAQ,MAAO,IAAI,CAC1B,EACA,IAAI,OAAO,EAAgB,CAC5B,CAAC,KAAK,GAAG,CAEZ,MAAO,CAAC,IAAK,EAAQ,EAAM,EAAW,CAAC,KAAK,GAAG,CAEjD,MAAO,IAAI,IAAS,KACpB,CACD,KAAK;EAAK"}
@@ -0,0 +1,17 @@
1
+ //#region src/utils/code-frames.d.ts
2
+ interface Location {
3
+ column: number;
4
+ line: number;
5
+ }
6
+ interface NodeLocation {
7
+ end?: Location;
8
+ start?: Location;
9
+ }
10
+ declare function codeFrameColumns(rawLines: string, loc: NodeLocation, opts?: {
11
+ linesAbove?: number;
12
+ linesBelow?: number;
13
+ highlight?: (rawLines: string) => string;
14
+ }): string;
15
+ //#endregion
16
+ export { codeFrameColumns as t };
17
+ //# sourceMappingURL=code-frames-CXX37tnR.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-frames-CXX37tnR.d.mts","names":[],"sources":["../src/utils/code-frames.ts"],"sourcesContent":[],"mappings":";UAkBU,QAAA;EAAA,MAAA,EAAA,MAAQ;EAKR,IAAA,EAAA,MAAA;AAoFV;UApFU,YAAA;QACF;UACE;;iBAkFM,gBAAA,wBAET"}
@@ -0,0 +1,3 @@
1
+ const e=/\r\n|[\n\r\u2028\u2029]/;function t(e,t,n={}){let r={column:0,line:-1,...e.start},i={...r,...e.end},{linesAbove:a=2,linesBelow:o=3}=n||{},s=r.line,c=r.column,l=i.line,u=i.column,d=Math.max(s-(a+1),0),f=Math.min(t.length,l+o);s===-1&&(d=0),l===-1&&(f=t.length);let p=l-s,m={};if(p)for(let e=0;e<=p;e++){let n=e+s;c?e===0?m[n]=[c,(t[n-1]?.length??0)-c+1]:e===p?m[n]=[0,u]:m[n]=[0,t[n-e]?.length??0]:m[n]=!0}else c===u?m[s]=c?[c,0]:!0:m[s]=[c,u-c];return{start:d,end:f,markerLines:m}}function n(n,r,i={}){let{start:a,end:o,markerLines:s}=t(r,n.split(e),i),c=String(o).length;return(i.highlight?i.highlight(n):n).split(e).slice(a,o).map((e,t)=>{let n=a+1+t,r=` ${` ${n}`.slice(-c)} | `,i=!!(s[n]??!1);if(i){let t=``;if(Array.isArray(i)){let n=e.slice(0,Math.max(i[0]-1,0)).replace(/[^\t]/g,` `),a=i[1]||1;t=[`
2
+ `,r.replace(/\d/g,` `),n,`^`.repeat(a)].join(``)}return[`>`,r,e,t].join(``)}return` ${r}${e}`}).join(`
3
+ `)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -0,0 +1,17 @@
1
+ //#region src/utils/code-frames.d.ts
2
+ interface Location {
3
+ column: number;
4
+ line: number;
5
+ }
6
+ interface NodeLocation {
7
+ end?: Location;
8
+ start?: Location;
9
+ }
10
+ declare function codeFrameColumns(rawLines: string, loc: NodeLocation, opts?: {
11
+ linesAbove?: number;
12
+ linesBelow?: number;
13
+ highlight?: (rawLines: string) => string;
14
+ }): string;
15
+ //#endregion
16
+ export { codeFrameColumns as t };
17
+ //# sourceMappingURL=code-frames-DViwqU8S.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-frames-DViwqU8S.d.cts","names":[],"sources":["../src/utils/code-frames.ts"],"sourcesContent":[],"mappings":";UAkBU,QAAA;EAAA,MAAA,EAAA,MAAQ;EAKR,IAAA,EAAA,MAAA;AAoFV;UApFU,YAAA;QACF;UACE;;iBAkFM,gBAAA,wBAET"}
@@ -0,0 +1,52 @@
1
+ //#region src/pointer/find-reference.d.ts
2
+ interface Reference {
3
+ /** Target value where pointer is pointing. */
4
+ readonly val: unknown;
5
+ /** Object which contains the target value. */
6
+ readonly obj?: unknown | object | unknown[];
7
+ /** Key which targets the target value in the object. */
8
+ readonly key?: string | number;
9
+ }
10
+ /**
11
+ * Finds a target in document specified by JSON Pointer. Also returns the
12
+ * object containing the target and key used to reference that object.
13
+ *
14
+ * Throws Error('NOT_FOUND') if pointer does not result into a value in the middle
15
+ * of the path. If the last element of the path does not result into a value, the
16
+ * lookup succeeds with `val` set to `undefined`. It can be used to discriminate
17
+ * missing values, because `undefined` is not a valid JSON value.
18
+ *
19
+ * If last element in array is targeted using "-", e.g. "/arr/-", use
20
+ * `isArrayEnd` to verify that:
21
+ *
22
+ * ```js
23
+ * const ref = find({arr: [1, 2, 3], ['arr', '-']});
24
+ * if (isArrayReference(ref)) {
25
+ * if (isArrayEnd(ref)) {
26
+ * // ...
27
+ * }
28
+ * }
29
+ * ```
30
+ *
31
+ * @param val - Document to search in.
32
+ * @param path - JSON Pointer path.
33
+ * @returns Reference to the target.
34
+ */
35
+ declare const find: (val: unknown, path: Reference["key"][]) => Reference;
36
+ interface ArrayReference<T = unknown> {
37
+ /** `undefined` in case JSON Pointer points to last element, e.g. "/foo/-". */
38
+ readonly val: undefined | T;
39
+ readonly obj: T[];
40
+ readonly key: number;
41
+ }
42
+ declare const isArrayReference: <T = unknown>(ref: Reference) => ref is ArrayReference<T>;
43
+ declare const isArrayEnd: (ref: ArrayReference) => boolean;
44
+ interface ObjectReference<T = unknown> {
45
+ readonly val: T;
46
+ readonly obj: Record<string, T>;
47
+ readonly key: string;
48
+ }
49
+ declare const isObjectReference: <T = unknown>(ref: Reference) => ref is ObjectReference<T>;
50
+ //#endregion
51
+ export { isArrayEnd as a, find as i, ObjectReference as n, isArrayReference as o, Reference as r, isObjectReference as s, ArrayReference as t };
52
+ //# sourceMappingURL=find-reference-AvNORSzC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-reference-AvNORSzC.d.mts","names":[],"sources":["../src/pointer/find-reference.ts"],"sourcesContent":[],"mappings":";UAqBiB,SAAA;EAAA;EAoCJ,SAyCZ,GAAA,EAAA,OAzCwC;EA2CxB;EAOJ,SAAA,GAAA,CAAA,EAAA,OAEiE,GAAA,MAAA,GAAA,OAAA,EAAA;EADvE;EACkB,SAAA,GAAA,CAAA,EAAA,MAAA,GAAA,MAAA;;;AAEzB;AAGA;;;;;AAMA;;;;;;;;;;;;;;;;;;cA/Da,2BAA4B,uBAAqB;UA2C7C;;4BAEW;gBACZ;;;cAIH,qCACN,qBACG,eAAe;cAEZ,kBAAmB;UAGf;gBACD;gBACA,eAAe;;;cAIlB,sCACN,qBACG,gBAAgB"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./is-object-DDPbtSWR.mjs";import{t}from"./is-string-VB7nGKjX.mjs";import{t as n}from"./is-undefined-D6sfLkFq.mjs";const r=e=>{try{return e===null}catch{return!1}},i=e=>{try{return n(e)||r(e)}catch{return!1}},a=e=>{try{return!i(e)}catch{return!1}},o=t=>a(t)&&e(t),s=e=>{try{return o(e)&&Object.keys(e).length>0}catch{return!1}},{isArray:c}=Array,l=(e,n)=>{let r=n.length;if(!r)return{val:e};let i,a;for(let o=0;o<r;o++)if(i=e,a=n[o],c(i)){let n=i.length;if(a===`-`)a=n;else if(t(a)){let e=Math.trunc(Number.parseInt(a));if(String(e)!==a||(a=e,a<0))throw Error(`INVALID_INDEX`)}a&&(e=i[a])}else if(s(i))e=a&&a in i?i[a]:void 0;else throw Error(`NOT_FOUND`);return{val:e,obj:i,key:a}},u=e=>c(e.obj)&&typeof e.key==`number`,d=e=>e.obj.length===e.key,f=e=>typeof e.obj==`object`&&typeof e.key==`string`;export{f as i,d as n,u as r,l as t};
2
+ //# sourceMappingURL=find-reference-BUIYIOS4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-reference-BUIYIOS4.mjs","names":["obj: Reference[\"obj\"]","key: Reference[\"key\"]"],"sources":["../../type-checks/src/is-null.ts","../../type-checks/src/is-empty.ts","../../type-checks/src/is-set.ts","../../type-checks/src/is-non-null-object.ts","../../type-checks/src/is-set-object.ts","../src/pointer/find-reference.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 isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\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 { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\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 { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\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 { isObject } from \"./is-object\";\nimport { isSet } from \"./is-set\";\n\n/**\n * Check if the provided value's type is `Object` and is not `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n */\nexport const isNonNullObject = (value: any): value is NonNullable<object> => {\n return isSet(value) && isObject(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 { isNonNullObject } from \"./is-non-null-object\";\n\n/**\n * Check if the provided value's type is an object with some fields set\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is an object with some fields se\n */\nexport const isSetObject = (value: unknown): value is NonNullable<object> => {\n try {\n return isNonNullObject(value) && Object.keys(value).length > 0;\n } catch {\n return false;\n }\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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\n\nexport interface Reference {\n /** Target value where pointer is pointing. */\n readonly val: unknown;\n /** Object which contains the target value. */\n readonly obj?: unknown | object | unknown[];\n /** Key which targets the target value in the object. */\n readonly key?: string | number;\n}\n\nconst { isArray } = Array;\n\n/**\n * Finds a target in document specified by JSON Pointer. Also returns the\n * object containing the target and key used to reference that object.\n *\n * Throws Error('NOT_FOUND') if pointer does not result into a value in the middle\n * of the path. If the last element of the path does not result into a value, the\n * lookup succeeds with `val` set to `undefined`. It can be used to discriminate\n * missing values, because `undefined` is not a valid JSON value.\n *\n * If last element in array is targeted using \"-\", e.g. \"/arr/-\", use\n * `isArrayEnd` to verify that:\n *\n * ```js\n * const ref = find({arr: [1, 2, 3], ['arr', '-']});\n * if (isArrayReference(ref)) {\n * if (isArrayEnd(ref)) {\n * // ...\n * }\n * }\n * ```\n *\n * @param val - Document to search in.\n * @param path - JSON Pointer path.\n * @returns Reference to the target.\n */\nexport const find = (val: unknown, path: Reference[\"key\"][]): Reference => {\n const pathLength = path.length;\n if (!pathLength) {\n return { val };\n }\n\n let obj: Reference[\"obj\"];\n let key: Reference[\"key\"];\n for (let i = 0; i < pathLength; i++) {\n obj = val;\n key = path[i];\n if (isArray(obj)) {\n const length = obj.length;\n if (key === \"-\") {\n key = length;\n } else if (isString(key)) {\n const key2 = Math.trunc(Number.parseInt(key));\n if (String(key2) !== key) {\n throw new Error(\"INVALID_INDEX\");\n }\n\n key = key2;\n if (key < 0) {\n throw new Error(\"INVALID_INDEX\");\n }\n }\n\n if (key) {\n val = obj[key];\n }\n } else if (isSetObject(obj)) {\n val = key && key in obj ? (obj as any)[key] : undefined;\n } else throw new Error(\"NOT_FOUND\");\n }\n const ref: Reference = {\n val,\n obj,\n key\n };\n\n return ref;\n};\n\nexport interface ArrayReference<T = unknown> {\n /** `undefined` in case JSON Pointer points to last element, e.g. \"/foo/-\". */\n readonly val: undefined | T;\n readonly obj: T[];\n readonly key: number;\n}\n\nexport const isArrayReference = <T = unknown>(\n ref: Reference\n): ref is ArrayReference<T> => isArray(ref.obj) && typeof ref.key === \"number\";\n\nexport const isArrayEnd = (ref: ArrayReference): boolean =>\n ref.obj.length === ref.key;\n\nexport interface ObjectReference<T = unknown> {\n readonly val: T;\n readonly obj: Record<string, T>;\n readonly key: string;\n}\n\nexport const isObjectReference = <T = unknown>(\n ref: Reference\n): ref is ObjectReference<T> =>\n typeof ref.obj === \"object\" && typeof ref.key === \"string\";\n"],"mappings":"qIAkBA,MAAa,EAAU,GAAkC,CACvD,GAAI,CACF,OAAO,IAAU,UACX,CACN,MAAO,KCSE,EAAW,GAAmB,CACzC,GAAI,CACF,OAAO,EAAY,EAAM,EAAI,EAAO,EAAM,MACpC,CACN,MAAO,KCTE,EAAS,GAAkD,CACtE,GAAI,CACF,MAAO,CAAC,EAAQ,EAAM,MAChB,CACN,MAAO,KCHE,EAAmB,GACvB,EAAM,EAAM,EAAI,EAAS,EAAM,CCF3B,EAAe,GAAiD,CAC3E,GAAI,CACF,OAAO,EAAgB,EAAM,EAAI,OAAO,KAAK,EAAM,CAAC,OAAS,OACvD,CACN,MAAO,KCAL,CAAE,WAAY,MA2BP,GAAQ,EAAc,IAAwC,CACzE,IAAM,EAAa,EAAK,OACxB,GAAI,CAAC,EACH,MAAO,CAAE,MAAK,CAGhB,IAAIA,EACAC,EACJ,IAAK,IAAI,EAAI,EAAG,EAAI,EAAY,IAG9B,GAFA,EAAM,EACN,EAAM,EAAK,GACP,EAAQ,EAAI,CAAE,CAChB,IAAM,EAAS,EAAI,OACnB,GAAI,IAAQ,IACV,EAAM,UACG,EAAS,EAAI,CAAE,CACxB,IAAM,EAAO,KAAK,MAAM,OAAO,SAAS,EAAI,CAAC,CAM7C,GALI,OAAO,EAAK,GAAK,IAIrB,EAAM,EACF,EAAM,GACR,MAAU,MAAM,gBAAgB,CAIhC,IACF,EAAM,EAAI,YAEH,EAAY,EAAI,CACzB,EAAM,GAAO,KAAO,EAAO,EAAY,GAAO,IAAA,QACzC,MAAU,MAAM,YAAY,CAQrC,MANuB,CACrB,MACA,MACA,MACD,EAYU,EACX,GAC6B,EAAQ,EAAI,IAAI,EAAI,OAAO,EAAI,KAAQ,SAEzD,EAAc,GACzB,EAAI,IAAI,SAAW,EAAI,IAQZ,EACX,GAEA,OAAO,EAAI,KAAQ,UAAY,OAAO,EAAI,KAAQ"}