json-as 0.9.8 → 0.9.9
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/.github/workflows/nodejs.yml +9 -10
- package/CHANGELOG +10 -2
- package/README.md +55 -8
- package/asconfig.json +24 -3
- package/assembly/__tests__/test.spec.ts +564 -0
- package/assembly/__tests__/types.ts +82 -0
- package/assembly/{src/chars.ts → chars.ts} +36 -36
- package/assembly/deserialize/array/array.ts +4 -4
- package/assembly/deserialize/array/bool.ts +4 -4
- package/assembly/deserialize/array/float.ts +4 -4
- package/assembly/deserialize/array/integer.ts +4 -4
- package/assembly/deserialize/array/map.ts +4 -4
- package/assembly/deserialize/array/object.ts +4 -4
- package/assembly/deserialize/array/string.ts +4 -4
- package/assembly/deserialize/array.ts +5 -4
- package/assembly/deserialize/bool.ts +4 -4
- package/assembly/deserialize/date.ts +2 -2
- package/assembly/deserialize/float.ts +2 -2
- package/assembly/deserialize/integer.ts +3 -3
- package/assembly/deserialize/map.ts +4 -4
- package/assembly/deserialize/mpz.ts +12 -0
- package/assembly/deserialize/object.ts +4 -4
- package/assembly/deserialize/string.ts +5 -5
- package/assembly/index.ts +25 -23
- package/assembly/serialize/array.ts +6 -5
- package/assembly/serialize/bool.ts +2 -2
- package/assembly/serialize/date.ts +2 -2
- package/assembly/serialize/float.ts +2 -2
- package/assembly/serialize/integer.ts +2 -2
- package/assembly/serialize/map.ts +8 -7
- package/assembly/serialize/mpz.ts +6 -0
- package/assembly/serialize/object.ts +2 -2
- package/assembly/serialize/string.ts +5 -5
- package/assembly/serialize/unknown.ts +5 -5
- package/assembly/test.ts +30 -40
- package/assembly/types.ts +4 -0
- package/assembly/{src/util.ts → util.ts} +3 -3
- package/bench/benchmark.ts +1 -1
- package/build/test.spec.wasm +0 -0
- package/build/test.spec.wasm.map +1 -0
- package/build/test.spec.wat +112683 -0
- package/build/test.wasm +0 -0
- package/build/test.wasm.map +1 -0
- package/build/test.wat +24968 -0
- package/package.json +11 -12
- package/transform/lib/index.js +12 -0
- package/transform/lib/visitor.js +516 -0
- package/transform/package.json +1 -1
- package/transform/src/index.ts +8 -0
- package/transform/src/visitor.ts +543 -0
- package/transform/tsconfig.json +23 -63
- package/tsconfig.json +13 -13
- package/as-pect.asconfig.json +0 -24
- package/as-pect.config.js +0 -30
- package/assembly/__tests__/deserialize.spec.ts +0 -301
- package/assembly/__tests__/serialize.spec.ts +0 -398
- package/assembly/deserialize/box.ts +0 -17
- package/assembly/serialize/box.ts +0 -11
- package/develop/assembly/serialize/unknown.ts +0 -46
- package/transform/lib/index.old.js +0 -257
- package/transform/lib/types.js +0 -17
- package/transform/src/index.old.ts +0 -312
- /package/assembly/{src/sink.ts → sink.ts} +0 -0
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
import { JSON } from "..";
|
|
2
|
-
import {
|
|
3
|
-
describe,
|
|
4
|
-
expect,
|
|
5
|
-
run
|
|
6
|
-
} from "as-test/assembly";
|
|
7
|
-
|
|
8
|
-
@json
|
|
9
|
-
class BaseObject {
|
|
10
|
-
a: string;
|
|
11
|
-
constructor(a: string) {
|
|
12
|
-
this.a = a;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@json
|
|
17
|
-
class DerivedObject extends BaseObject {
|
|
18
|
-
b: string;
|
|
19
|
-
constructor(a: string, b: string) {
|
|
20
|
-
super(a);
|
|
21
|
-
this.b = b;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@json
|
|
26
|
-
class Map4 {
|
|
27
|
-
a: string;
|
|
28
|
-
b: string;
|
|
29
|
-
c: string;
|
|
30
|
-
d: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@json
|
|
34
|
-
class Vec3 {
|
|
35
|
-
x: f64;
|
|
36
|
-
y: f64;
|
|
37
|
-
z: f64;
|
|
38
|
-
|
|
39
|
-
static shouldIgnore: string = "should not be serialized";
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@json
|
|
43
|
-
class Player {
|
|
44
|
-
firstName: string;
|
|
45
|
-
lastName: string;
|
|
46
|
-
lastActive: i32[];
|
|
47
|
-
age: i32;
|
|
48
|
-
pos: Vec3 | null;
|
|
49
|
-
isVerified: boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@json
|
|
53
|
-
class OmitIf {
|
|
54
|
-
x: i32 = 1;
|
|
55
|
-
@omitif("this.y == -1")
|
|
56
|
-
y: i32 = -1;
|
|
57
|
-
z: i32 = 1;
|
|
58
|
-
@omitnull()
|
|
59
|
-
foo: string | null = null
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
class Nullable { }
|
|
63
|
-
type Null = Nullable | null;
|
|
64
|
-
|
|
65
|
-
describe("Should serialize strings", () => {
|
|
66
|
-
|
|
67
|
-
expect(
|
|
68
|
-
JSON.stringify("abcdefg")
|
|
69
|
-
).toBe("\"abcdefg\"");
|
|
70
|
-
|
|
71
|
-
expect(
|
|
72
|
-
JSON.stringify('st"ring" w""ith quotes"')
|
|
73
|
-
).toBe('"st\\"ring\\" w\\"\\"ith quotes\\""');
|
|
74
|
-
|
|
75
|
-
expect(
|
|
76
|
-
JSON.stringify('string \"with random spa\nces and \nnewlines\n\n\n')
|
|
77
|
-
).toBe('"string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"');
|
|
78
|
-
|
|
79
|
-
expect(
|
|
80
|
-
JSON.stringify('string with colon : comma , brace [ ] bracket { } and quote " and other quote \\"')
|
|
81
|
-
).toBe('"string with colon : comma , brace [ ] bracket { } and quote \\" and other quote \\\\\\""')
|
|
82
|
-
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
describe("Should serialize integers", () => {
|
|
86
|
-
|
|
87
|
-
expect(
|
|
88
|
-
JSON.stringify(0)
|
|
89
|
-
).toBe("0");
|
|
90
|
-
|
|
91
|
-
expect(
|
|
92
|
-
JSON.stringify<u32>(100)
|
|
93
|
-
).toBe("100");
|
|
94
|
-
|
|
95
|
-
expect(
|
|
96
|
-
JSON.stringify<u64>(101)
|
|
97
|
-
).toBe("101");
|
|
98
|
-
|
|
99
|
-
expect(
|
|
100
|
-
JSON.stringify<i32>(-100)
|
|
101
|
-
).toBe("-100");
|
|
102
|
-
|
|
103
|
-
expect(
|
|
104
|
-
JSON.stringify<i64>(-101)
|
|
105
|
-
).toBe("-101");
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
describe("Should serialize floats", () => {
|
|
110
|
-
|
|
111
|
-
expect(
|
|
112
|
-
JSON.stringify<f64>(7.23)
|
|
113
|
-
).toBe("7.23");
|
|
114
|
-
|
|
115
|
-
expect(
|
|
116
|
-
JSON.stringify<f64>(10e2)
|
|
117
|
-
).toBe("1000.0");
|
|
118
|
-
|
|
119
|
-
expect(
|
|
120
|
-
JSON.stringify<f64>(123456e-5)
|
|
121
|
-
).toBe("1.23456");
|
|
122
|
-
|
|
123
|
-
expect(
|
|
124
|
-
JSON.stringify<f64>(0.0)
|
|
125
|
-
).toBe("0.0");
|
|
126
|
-
|
|
127
|
-
expect(
|
|
128
|
-
JSON.stringify<f64>(-7.23)
|
|
129
|
-
).toBe("-7.23");
|
|
130
|
-
|
|
131
|
-
expect(
|
|
132
|
-
JSON.stringify<f64>(1e-6)
|
|
133
|
-
).toBe("0.000001");
|
|
134
|
-
|
|
135
|
-
expect(
|
|
136
|
-
JSON.stringify<f64>(1e-7)
|
|
137
|
-
).toBe("1e-7");
|
|
138
|
-
|
|
139
|
-
expect(
|
|
140
|
-
JSON.parse<f64>("1E-7")
|
|
141
|
-
).toBe(1e-7);
|
|
142
|
-
|
|
143
|
-
expect(
|
|
144
|
-
JSON.stringify<f64>(1e20)
|
|
145
|
-
).toBe("100000000000000000000.0");
|
|
146
|
-
|
|
147
|
-
expect(
|
|
148
|
-
JSON.stringify<f64>(1e21)
|
|
149
|
-
).toBe("1e+21");
|
|
150
|
-
|
|
151
|
-
expect(
|
|
152
|
-
JSON.parse<f64>("1E+21")
|
|
153
|
-
).toBe(1e21);
|
|
154
|
-
|
|
155
|
-
expect(
|
|
156
|
-
JSON.parse<f64>("1e21")
|
|
157
|
-
).toBe(1e21);
|
|
158
|
-
|
|
159
|
-
expect(
|
|
160
|
-
JSON.parse<f64>("1E21")
|
|
161
|
-
).toBe(1e21);
|
|
162
|
-
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
describe("Should serialize booleans", () => {
|
|
166
|
-
|
|
167
|
-
expect(
|
|
168
|
-
JSON.stringify<bool>(true)
|
|
169
|
-
).toBe("true");
|
|
170
|
-
|
|
171
|
-
expect(
|
|
172
|
-
JSON.stringify<bool>(false)
|
|
173
|
-
).toBe("false");
|
|
174
|
-
|
|
175
|
-
expect(
|
|
176
|
-
JSON.stringify<boolean>(true)
|
|
177
|
-
).toBe("true");
|
|
178
|
-
|
|
179
|
-
expect(
|
|
180
|
-
JSON.stringify<boolean>(false)
|
|
181
|
-
).toBe("false");
|
|
182
|
-
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
describe("Should serialize class inheritance", () => {
|
|
186
|
-
|
|
187
|
-
const obj = new DerivedObject("1", "2");
|
|
188
|
-
|
|
189
|
-
expect(
|
|
190
|
-
JSON.stringify(obj)
|
|
191
|
-
).toBe("{\"a\":\"1\",\"b\":\"2\"}");
|
|
192
|
-
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
describe("Should serialize nulls", () => {
|
|
196
|
-
|
|
197
|
-
expect(
|
|
198
|
-
JSON.stringify<Null>(null)
|
|
199
|
-
).toBe("null");
|
|
200
|
-
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
describe("Should serialize integer arrays", () => {
|
|
205
|
-
|
|
206
|
-
expect(
|
|
207
|
-
JSON.stringify<u32[]>([0, 100, 101])
|
|
208
|
-
).toBe("[0,100,101]");
|
|
209
|
-
|
|
210
|
-
expect(
|
|
211
|
-
JSON.stringify<u64[]>([0, 100, 101])
|
|
212
|
-
).toBe("[0,100,101]");
|
|
213
|
-
|
|
214
|
-
expect(
|
|
215
|
-
JSON.stringify<i32[]>([0, 100, 101, -100, -101])
|
|
216
|
-
).toBe("[0,100,101,-100,-101]");
|
|
217
|
-
|
|
218
|
-
expect(
|
|
219
|
-
JSON.stringify<i64[]>([0, 100, 101, -100, -101])
|
|
220
|
-
).toBe("[0,100,101,-100,-101]");
|
|
221
|
-
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
describe("Should serialize float arrays", () => {
|
|
225
|
-
|
|
226
|
-
expect(
|
|
227
|
-
JSON.stringify<f64[]>([7.23, 10e2, 10e2, 123456e-5, 123456e-5, 0.0, 7.23])
|
|
228
|
-
).toBe("[7.23,1000.0,1000.0,1.23456,1.23456,0.0,7.23]");
|
|
229
|
-
|
|
230
|
-
expect(
|
|
231
|
-
JSON.stringify<f64[]>([1e21, 1e22, 1e-7, 1e-8, 1e-9])
|
|
232
|
-
).toBe("[1e+21,1e+22,1e-7,1e-8,1e-9]");
|
|
233
|
-
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
describe("Should serialize boolean arrays", () => {
|
|
237
|
-
|
|
238
|
-
expect(
|
|
239
|
-
JSON.stringify<bool[]>([true, false])
|
|
240
|
-
).toBe("[true,false]");
|
|
241
|
-
|
|
242
|
-
expect(
|
|
243
|
-
JSON.stringify<boolean[]>([true, false])
|
|
244
|
-
).toBe("[true,false]");
|
|
245
|
-
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
describe("Should serialize string arrays", () => {
|
|
249
|
-
|
|
250
|
-
expect(
|
|
251
|
-
JSON.stringify<string[]>(['string \"with random spa\nces and \nnewlines\n\n\n'])
|
|
252
|
-
).toBe('["string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"]');
|
|
253
|
-
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
describe("Should serialize nested integer arrays", () => {
|
|
257
|
-
|
|
258
|
-
expect(
|
|
259
|
-
JSON.stringify<i64[][]>([[100, 101], [-100, -101], [0]])
|
|
260
|
-
).toBe("[[100,101],[-100,-101],[0]]");
|
|
261
|
-
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
describe("Should serialize nested float arrays", () => {
|
|
265
|
-
|
|
266
|
-
expect(
|
|
267
|
-
JSON.stringify<f64[][]>([
|
|
268
|
-
[7.23],
|
|
269
|
-
[10e2],
|
|
270
|
-
[10e2],
|
|
271
|
-
[123456e-5],
|
|
272
|
-
[123456e-5],
|
|
273
|
-
[0.0],
|
|
274
|
-
[7.23],
|
|
275
|
-
])
|
|
276
|
-
).toBe("[[7.23],[1000.0],[1000.0],[1.23456],[1.23456],[0.0],[7.23]]");
|
|
277
|
-
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
describe("Should serialize nested boolean arrays", () => {
|
|
281
|
-
|
|
282
|
-
expect(
|
|
283
|
-
JSON.stringify<bool[][]>([[true], [false]])
|
|
284
|
-
).toBe("[[true],[false]]");
|
|
285
|
-
|
|
286
|
-
expect(
|
|
287
|
-
JSON.stringify<boolean[][]>([[true], [false]])
|
|
288
|
-
).toBe("[[true],[false]]");
|
|
289
|
-
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
describe("Should serialize object arrays", () => {
|
|
293
|
-
|
|
294
|
-
expect(
|
|
295
|
-
JSON.stringify<Vec3[]>([
|
|
296
|
-
{
|
|
297
|
-
x: 3.4,
|
|
298
|
-
y: 1.2,
|
|
299
|
-
z: 8.3,
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
x: 3.4,
|
|
303
|
-
y: -2.1,
|
|
304
|
-
z: 9.3,
|
|
305
|
-
},
|
|
306
|
-
])
|
|
307
|
-
).toBe('[{"x":3.4,"y":1.2,"z":8.3},{"x":3.4,"y":-2.1,"z":9.3}]');
|
|
308
|
-
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
describe("Should serialize objects", () => {
|
|
312
|
-
|
|
313
|
-
expect(
|
|
314
|
-
JSON.stringify<Vec3>({
|
|
315
|
-
x: 3.4,
|
|
316
|
-
y: 1.2,
|
|
317
|
-
z: 8.3,
|
|
318
|
-
})
|
|
319
|
-
).toBe('{"x":3.4,"y":1.2,"z":8.3}');
|
|
320
|
-
|
|
321
|
-
expect(
|
|
322
|
-
JSON.stringify<Player>({
|
|
323
|
-
firstName: "Emmet",
|
|
324
|
-
lastName: "West",
|
|
325
|
-
lastActive: [8, 27, 2022],
|
|
326
|
-
age: 23,
|
|
327
|
-
pos: {
|
|
328
|
-
x: 3.4,
|
|
329
|
-
y: 1.2,
|
|
330
|
-
z: 8.3,
|
|
331
|
-
},
|
|
332
|
-
isVerified: true,
|
|
333
|
-
})
|
|
334
|
-
).toBe('{"firstName":"Emmet","lastName":"West","lastActive":[8,27,2022],"age":23,"pos":{"x":3.4,"y":1.2,"z":8.3},"isVerified":true}');
|
|
335
|
-
|
|
336
|
-
expect(
|
|
337
|
-
JSON.stringify<ObjectWithFloat>({ f: 7.23 })
|
|
338
|
-
).toBe('{"f":7.23}');
|
|
339
|
-
|
|
340
|
-
expect(
|
|
341
|
-
JSON.stringify<ObjectWithFloat>({ f: 0.000001 })
|
|
342
|
-
).toBe('{"f":0.000001}');
|
|
343
|
-
|
|
344
|
-
expect(
|
|
345
|
-
JSON.stringify<ObjectWithFloat>({ f: 1e-7 })
|
|
346
|
-
).toBe('{"f":1e-7}');
|
|
347
|
-
|
|
348
|
-
expect(
|
|
349
|
-
JSON.stringify<ObjectWithFloat>({ f: 1e20 })
|
|
350
|
-
).toBe('{"f":100000000000000000000.0}');
|
|
351
|
-
|
|
352
|
-
expect(
|
|
353
|
-
JSON.stringify<ObjectWithFloat>({ f: 1e21 })
|
|
354
|
-
).toBe('{"f":1e+21}');
|
|
355
|
-
|
|
356
|
-
expect(
|
|
357
|
-
JSON.stringify<ObjWithStrangeKey<string>>({ data: "foo" })
|
|
358
|
-
).toBe('{"a\\\\\\t\\"\\u0002b`c":"foo"}');
|
|
359
|
-
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
describe("Should serialize @omit'ed objects", () => {
|
|
363
|
-
|
|
364
|
-
expect(
|
|
365
|
-
JSON.stringify(<OmitIf>{
|
|
366
|
-
y: 1
|
|
367
|
-
})
|
|
368
|
-
).toBe('{"x":1,"y":1,"z":1}');
|
|
369
|
-
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
run();
|
|
373
|
-
|
|
374
|
-
@json
|
|
375
|
-
class ObjWithString {
|
|
376
|
-
s!: string;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
@json
|
|
380
|
-
class ObjectWithStringArray {
|
|
381
|
-
sa!: string[];
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
@json
|
|
385
|
-
class ObjectWithFloat {
|
|
386
|
-
f!: f64;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
@json
|
|
390
|
-
class ObjectWithFloatArray {
|
|
391
|
-
fa!: f64[];
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
@json
|
|
395
|
-
class ObjWithStrangeKey<T> {
|
|
396
|
-
@alias('a\\\t"\x02b`c')
|
|
397
|
-
data!: T;
|
|
398
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { JSON } from "..";
|
|
2
|
-
|
|
3
|
-
// @ts-ignore: Decorator
|
|
4
|
-
export function deserializeBox<T extends Box<any>>(data: string): T {
|
|
5
|
-
if (isNullable<T>() && data == "null") {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
const instance = changetype<nonnull<T>>(__new(offsetof<nonnull<T>>(), idof<nonnull<T>>()))// as Box<usize>;
|
|
9
|
-
const val = instance._val;
|
|
10
|
-
instance._val = parseDirectInference(val, data);
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
return changetype<T>(instance);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function parseDirectInference<T>(type: T, data: string, initializeDefaultValues: boolean = false): T {
|
|
16
|
-
return JSON.parse<T>(data, initializeDefaultValues)
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NULL_WORD } from "../src/chars";
|
|
2
|
-
import { JSON } from "..";
|
|
3
|
-
import { Box } from "as-container";
|
|
4
|
-
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
export function serializeBox<T extends Box<any>>(data: T): string {
|
|
7
|
-
if (isNullable<T>() && changetype<usize>(data) == <usize>0) {
|
|
8
|
-
return NULL_WORD;
|
|
9
|
-
}
|
|
10
|
-
return JSON.stringify(data.unwrap());
|
|
11
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { JSON } from "..";
|
|
2
|
-
import { Sink } from "../src/sink";
|
|
3
|
-
import { __atoi_fast } from "../src/util";
|
|
4
|
-
import { serializeUnknownArray } from "./array/unknown";
|
|
5
|
-
import { serializeBool } from "./bool";
|
|
6
|
-
import { serializeFloat } from "./float";
|
|
7
|
-
import { serializeInteger } from "./integer";
|
|
8
|
-
import { serializeString } from "./string";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializes unknown values into their correct serializer and returns the data.
|
|
12
|
-
*
|
|
13
|
-
* @param data - The JSON.Value to be serialized.
|
|
14
|
-
* @returns The serialized result.
|
|
15
|
-
*/
|
|
16
|
-
export function serializeUnknown(data: JSON.Value, out: Sink | null = null): Sink {
|
|
17
|
-
const type = data.type;
|
|
18
|
-
switch (type) {
|
|
19
|
-
case JSON.Types.String: {
|
|
20
|
-
return serializeString(data.get<string>(), out);
|
|
21
|
-
}
|
|
22
|
-
case JSON.Types.Boolean: {
|
|
23
|
-
return serializeBool(data.get<bool>(), out);
|
|
24
|
-
}
|
|
25
|
-
case JSON.Types.U8: {
|
|
26
|
-
return serializeInteger(data.get<u8>(), out);
|
|
27
|
-
}
|
|
28
|
-
case JSON.Types.U16: {
|
|
29
|
-
return serializeInteger(data.get<u16>(), out);
|
|
30
|
-
}
|
|
31
|
-
case JSON.Types.U32: {
|
|
32
|
-
return serializeInteger(data.get<u32>(), out);
|
|
33
|
-
}
|
|
34
|
-
case JSON.Types.U64: {
|
|
35
|
-
return serializeInteger(data.get<u64>(), out);
|
|
36
|
-
}
|
|
37
|
-
case JSON.Types.F32: {
|
|
38
|
-
return serializeFloat(data.get<f32>(), out);
|
|
39
|
-
}
|
|
40
|
-
case JSON.Types.F64: {
|
|
41
|
-
return serializeFloat(data.get<f64>(), out);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return serializeUnknownArray(data.get<JSON.Value[]>(), out);
|
|
45
|
-
|
|
46
|
-
}
|