@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.
- package/CHANGELOG.md +411 -0
- package/README.md +18 -9
- package/dist/code-frames-BQI7PKd_.mjs +4 -0
- package/dist/code-frames-BQI7PKd_.mjs.map +1 -0
- package/dist/code-frames-CXX37tnR.d.mts +17 -0
- package/dist/code-frames-CXX37tnR.d.mts.map +1 -0
- package/dist/code-frames-DEWi5iIn.cjs +3 -0
- package/dist/code-frames-DViwqU8S.d.cts +17 -0
- package/dist/code-frames-DViwqU8S.d.cts.map +1 -0
- package/dist/find-reference-AvNORSzC.d.mts +52 -0
- package/dist/find-reference-AvNORSzC.d.mts.map +1 -0
- package/dist/find-reference-BUIYIOS4.mjs +2 -0
- package/dist/find-reference-BUIYIOS4.mjs.map +1 -0
- package/dist/find-reference-ChoPoDcB.d.cts +52 -0
- package/dist/find-reference-ChoPoDcB.d.cts.map +1 -0
- package/dist/find-reference-DQJK1LbJ.cjs +1 -0
- package/dist/index-CMuRFTR3.d.mts +1 -0
- package/dist/index-uTS5iDq_.d.cts +1 -0
- package/dist/index.cjs +1 -38
- package/dist/index.d.cts +8 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +1 -1
- package/dist/is-number-CebQk_B0.mjs +2 -0
- package/dist/is-number-CebQk_B0.mjs.map +1 -0
- package/dist/is-number-wfNPC3Mj.cjs +1 -0
- package/dist/is-object-CGB7EeiA.cjs +1 -0
- package/dist/is-object-DDPbtSWR.mjs +2 -0
- package/dist/is-object-DDPbtSWR.mjs.map +1 -0
- package/dist/is-string-D5yKZC0U.cjs +1 -0
- package/dist/is-string-VB7nGKjX.mjs +2 -0
- package/dist/is-string-VB7nGKjX.mjs.map +1 -0
- package/dist/is-undefined-D6sfLkFq.mjs +2 -0
- package/dist/is-undefined-D6sfLkFq.mjs.map +1 -0
- package/dist/is-undefined-Pevixi0g.cjs +1 -0
- package/dist/parse-BYhuR8fo.mjs +2 -0
- package/dist/parse-BYhuR8fo.mjs.map +1 -0
- package/dist/parse-BpylFCf0.mjs +2 -0
- package/dist/parse-BpylFCf0.mjs.map +1 -0
- package/dist/parse-BwhwGAkA.cjs +1 -0
- package/dist/parse-D-7TqXVh.d.mts +51 -0
- package/dist/parse-D-7TqXVh.d.mts.map +1 -0
- package/dist/parse-DU-kIQN6.d.cts +51 -0
- package/dist/parse-DU-kIQN6.d.cts.map +1 -0
- package/dist/parse-DmriuGKI.cjs +1 -0
- package/dist/parse-error-0BAtatMf.cjs +1 -0
- package/dist/parse-error-CJTV0jdn.d.mts +15 -0
- package/dist/parse-error-CJTV0jdn.d.mts.map +1 -0
- package/dist/parse-error-DLuqEXmf.d.cts +15 -0
- package/dist/parse-error-DLuqEXmf.d.cts.map +1 -0
- package/dist/parse-error-DrJJkemH.mjs +2 -0
- package/dist/parse-error-DrJJkemH.mjs.map +1 -0
- package/dist/parse-fX7NFKdt.d.cts +9 -0
- package/dist/parse-fX7NFKdt.d.cts.map +1 -0
- package/dist/parse-xFkFesIF.d.mts +9 -0
- package/dist/parse-xFkFesIF.d.mts.map +1 -0
- package/dist/pointer/find-reference.cjs +1 -39
- package/dist/pointer/find-reference.d.cts +2 -0
- package/dist/pointer/find-reference.d.mts +2 -0
- package/dist/pointer/find-reference.mjs +1 -1
- package/dist/pointer/index.cjs +1 -27
- package/dist/pointer/index.d.cts +3 -0
- package/dist/pointer/index.d.mts +3 -0
- package/dist/pointer/index.mjs +1 -1
- package/dist/pointer/parse.cjs +1 -55
- package/dist/pointer/parse.d.cts +2 -0
- package/dist/pointer/parse.d.mts +2 -0
- package/dist/pointer/parse.mjs +1 -1
- package/dist/storm-json-BsdLpzM_.mjs +2 -0
- package/dist/storm-json-BsdLpzM_.mjs.map +1 -0
- package/dist/storm-json-CfqJ0KzG.d.mts +70 -0
- package/dist/storm-json-CfqJ0KzG.d.mts.map +1 -0
- package/dist/storm-json-DBxiMujR.cjs +1 -0
- package/dist/storm-json-Q1bOIv3-.d.cts +70 -0
- package/dist/storm-json-Q1bOIv3-.d.cts.map +1 -0
- package/dist/storm-json.cjs +1 -72
- package/dist/storm-json.d.cts +2 -0
- package/dist/storm-json.d.mts +3 -0
- package/dist/storm-json.mjs +1 -1
- package/dist/stringify-BpBMOhle.d.cts +13 -0
- package/dist/stringify-BpBMOhle.d.cts.map +1 -0
- package/dist/stringify-DjBDt8SC.mjs +2 -0
- package/dist/stringify-DjBDt8SC.mjs.map +1 -0
- package/dist/stringify-Dp0lF-wN.cjs +1 -0
- package/dist/stringify-ln223ZC9.d.mts +13 -0
- package/dist/stringify-ln223ZC9.d.mts.map +1 -0
- package/dist/strip-comments-BhdK_E8s.cjs +4 -0
- package/dist/strip-comments-CKLSXchM.d.cts +11 -0
- package/dist/strip-comments-CKLSXchM.d.cts.map +1 -0
- package/dist/strip-comments-DdsCzji6.d.mts +11 -0
- package/dist/strip-comments-DdsCzji6.d.mts.map +1 -0
- package/dist/strip-comments-LcqiBhvo.mjs +5 -0
- package/dist/strip-comments-LcqiBhvo.mjs.map +1 -0
- package/dist/types-CEiKQHlk.d.cts +69 -0
- package/dist/types-CEiKQHlk.d.cts.map +1 -0
- package/dist/types-CQHq94S4.d.mts +69 -0
- package/dist/types-CQHq94S4.d.mts.map +1 -0
- package/dist/types.cjs +0 -1
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +1 -0
- package/dist/utils/code-frames.cjs +1 -72
- package/dist/utils/code-frames.d.cts +2 -0
- package/dist/utils/code-frames.d.mts +2 -0
- package/dist/utils/code-frames.mjs +1 -3
- package/dist/utils/index.cjs +1 -60
- package/dist/utils/index.d.cts +6 -0
- package/dist/utils/index.d.mts +7 -0
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/parse-error.cjs +1 -31
- package/dist/utils/parse-error.d.cts +2 -0
- package/dist/utils/parse-error.d.mts +2 -0
- package/dist/utils/parse-error.mjs +1 -3
- package/dist/utils/parse.cjs +1 -59
- package/dist/utils/parse.d.cts +2 -0
- package/dist/utils/parse.d.mts +2 -0
- package/dist/utils/parse.mjs +1 -1
- package/dist/utils/stringify.cjs +1 -42
- package/dist/utils/stringify.d.cts +2 -0
- package/dist/utils/stringify.d.mts +2 -0
- package/dist/utils/stringify.mjs +1 -1
- package/dist/utils/strip-comments.cjs +1 -43
- package/dist/utils/strip-comments.d.cts +2 -0
- package/dist/utils/strip-comments.d.mts +2 -0
- package/dist/utils/strip-comments.mjs +1 -4
- package/dist/utils-BkLHzBxb.mjs +1 -0
- package/dist/utils-DFU9Wltn.cjs +0 -0
- package/package.json +44 -238
- package/dist/index.d.ts +0 -11
- package/dist/pointer/find-reference.d.ts +0 -48
- package/dist/pointer/index.d.ts +0 -2
- package/dist/pointer/parse.d.ts +0 -38
- package/dist/storm-json.d.ts +0 -64
- package/dist/types.d.ts +0 -64
- package/dist/utils/code-frames.d.ts +0 -14
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/parse-error.d.ts +0 -9
- package/dist/utils/parse.d.ts +0 -5
- package/dist/utils/stringify.d.ts +0 -9
- package/dist/utils/strip-comments.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/json",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing JSON parsing/stringify utilities used by Storm Software.",
|
|
6
6
|
"repository": {
|
|
@@ -9,254 +9,60 @@
|
|
|
9
9
|
"directory": "packages/json"
|
|
10
10
|
},
|
|
11
11
|
"private": false,
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"lines-and-columns": "2.0.4",
|
|
15
|
-
"superjson": "2.2.2",
|
|
16
|
-
"@stryke/type-checks": "^0.4.4",
|
|
17
|
-
"@stryke/types": "^0.10.13"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": { "@types/node": "^24.10.1" },
|
|
20
|
-
"publishConfig": { "access": "public" },
|
|
21
|
-
"sideEffects": false,
|
|
22
|
-
"files": ["dist/**/*"],
|
|
23
|
-
"homepage": "https://stormsoftware.com",
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://stormsoftware.com/support",
|
|
26
|
-
"email": "support@stormsoftware.com"
|
|
27
|
-
},
|
|
28
|
-
"license": "Apache-2.0",
|
|
29
|
-
"keywords": [
|
|
30
|
-
"stryke",
|
|
31
|
-
"typescript",
|
|
32
|
-
"utilities",
|
|
33
|
-
"storm-software",
|
|
34
|
-
"storm",
|
|
35
|
-
"storm-ops",
|
|
36
|
-
"cyclone-ui",
|
|
37
|
-
"sullivanpj",
|
|
38
|
-
"monorepo"
|
|
39
|
-
],
|
|
40
|
-
"funding": {
|
|
41
|
-
"type": "github",
|
|
42
|
-
"url": "https://github.com/sponsors/storm-software"
|
|
43
|
-
},
|
|
44
|
-
"author": {
|
|
45
|
-
"name": "Storm Software",
|
|
46
|
-
"email": "contact@stormsoftware.com",
|
|
47
|
-
"url": "https://stormsoftware.com"
|
|
48
|
-
},
|
|
49
|
-
"maintainers": [
|
|
50
|
-
{
|
|
51
|
-
"name": "Storm Software",
|
|
52
|
-
"email": "contact@stormsoftware.com",
|
|
53
|
-
"url": "https://stormsoftware.com"
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
"contributors": [
|
|
57
|
-
{
|
|
58
|
-
"name": "Storm Software",
|
|
59
|
-
"email": "contact@stormsoftware.com",
|
|
60
|
-
"url": "https://stormsoftware.com"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
63
14
|
"exports": {
|
|
64
|
-
"./
|
|
65
|
-
|
|
66
|
-
"require":
|
|
67
|
-
|
|
68
|
-
"default": "./dist/types.cjs"
|
|
69
|
-
},
|
|
70
|
-
"default": { "types": "./dist/types.d.ts", "default": "./dist/types.mjs" }
|
|
71
|
-
},
|
|
72
|
-
"./storm-json": {
|
|
73
|
-
"import": {
|
|
74
|
-
"types": "./dist/storm-json.d.ts",
|
|
75
|
-
"default": "./dist/storm-json.mjs"
|
|
76
|
-
},
|
|
77
|
-
"require": {
|
|
78
|
-
"types": "./dist/storm-json.d.ts",
|
|
79
|
-
"default": "./dist/storm-json.cjs"
|
|
80
|
-
},
|
|
81
|
-
"default": {
|
|
82
|
-
"types": "./dist/storm-json.d.ts",
|
|
83
|
-
"default": "./dist/storm-json.mjs"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"./index": {
|
|
87
|
-
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
88
|
-
"require": {
|
|
89
|
-
"types": "./dist/index.d.ts",
|
|
90
|
-
"default": "./dist/index.cjs"
|
|
91
|
-
},
|
|
92
|
-
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
93
|
-
},
|
|
94
|
-
"./utils/strip-comments": {
|
|
95
|
-
"import": {
|
|
96
|
-
"types": "./dist/utils/strip-comments.d.ts",
|
|
97
|
-
"default": "./dist/utils/strip-comments.mjs"
|
|
98
|
-
},
|
|
99
|
-
"require": {
|
|
100
|
-
"types": "./dist/utils/strip-comments.d.ts",
|
|
101
|
-
"default": "./dist/utils/strip-comments.cjs"
|
|
102
|
-
},
|
|
103
|
-
"default": {
|
|
104
|
-
"types": "./dist/utils/strip-comments.d.ts",
|
|
105
|
-
"default": "./dist/utils/strip-comments.mjs"
|
|
106
|
-
}
|
|
15
|
+
".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
|
|
16
|
+
"./pointer": {
|
|
17
|
+
"require": "./dist/pointer/index.cjs",
|
|
18
|
+
"import": "./dist/pointer/index.mjs"
|
|
107
19
|
},
|
|
108
|
-
"./
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
"default": "./dist/utils/stringify.mjs"
|
|
112
|
-
},
|
|
113
|
-
"require": {
|
|
114
|
-
"types": "./dist/utils/stringify.d.ts",
|
|
115
|
-
"default": "./dist/utils/stringify.cjs"
|
|
116
|
-
},
|
|
117
|
-
"default": {
|
|
118
|
-
"types": "./dist/utils/stringify.d.ts",
|
|
119
|
-
"default": "./dist/utils/stringify.mjs"
|
|
120
|
-
}
|
|
20
|
+
"./pointer/find-reference": {
|
|
21
|
+
"require": "./dist/pointer/find-reference.cjs",
|
|
22
|
+
"import": "./dist/pointer/find-reference.mjs"
|
|
121
23
|
},
|
|
122
|
-
"./
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
"default": "./dist/utils/parse.mjs"
|
|
126
|
-
},
|
|
127
|
-
"require": {
|
|
128
|
-
"types": "./dist/utils/parse.d.ts",
|
|
129
|
-
"default": "./dist/utils/parse.cjs"
|
|
130
|
-
},
|
|
131
|
-
"default": {
|
|
132
|
-
"types": "./dist/utils/parse.d.ts",
|
|
133
|
-
"default": "./dist/utils/parse.mjs"
|
|
134
|
-
}
|
|
24
|
+
"./pointer/parse": {
|
|
25
|
+
"require": "./dist/pointer/parse.cjs",
|
|
26
|
+
"import": "./dist/pointer/parse.mjs"
|
|
135
27
|
},
|
|
136
|
-
"./
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
"default": "./dist/utils/parse-error.mjs"
|
|
140
|
-
},
|
|
141
|
-
"require": {
|
|
142
|
-
"types": "./dist/utils/parse-error.d.ts",
|
|
143
|
-
"default": "./dist/utils/parse-error.cjs"
|
|
144
|
-
},
|
|
145
|
-
"default": {
|
|
146
|
-
"types": "./dist/utils/parse-error.d.ts",
|
|
147
|
-
"default": "./dist/utils/parse-error.mjs"
|
|
148
|
-
}
|
|
28
|
+
"./storm-json": {
|
|
29
|
+
"require": "./dist/storm-json.cjs",
|
|
30
|
+
"import": "./dist/storm-json.mjs"
|
|
149
31
|
},
|
|
150
|
-
"./
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
"require": {
|
|
156
|
-
"types": "./dist/utils/index.d.ts",
|
|
157
|
-
"default": "./dist/utils/index.cjs"
|
|
158
|
-
},
|
|
159
|
-
"default": {
|
|
160
|
-
"types": "./dist/utils/index.d.ts",
|
|
161
|
-
"default": "./dist/utils/index.mjs"
|
|
162
|
-
}
|
|
32
|
+
"./types": { "require": "./dist/types.cjs", "import": "./dist/types.mjs" },
|
|
33
|
+
"./utils": {
|
|
34
|
+
"require": "./dist/utils/index.cjs",
|
|
35
|
+
"import": "./dist/utils/index.mjs"
|
|
163
36
|
},
|
|
164
37
|
"./utils/code-frames": {
|
|
165
|
-
"
|
|
166
|
-
|
|
167
|
-
"default": "./dist/utils/code-frames.mjs"
|
|
168
|
-
},
|
|
169
|
-
"require": {
|
|
170
|
-
"types": "./dist/utils/code-frames.d.ts",
|
|
171
|
-
"default": "./dist/utils/code-frames.cjs"
|
|
172
|
-
},
|
|
173
|
-
"default": {
|
|
174
|
-
"types": "./dist/utils/code-frames.d.ts",
|
|
175
|
-
"default": "./dist/utils/code-frames.mjs"
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
"./pointer/parse": {
|
|
179
|
-
"import": {
|
|
180
|
-
"types": "./dist/pointer/parse.d.ts",
|
|
181
|
-
"default": "./dist/pointer/parse.mjs"
|
|
182
|
-
},
|
|
183
|
-
"require": {
|
|
184
|
-
"types": "./dist/pointer/parse.d.ts",
|
|
185
|
-
"default": "./dist/pointer/parse.cjs"
|
|
186
|
-
},
|
|
187
|
-
"default": {
|
|
188
|
-
"types": "./dist/pointer/parse.d.ts",
|
|
189
|
-
"default": "./dist/pointer/parse.mjs"
|
|
190
|
-
}
|
|
38
|
+
"require": "./dist/utils/code-frames.cjs",
|
|
39
|
+
"import": "./dist/utils/code-frames.mjs"
|
|
191
40
|
},
|
|
192
|
-
"./
|
|
193
|
-
"
|
|
194
|
-
|
|
195
|
-
"default": "./dist/pointer/index.mjs"
|
|
196
|
-
},
|
|
197
|
-
"require": {
|
|
198
|
-
"types": "./dist/pointer/index.d.ts",
|
|
199
|
-
"default": "./dist/pointer/index.cjs"
|
|
200
|
-
},
|
|
201
|
-
"default": {
|
|
202
|
-
"types": "./dist/pointer/index.d.ts",
|
|
203
|
-
"default": "./dist/pointer/index.mjs"
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
"./pointer/find-reference": {
|
|
207
|
-
"import": {
|
|
208
|
-
"types": "./dist/pointer/find-reference.d.ts",
|
|
209
|
-
"default": "./dist/pointer/find-reference.mjs"
|
|
210
|
-
},
|
|
211
|
-
"require": {
|
|
212
|
-
"types": "./dist/pointer/find-reference.d.ts",
|
|
213
|
-
"default": "./dist/pointer/find-reference.cjs"
|
|
214
|
-
},
|
|
215
|
-
"default": {
|
|
216
|
-
"types": "./dist/pointer/find-reference.d.ts",
|
|
217
|
-
"default": "./dist/pointer/find-reference.mjs"
|
|
218
|
-
}
|
|
41
|
+
"./utils/parse": {
|
|
42
|
+
"require": "./dist/utils/parse.cjs",
|
|
43
|
+
"import": "./dist/utils/parse.mjs"
|
|
219
44
|
},
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
"types": "./dist/index.d.ts",
|
|
224
|
-
"default": "./dist/index.cjs"
|
|
225
|
-
},
|
|
226
|
-
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
45
|
+
"./utils/parse-error": {
|
|
46
|
+
"require": "./dist/utils/parse-error.cjs",
|
|
47
|
+
"import": "./dist/utils/parse-error.mjs"
|
|
227
48
|
},
|
|
228
|
-
"./utils": {
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
"default": "./dist/utils/index.mjs"
|
|
232
|
-
},
|
|
233
|
-
"require": {
|
|
234
|
-
"types": "./dist/utils/index.d.ts",
|
|
235
|
-
"default": "./dist/utils/index.cjs"
|
|
236
|
-
},
|
|
237
|
-
"default": {
|
|
238
|
-
"types": "./dist/utils/index.d.ts",
|
|
239
|
-
"default": "./dist/utils/index.mjs"
|
|
240
|
-
}
|
|
49
|
+
"./utils/stringify": {
|
|
50
|
+
"require": "./dist/utils/stringify.cjs",
|
|
51
|
+
"import": "./dist/utils/stringify.mjs"
|
|
241
52
|
},
|
|
242
|
-
"./
|
|
243
|
-
"
|
|
244
|
-
|
|
245
|
-
"default": "./dist/pointer/index.mjs"
|
|
246
|
-
},
|
|
247
|
-
"require": {
|
|
248
|
-
"types": "./dist/pointer/index.d.ts",
|
|
249
|
-
"default": "./dist/pointer/index.cjs"
|
|
250
|
-
},
|
|
251
|
-
"default": {
|
|
252
|
-
"types": "./dist/pointer/index.d.ts",
|
|
253
|
-
"default": "./dist/pointer/index.mjs"
|
|
254
|
-
}
|
|
53
|
+
"./utils/strip-comments": {
|
|
54
|
+
"require": "./dist/utils/strip-comments.cjs",
|
|
55
|
+
"import": "./dist/utils/strip-comments.mjs"
|
|
255
56
|
},
|
|
256
|
-
"
|
|
57
|
+
"./*": "./*"
|
|
257
58
|
},
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
|
|
261
|
-
|
|
59
|
+
"types": "./dist/index.d.cts",
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"buffer": "6.0.3",
|
|
62
|
+
"lines-and-columns": "2.0.4",
|
|
63
|
+
"superjson": "2.2.2"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": { "@types/node": "^24.10.1", "tsdown": "^0.17.1" },
|
|
66
|
+
"publishConfig": { "access": "public" },
|
|
67
|
+
"gitHead": "e9fb3e13aebac54518fd668cecdd3dd89540d34e"
|
|
262
68
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The JSON library used by Storm Software for building TypeScript applications.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* A package containing JSON parsing/stringify utilities used by Storm Software
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export * from "./storm-json";
|
|
10
|
-
export * from "./types";
|
|
11
|
-
export * from "./utils";
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export interface Reference {
|
|
2
|
-
/** Target value where pointer is pointing. */
|
|
3
|
-
readonly val: unknown;
|
|
4
|
-
/** Object which contains the target value. */
|
|
5
|
-
readonly obj?: unknown | object | unknown[];
|
|
6
|
-
/** Key which targets the target value in the object. */
|
|
7
|
-
readonly key?: string | number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Finds a target in document specified by JSON Pointer. Also returns the
|
|
11
|
-
* object containing the target and key used to reference that object.
|
|
12
|
-
*
|
|
13
|
-
* Throws Error('NOT_FOUND') if pointer does not result into a value in the middle
|
|
14
|
-
* of the path. If the last element of the path does not result into a value, the
|
|
15
|
-
* lookup succeeds with `val` set to `undefined`. It can be used to discriminate
|
|
16
|
-
* missing values, because `undefined` is not a valid JSON value.
|
|
17
|
-
*
|
|
18
|
-
* If last element in array is targeted using "-", e.g. "/arr/-", use
|
|
19
|
-
* `isArrayEnd` to verify that:
|
|
20
|
-
*
|
|
21
|
-
* ```js
|
|
22
|
-
* const ref = find({arr: [1, 2, 3], ['arr', '-']});
|
|
23
|
-
* if (isArrayReference(ref)) {
|
|
24
|
-
* if (isArrayEnd(ref)) {
|
|
25
|
-
* // ...
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @param val - Document to search in.
|
|
31
|
-
* @param path - JSON Pointer path.
|
|
32
|
-
* @returns Reference to the target.
|
|
33
|
-
*/
|
|
34
|
-
export declare const find: (val: unknown, path: Reference["key"][]) => Reference;
|
|
35
|
-
export interface ArrayReference<T = unknown> {
|
|
36
|
-
/** `undefined` in case JSON Pointer points to last element, e.g. "/foo/-". */
|
|
37
|
-
readonly val: undefined | T;
|
|
38
|
-
readonly obj: T[];
|
|
39
|
-
readonly key: number;
|
|
40
|
-
}
|
|
41
|
-
export declare const isArrayReference: <T = unknown>(ref: Reference) => ref is ArrayReference<T>;
|
|
42
|
-
export declare const isArrayEnd: (ref: ArrayReference) => boolean;
|
|
43
|
-
export interface ObjectReference<T = unknown> {
|
|
44
|
-
readonly val: T;
|
|
45
|
-
readonly obj: Record<string, T>;
|
|
46
|
-
readonly key: string;
|
|
47
|
-
}
|
|
48
|
-
export declare const isObjectReference: <T = unknown>(ref: Reference) => ref is ObjectReference<T>;
|
package/dist/pointer/index.d.ts
DELETED
package/dist/pointer/parse.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { JsonPointerPath } from "@stryke/types/json";
|
|
2
|
-
/**
|
|
3
|
-
* Escapes a JSON pointer path segment.
|
|
4
|
-
*
|
|
5
|
-
* @param segment - JSON pointer path segment.
|
|
6
|
-
* @returns Escaped JSON pointer path segment.
|
|
7
|
-
*/
|
|
8
|
-
export declare function escapePointerSegment(segment: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Unescapes a JSON pointer path segment.
|
|
11
|
-
*
|
|
12
|
-
* @param segment - JSON pointer path segment.
|
|
13
|
-
* @returns Unescaped JSON pointer path segment.
|
|
14
|
-
*/
|
|
15
|
-
export declare function unescapePointerSegment(segment: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* Convert JSON pointer like "/foo/bar" to array like ["", "foo", "bar"], while
|
|
18
|
-
* also un-escaping reserved characters.
|
|
19
|
-
*/
|
|
20
|
-
export declare function parseJsonPointer(pointer: string): JsonPointerPath;
|
|
21
|
-
/**
|
|
22
|
-
* Escape and format a path array like ["", "foo", "bar"] to JSON pointer
|
|
23
|
-
* like "/foo/bar".
|
|
24
|
-
*/
|
|
25
|
-
export declare function formatJsonPointer(path: JsonPointerPath): string;
|
|
26
|
-
/**
|
|
27
|
-
* Returns true if JSON Pointer points to root value, false otherwise.
|
|
28
|
-
*/
|
|
29
|
-
export declare const isRoot: (path: string | number | JsonPointerPath) => boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Returns parent path, e.g. for ['foo', 'bar', 'baz'] returns ['foo', 'bar'].
|
|
32
|
-
*/
|
|
33
|
-
export declare function parent(path: JsonPointerPath): JsonPointerPath;
|
|
34
|
-
/**
|
|
35
|
-
* Check if path component can be a valid array index.
|
|
36
|
-
*/
|
|
37
|
-
export declare function isValidIndex(index: string | number): boolean;
|
|
38
|
-
export declare const isInteger: (str: string) => boolean;
|
package/dist/storm-json.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Class, JsonParseOptions, JsonParserResult, JsonSerializeOptions, JsonValue } from "./types";
|
|
2
|
-
import SuperJSON from "superjson";
|
|
3
|
-
/**
|
|
4
|
-
* A static JSON parser class used by Storm Software to serialize and deserialize JSON data
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* This class uses the [SuperJSON](https://github.com/blitz-js/superjson) library under the hood.
|
|
8
|
-
*/
|
|
9
|
-
export declare class StormJSON extends SuperJSON {
|
|
10
|
-
#private;
|
|
11
|
-
static get instance(): StormJSON;
|
|
12
|
-
/**
|
|
13
|
-
* Deserialize the given value with superjson using the given metadata
|
|
14
|
-
*/
|
|
15
|
-
static deserialize<TData = unknown>(payload: JsonParserResult): TData;
|
|
16
|
-
/**
|
|
17
|
-
* Serialize the given value with superjson
|
|
18
|
-
*/
|
|
19
|
-
static serialize(object: JsonValue): JsonParserResult;
|
|
20
|
-
/**
|
|
21
|
-
* Parse the given string value with superjson using the given metadata
|
|
22
|
-
*
|
|
23
|
-
* @param value - The string value to parse
|
|
24
|
-
* @returns The parsed data
|
|
25
|
-
*/
|
|
26
|
-
static parse<TData = unknown>(value: string): TData;
|
|
27
|
-
/**
|
|
28
|
-
* Serializes the given data to a JSON string.
|
|
29
|
-
* By default the JSON string is formatted with a 2 space indentation to be easy readable.
|
|
30
|
-
*
|
|
31
|
-
* @param value - Object which should be serialized to JSON
|
|
32
|
-
* @param _options - JSON serialize options
|
|
33
|
-
* @returns the formatted JSON representation of the object
|
|
34
|
-
*/
|
|
35
|
-
static stringify<T>(value: T, _options?: JsonSerializeOptions): string;
|
|
36
|
-
/**
|
|
37
|
-
* Parses the given JSON string and returns the object the JSON content represents.
|
|
38
|
-
* By default javascript-style comments and trailing commas are allowed.
|
|
39
|
-
*
|
|
40
|
-
* @param strData - JSON content as string
|
|
41
|
-
* @param options - JSON parse options
|
|
42
|
-
* @returns Object the JSON content represents
|
|
43
|
-
*/
|
|
44
|
-
static parseJson<TData = unknown>(strData: string, options?: JsonParseOptions): TData;
|
|
45
|
-
/**
|
|
46
|
-
* Register a custom schema with superjson
|
|
47
|
-
*
|
|
48
|
-
* @param name - The name of the schema
|
|
49
|
-
* @param serialize - The function to serialize the schema
|
|
50
|
-
* @param deserialize - The function to deserialize the schema
|
|
51
|
-
* @param isApplicable - The function to check if the schema is applicable
|
|
52
|
-
*/
|
|
53
|
-
static register<TData = any, TJsonObject extends JsonValue = JsonValue>(name: string, serialize: (data: TData) => TJsonObject, deserialize: (json: TJsonObject) => TData, isApplicable: (data: any) => data is TData): void;
|
|
54
|
-
/**
|
|
55
|
-
* Register a class with superjson
|
|
56
|
-
*
|
|
57
|
-
* @param classConstructor - The class constructor to register
|
|
58
|
-
*/
|
|
59
|
-
static registerClass(classConstructor: Class, options?: {
|
|
60
|
-
identifier?: string;
|
|
61
|
-
allowProps?: string[];
|
|
62
|
-
} | string): void;
|
|
63
|
-
private constructor();
|
|
64
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { ParseOptions } from "jsonc-parser";
|
|
2
|
-
export type PrimitiveJsonValue = string | number | boolean | undefined | null;
|
|
3
|
-
export interface Class {
|
|
4
|
-
new (...args: any[]): any;
|
|
5
|
-
}
|
|
6
|
-
export type JsonValue = PrimitiveJsonValue | JsonArray | JsonObject;
|
|
7
|
-
export type JsonArray = Array<JsonValue>;
|
|
8
|
-
export interface JsonObject {
|
|
9
|
-
[key: string]: JsonValue;
|
|
10
|
-
}
|
|
11
|
-
export type ClassInstance = any;
|
|
12
|
-
export type SerializableJsonValue = symbol | Set<JsonValue> | Map<JsonValue, JsonValue> | undefined | bigint | Date | ClassInstance | RegExp;
|
|
13
|
-
export type Tree<T> = InnerNode<T> | Leaf<T>;
|
|
14
|
-
export type Leaf<T> = [T];
|
|
15
|
-
export type InnerNode<T> = [T, Record<string, Tree<T>>];
|
|
16
|
-
export type PrimitiveTypeAnnotation = "number" | "undefined" | "bigint";
|
|
17
|
-
export type LeafTypeAnnotation = PrimitiveTypeAnnotation | "regexp" | "Date" | "Error" | "URL";
|
|
18
|
-
export type TypedArrayAnnotation = ["typed-array", string];
|
|
19
|
-
export type ClassTypeAnnotation = ["class", string];
|
|
20
|
-
export type SymbolTypeAnnotation = ["symbol", string];
|
|
21
|
-
export type CustomTypeAnnotation = ["custom", string];
|
|
22
|
-
export type SimpleTypeAnnotation = LeafTypeAnnotation | "map" | "set";
|
|
23
|
-
export type CompositeTypeAnnotation = TypedArrayAnnotation | ClassTypeAnnotation | SymbolTypeAnnotation | CustomTypeAnnotation;
|
|
24
|
-
export type TypeAnnotation = SimpleTypeAnnotation | CompositeTypeAnnotation;
|
|
25
|
-
export interface JsonParseOptions extends ParseOptions {
|
|
26
|
-
/**
|
|
27
|
-
* Expect JSON with javascript-style
|
|
28
|
-
*
|
|
29
|
-
* @defaultValue false
|
|
30
|
-
*/
|
|
31
|
-
expectComments?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Disallow javascript-style
|
|
34
|
-
*
|
|
35
|
-
* @defaultValue false
|
|
36
|
-
*/
|
|
37
|
-
disallowComments?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Allow trailing commas in the JSON content
|
|
40
|
-
*/
|
|
41
|
-
allowTrailingComma?: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface JsonSerializeOptions {
|
|
44
|
-
/**
|
|
45
|
-
* the whitespaces to add as indentation to make the output more readable.
|
|
46
|
-
*
|
|
47
|
-
* @defaultValue 2
|
|
48
|
-
*/
|
|
49
|
-
spaces?: number;
|
|
50
|
-
}
|
|
51
|
-
export interface JsonParserResult {
|
|
52
|
-
json: JsonValue;
|
|
53
|
-
meta?: {
|
|
54
|
-
values?: Tree<TypeAnnotation> | Record<string, Tree<TypeAnnotation>> | undefined;
|
|
55
|
-
referentialEqualities?: Record<string, string[]> | [string[]] | [string[], Record<string, string[]>];
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export interface JsonParserInterface {
|
|
59
|
-
parse: <TData = any>(strData: string) => TData;
|
|
60
|
-
stringify: <TData = any>(data: TData) => string;
|
|
61
|
-
serialize: (object: JsonValue) => JsonParserResult;
|
|
62
|
-
deserialize: <TData = any>(payload: JsonParserResult) => TData;
|
|
63
|
-
register: <TData = any, TJsonValue extends JsonValue = JsonValue>(name: string, serialize: (object: JsonValue) => TJsonValue, deserialize: (payload: TJsonValue) => TData, isApplicable: (data: any) => data is TData) => void;
|
|
64
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface Location {
|
|
2
|
-
column: number;
|
|
3
|
-
line: number;
|
|
4
|
-
}
|
|
5
|
-
interface NodeLocation {
|
|
6
|
-
end?: Location;
|
|
7
|
-
start?: Location;
|
|
8
|
-
}
|
|
9
|
-
export declare function codeFrameColumns(rawLines: string, loc: NodeLocation, opts?: {
|
|
10
|
-
linesAbove?: number;
|
|
11
|
-
linesBelow?: number;
|
|
12
|
-
highlight?: (rawLines: string) => string;
|
|
13
|
-
}): string;
|
|
14
|
-
export {};
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ParseError } from "jsonc-parser";
|
|
2
|
-
/**
|
|
3
|
-
* Nicely formats a JSON error with context
|
|
4
|
-
*
|
|
5
|
-
* @param input - JSON content as string
|
|
6
|
-
* @param parseError - jsonc ParseError
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function formatParseError(input: string, parseError: ParseError): string;
|
package/dist/utils/parse.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const invalidKeyChars: readonly ["@", "/", "#", "$", " ", ":", ";", ",", ".", "!", "?", "&", "=", "+", "-", "*", "%", "^", "~", "|", "\\", "\"", "'", "`", "{", "}", "[", "]", "(", ")", "<", ">"];
|
|
2
|
-
/**
|
|
3
|
-
* Stringify a value to a JSON-like string.
|
|
4
|
-
*
|
|
5
|
-
* @param value - The value to stringify
|
|
6
|
-
* @param spacing - The spacing to use for the stringification
|
|
7
|
-
* @returns The stringified value
|
|
8
|
-
*/
|
|
9
|
-
export declare const stringify: (value: unknown, spacing?: string | number) => string;
|