json-as 0.9.22 → 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 +2 -0
- package/README.md +1 -1
- package/assembly/__benches__/string.bench.ts +0 -5
- package/assembly/deserialize/string.ts +0 -1
- package/assembly/serialize/bool.ts +0 -12
- package/assembly/serialize/string.ts +199 -208
- package/package.json +3 -2
- package/transform/lib/index.js +151 -160
- package/transform/package.json +1 -1
- package/transform/src/index.ts +229 -188
package/CHANGELOG
CHANGED
|
@@ -29,6 +29,8 @@ v0.9.18 - Should be able to use @alias and @omit*** or JSON.Raw
|
|
|
29
29
|
v0.9.19 - Fix arguments in @omitif declarations not working properly
|
|
30
30
|
v0.9.20 - Strings were being received with quotes attached via the toString functionality. Removed that.
|
|
31
31
|
v0.9.22 - Fix #89 and #93. Several bug fixes some severe such as ",null" being prepended when using @omit. Properly warn when a schema has fields that are not compatible with json
|
|
32
|
+
v0.9.23 - Comment out SIMD-related code for now
|
|
33
|
+
v9.9.24 - Remove transform changes from previous release
|
|
32
34
|
|
|
33
35
|
[UNRELEASED] v1.0.0
|
|
34
36
|
- Allow nullable primitives
|
package/README.md
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { bs } from "../custom/bs";
|
|
2
|
-
import { serializeBool, serializeBool_BS } from "../serialize/bool";
|
|
3
|
-
import { serialize_simd_v1, serializeString, serializeString_BS } from "../serialize/string";
|
|
4
|
-
|
|
5
|
-
const out = memory.data(65536);
|
|
6
1
|
|
|
7
2
|
bench("UTF-16 to UTF-8", () => {
|
|
8
3
|
blackbox<ArrayBuffer>(String.UTF8.encode(blackbox<string>("hello world")));
|
|
@@ -4,19 +4,7 @@
|
|
|
4
4
|
* @returns string
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { bs } from "../custom/bs";
|
|
8
|
-
|
|
9
7
|
// @ts-ignore: Decorator valid here
|
|
10
8
|
@inline export function serializeBool(data: bool): string {
|
|
11
9
|
return data ? "true" : "false";
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@inline export function serializeBool_BS(data: bool): void {
|
|
15
|
-
if (data === true) {
|
|
16
|
-
bs.write_64(28429475166421108); /* true */
|
|
17
|
-
} else {
|
|
18
|
-
//bs.write_128_n(i16x8(102, 97, 108, 115, 101, 0, 0, 0), 10);
|
|
19
|
-
bs.write_64(32370086184550502); /* fals */
|
|
20
|
-
bs.write_16(101); /* e */
|
|
21
|
-
}
|
|
22
10
|
}
|
|
@@ -1,164 +1,154 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BACK_SLASH,
|
|
3
|
-
BACKSPACE,
|
|
4
|
-
CARRIAGE_RETURN,
|
|
5
|
-
FORM_FEED,
|
|
6
|
-
NEW_LINE,
|
|
7
|
-
QUOTE,
|
|
8
|
-
TAB
|
|
9
|
-
} from "../custom/chars";
|
|
10
|
-
import { OBJECT, TOTAL_OVERHEAD } from "rt/common";
|
|
11
|
-
import { bs } from "../custom/bs";
|
|
12
1
|
import { _intTo16, intTo16, unsafeCharCodeAt } from "../custom/util";
|
|
13
2
|
import { Sink } from "../custom/sink";
|
|
14
3
|
|
|
15
|
-
function needsEscaping(data: string): bool {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// if (len < 16) {
|
|
19
|
-
// while (len--) {
|
|
20
|
-
// const char = load<u16>(changetype<usize>(data) + len);
|
|
21
|
-
// if (char == 34 || char == 92 || char <= 31) {
|
|
22
|
-
// return true;
|
|
23
|
-
// }
|
|
24
|
-
// }
|
|
25
|
-
// return false;
|
|
26
|
-
// }
|
|
4
|
+
// function needsEscaping(data: string): bool {
|
|
5
|
+
// let len = data.length;
|
|
27
6
|
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
// // if (len < 16) {
|
|
8
|
+
// // while (len--) {
|
|
9
|
+
// // const char = load<u16>(changetype<usize>(data) + len);
|
|
10
|
+
// // if (char == 34 || char == 92 || char <= 31) {
|
|
11
|
+
// // return true;
|
|
12
|
+
// // }
|
|
13
|
+
// // }
|
|
14
|
+
// // return false;
|
|
15
|
+
// // }
|
|
30
16
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
running = v128.or(running, v128.eq<i16>(w, i16x8.splat(34)));
|
|
34
|
-
running = v128.or(running, v128.eq<i16>(w, i16x8.splat(92)));
|
|
17
|
+
// let running = v128.splat<i64>(0);
|
|
18
|
+
// //let i = 0;
|
|
35
19
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
// //while (i + 15 < len) {
|
|
21
|
+
// let w = v128.load(changetype<usize>(data));
|
|
22
|
+
// running = v128.or(running, v128.eq<i16>(w, i16x8.splat(34)));
|
|
23
|
+
// running = v128.or(running, v128.eq<i16>(w, i16x8.splat(92)));
|
|
40
24
|
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
// let subtracted = v128.sub<i16>(w, i8x16.splat(31));
|
|
26
|
+
// running = v128.or(running, v128.eq<i16>(subtracted, v128.splat<i64>(0)));
|
|
27
|
+
// //i += 16;
|
|
28
|
+
// //}
|
|
43
29
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
* A faster version could perhaps look like the following:
|
|
48
|
-
*/
|
|
49
|
-
// @ts-ignore: Decorator
|
|
50
|
-
@inline export function serialize_simd_v1(src: string, dst: usize): void {
|
|
51
|
-
let src_ptr = changetype<usize>(src);
|
|
52
|
-
let dst_ptr = changetype<usize>(dst) + 2;
|
|
30
|
+
// return v128.any_true(running);
|
|
31
|
+
// }
|
|
53
32
|
|
|
54
|
-
|
|
33
|
+
// /**
|
|
34
|
+
// * A prototype SIMD implementation for string serialization which can only work in 128-byte (or 16 chars with wtf-16).
|
|
35
|
+
// *
|
|
36
|
+
// * A faster version could perhaps look like the following:
|
|
37
|
+
// */
|
|
38
|
+
// // @ts-ignore: Decorator
|
|
39
|
+
// @inline export function serialize_simd_v1(src: string, dst: usize): void {
|
|
40
|
+
// let src_ptr = changetype<usize>(src);
|
|
41
|
+
// let dst_ptr = changetype<usize>(dst) + 2;
|
|
55
42
|
|
|
56
|
-
|
|
57
|
-
const src_end_15 = src_end - 15;
|
|
43
|
+
// store<u16>(changetype<usize>(dst), 34); /* " */
|
|
58
44
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const backslash_indices = i16x8.eq(currentBlock, i16x8.splat(92));
|
|
62
|
-
const quote_indices = i16x8.eq(currentBlock, i16x8.splat(34));
|
|
63
|
-
const concat_indices = v128.or(quote_indices, backslash_indices);
|
|
45
|
+
// const src_end = src_ptr + u32(src.length << 1);
|
|
46
|
+
// const src_end_15 = src_end - 15;
|
|
64
47
|
|
|
65
|
-
|
|
48
|
+
// while (src_ptr < src_end_15) {
|
|
49
|
+
// const currentBlock = v128.load(src_ptr);
|
|
50
|
+
// const backslash_indices = i16x8.eq(currentBlock, i16x8.splat(92));
|
|
51
|
+
// const quote_indices = i16x8.eq(currentBlock, i16x8.splat(34));
|
|
52
|
+
// const concat_indices = v128.or(quote_indices, backslash_indices);
|
|
66
53
|
|
|
67
|
-
|
|
68
|
-
const mask = i16x8.bitmask(concat_indices);
|
|
54
|
+
// const escape_indices = i16x8.lt_u(currentBlock, i16x8.splat(32));
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (anomalies === 1) {
|
|
73
|
-
memory.copy(dst_ptr, src_ptr, start_index >> 1);
|
|
74
|
-
store<u16>(dst_ptr + start_index, 34);
|
|
75
|
-
memory.copy(dst_ptr + start_index + 2, src_ptr + start_index, (32 - start_index) >> 1)
|
|
76
|
-
}
|
|
56
|
+
// if (v128.any_true(v128.or(escape_indices, concat_indices))) {
|
|
57
|
+
// const mask = i16x8.bitmask(concat_indices);
|
|
77
58
|
|
|
78
|
-
|
|
59
|
+
// const anomalies = popcnt(mask);
|
|
60
|
+
// const start_index = (clz(mask) & ~1) + 2 // This essentially floors to the nearest even integer
|
|
61
|
+
// if (anomalies === 1) {
|
|
62
|
+
// memory.copy(dst_ptr, src_ptr, start_index >> 1);
|
|
63
|
+
// store<u16>(dst_ptr + start_index, 34);
|
|
64
|
+
// memory.copy(dst_ptr + start_index + 2, src_ptr + start_index, (32 - start_index) >> 1)
|
|
65
|
+
// }
|
|
79
66
|
|
|
80
|
-
|
|
81
|
-
dst_ptr += 16;
|
|
82
|
-
src_ptr += 16;
|
|
83
|
-
} else {
|
|
84
|
-
v128.store(dst_ptr, currentBlock);
|
|
85
|
-
src_ptr += 16;
|
|
86
|
-
dst_ptr += 16;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
67
|
+
// if (v128.any_true(escape_indices)) {
|
|
90
68
|
|
|
91
|
-
|
|
92
|
-
|
|
69
|
+
// }
|
|
70
|
+
// dst_ptr += 16;
|
|
71
|
+
// src_ptr += 16;
|
|
72
|
+
// } else {
|
|
73
|
+
// v128.store(dst_ptr, currentBlock);
|
|
74
|
+
// src_ptr += 16;
|
|
75
|
+
// dst_ptr += 16;
|
|
76
|
+
// }
|
|
77
|
+
// }
|
|
78
|
+
// }
|
|
93
79
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
80
|
+
|
|
81
|
+
// const back_slash_reg = i16x8.splat(92); // "\"
|
|
82
|
+
// const quote_reg = i16x8.splat(34); // "\""
|
|
83
|
+
|
|
84
|
+
// // @ts-ignore: Decorator
|
|
85
|
+
// @inline export function serialize_simd_v2(src: string, dst: usize): void {
|
|
86
|
+
// let src_ptr = changetype<usize>(src);
|
|
87
|
+
// let dst_ptr = changetype<usize>(dst);
|
|
88
|
+
|
|
89
|
+
// let i = 0;
|
|
90
|
+
// const len = src.length;
|
|
91
|
+
|
|
92
|
+
// while (i < len) {
|
|
93
|
+
// const block = v128.load16x4_u(src_ptr);
|
|
94
|
+
// console.log("block: " + prt(block));
|
|
95
|
+
// const backslash_mask = i16x8.eq(block, back_slash_reg);
|
|
96
|
+
// const quote_mask = i16x8.eq(block, quote_reg);
|
|
97
|
+
// const is_quote_or_backslash = v128.or(quote_mask, backslash_mask);
|
|
98
|
+
// console.log("mask: " + prt10(is_quote_or_backslash))
|
|
109
99
|
|
|
110
100
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
101
|
+
// // store<v128>(dst_ptr, expanded);
|
|
102
|
+
// src_ptr += 8;
|
|
103
|
+
// dst_ptr += 16;
|
|
104
|
+
// i += 8;
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
117
107
|
|
|
118
|
-
function prt(obj: v128): string {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
108
|
+
// function prt(obj: v128): string {
|
|
109
|
+
// let out = "";
|
|
110
|
+
// out += i16x8.extract_lane_u(obj, 0).toString() + " ";
|
|
111
|
+
// out += i16x8.extract_lane_u(obj, 1).toString() + " ";
|
|
112
|
+
// out += i16x8.extract_lane_u(obj, 2).toString() + " ";
|
|
113
|
+
// out += i16x8.extract_lane_u(obj, 3).toString() + " ";
|
|
114
|
+
// out += i16x8.extract_lane_u(obj, 4).toString() + " ";
|
|
115
|
+
// out += i16x8.extract_lane_u(obj, 5).toString() + " ";
|
|
116
|
+
// out += i16x8.extract_lane_u(obj, 6).toString() + " ";
|
|
117
|
+
// out += i16x8.extract_lane_u(obj, 7).toString();
|
|
118
|
+
// return out;
|
|
119
|
+
// }
|
|
130
120
|
|
|
131
|
-
function prt10(obj: v128): string {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
121
|
+
// function prt10(obj: v128): string {
|
|
122
|
+
// let out = "";
|
|
123
|
+
// out += (i16x8.extract_lane_u(obj, 0) ? "1" : "0") + " ";
|
|
124
|
+
// out += (i16x8.extract_lane_u(obj, 1) ? "1" : "0") + " ";
|
|
125
|
+
// out += (i16x8.extract_lane_u(obj, 2) ? "1" : "0") + " ";
|
|
126
|
+
// out += (i16x8.extract_lane_u(obj, 3) ? "1" : "0") + " ";
|
|
127
|
+
// out += (i16x8.extract_lane_u(obj, 4) ? "1" : "0") + " ";
|
|
128
|
+
// out += (i16x8.extract_lane_u(obj, 5) ? "1" : "0") + " ";
|
|
129
|
+
// out += (i16x8.extract_lane_u(obj, 6) ? "1" : "0") + " ";
|
|
130
|
+
// out += i16x8.extract_lane_u(obj, 7) ? "1" : "0";
|
|
131
|
+
// return out;
|
|
132
|
+
// }
|
|
143
133
|
|
|
144
|
-
function vis(src_ptr: usize, mask: i32): void {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
134
|
+
// function vis(src_ptr: usize, mask: i32): void {
|
|
135
|
+
// let chars = "";
|
|
136
|
+
// let bits = "";
|
|
137
|
+
// for (let i = 0; i < 8; i++) {
|
|
138
|
+
// const char = load<u16>(src_ptr + (i << 1));
|
|
139
|
+
// const bit = (mask >> i) & 1;
|
|
140
|
+
// chars += String.fromCharCode(char) + " ";
|
|
141
|
+
// bits += bit.toString() + " ";
|
|
142
|
+
// }
|
|
143
|
+
// console.log(chars);
|
|
144
|
+
// console.log(bits);
|
|
145
|
+
// }
|
|
156
146
|
|
|
157
147
|
// @ts-ignore: Decorator
|
|
158
148
|
@inline export function serializeString(data: string): string {
|
|
159
|
-
if (!needsEscaping(data)) {
|
|
160
|
-
|
|
161
|
-
}
|
|
149
|
+
// if (!needsEscaping(data)) {
|
|
150
|
+
// return "\"" + data + "\"";
|
|
151
|
+
// }
|
|
162
152
|
|
|
163
153
|
if (data.length === 0) {
|
|
164
154
|
return "\"\"";
|
|
@@ -217,80 +207,81 @@ function vis(src_ptr: usize, mask: i32): void {
|
|
|
217
207
|
result.writeCodePoint(34);
|
|
218
208
|
return result.toString();
|
|
219
209
|
}
|
|
220
|
-
// @ts-ignore: Decorator valid here
|
|
221
|
-
@inline export function serializeString_BS(data: string): void {
|
|
222
|
-
const len = data.length << 1;
|
|
223
|
-
if (len === 0) {
|
|
224
|
-
bs.write_32(2228258); /* "" */
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
210
|
|
|
228
|
-
|
|
211
|
+
// // @ts-ignore: Decorator valid here
|
|
212
|
+
// @inline export function serializeString_BS(data: string): void {
|
|
213
|
+
// const len = data.length << 1;
|
|
214
|
+
// if (len === 0) {
|
|
215
|
+
// bs.write_32(2228258); /* "" */
|
|
216
|
+
// return;
|
|
217
|
+
// }
|
|
229
218
|
|
|
219
|
+
// bs.write_16(QUOTE);
|
|
230
220
|
|
|
231
|
-
let last: i32 = 0;
|
|
232
|
-
for (let i = 0; i < len; i += 2) {
|
|
233
|
-
const char = load<u16>(changetype<usize>(data) + i);
|
|
234
|
-
if (char < 35) {
|
|
235
|
-
if (char === QUOTE) {
|
|
236
|
-
bs.write_s_se(<string>data, last, i);
|
|
237
|
-
bs.write_16(BACK_SLASH);
|
|
238
|
-
last = i;
|
|
239
|
-
continue;
|
|
240
|
-
} else if (char < 32) {
|
|
241
|
-
if (char < 16) {
|
|
242
|
-
bs.write_s_se(<string>data, last, i);
|
|
243
|
-
last = i + 2;
|
|
244
|
-
switch (char) {
|
|
245
|
-
case BACKSPACE: {
|
|
246
|
-
bs.write_32(6422620);
|
|
247
|
-
continue;
|
|
248
|
-
}
|
|
249
|
-
case TAB: {
|
|
250
|
-
bs.write_32(7602268);
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
case NEW_LINE: {
|
|
254
|
-
bs.write_32(7209052);
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
case FORM_FEED: {
|
|
258
|
-
bs.write_32(6684764);
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
case CARRIAGE_RETURN: {
|
|
262
|
-
bs.write_32(7471196);
|
|
263
|
-
continue;
|
|
264
|
-
}
|
|
265
|
-
default: {
|
|
266
|
-
// all chars 0-31 must be encoded as a four digit unicode escape sequence
|
|
267
|
-
// \u0000 to \u000f handled here
|
|
268
|
-
bs.write_64(13511005048209500) /* \\u00 */
|
|
269
|
-
bs.write_32((_intTo16(char) << 16) | 48); /* 0_ */
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
} else {
|
|
274
|
-
bs.write_s_se(<string>data, last, i);
|
|
275
|
-
last = i + 2;
|
|
276
|
-
// all chars 0-31 must be encoded as a four digit unicode escape sequence
|
|
277
|
-
// \u0010 to \u001f handled here
|
|
278
|
-
bs.write_64(13511005048209500) /* \\u00 */
|
|
279
|
-
bs.write_32((intTo16(char) << 16) | 48); /* 0_ */
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
} else if (char === BACK_SLASH) {
|
|
283
|
-
bs.write_s_se(<string>data, last, i);
|
|
284
|
-
bs.write_16(BACK_SLASH);
|
|
285
|
-
last = i;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
221
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
222
|
+
// let last: i32 = 0;
|
|
223
|
+
// for (let i = 0; i < len; i += 2) {
|
|
224
|
+
// const char = load<u16>(changetype<usize>(data) + i);
|
|
225
|
+
// if (char < 35) {
|
|
226
|
+
// if (char === QUOTE) {
|
|
227
|
+
// bs.write_s_se(<string>data, last, i);
|
|
228
|
+
// bs.write_16(BACK_SLASH);
|
|
229
|
+
// last = i;
|
|
230
|
+
// continue;
|
|
231
|
+
// } else if (char < 32) {
|
|
232
|
+
// if (char < 16) {
|
|
233
|
+
// bs.write_s_se(<string>data, last, i);
|
|
234
|
+
// last = i + 2;
|
|
235
|
+
// switch (char) {
|
|
236
|
+
// case BACKSPACE: {
|
|
237
|
+
// bs.write_32(6422620);
|
|
238
|
+
// continue;
|
|
239
|
+
// }
|
|
240
|
+
// case TAB: {
|
|
241
|
+
// bs.write_32(7602268);
|
|
242
|
+
// continue;
|
|
243
|
+
// }
|
|
244
|
+
// case NEW_LINE: {
|
|
245
|
+
// bs.write_32(7209052);
|
|
246
|
+
// continue;
|
|
247
|
+
// }
|
|
248
|
+
// case FORM_FEED: {
|
|
249
|
+
// bs.write_32(6684764);
|
|
250
|
+
// continue;
|
|
251
|
+
// }
|
|
252
|
+
// case CARRIAGE_RETURN: {
|
|
253
|
+
// bs.write_32(7471196);
|
|
254
|
+
// continue;
|
|
255
|
+
// }
|
|
256
|
+
// default: {
|
|
257
|
+
// // all chars 0-31 must be encoded as a four digit unicode escape sequence
|
|
258
|
+
// // \u0000 to \u000f handled here
|
|
259
|
+
// bs.write_64(13511005048209500) /* \\u00 */
|
|
260
|
+
// bs.write_32((_intTo16(char) << 16) | 48); /* 0_ */
|
|
261
|
+
// continue;
|
|
262
|
+
// }
|
|
263
|
+
// }
|
|
264
|
+
// } else {
|
|
265
|
+
// bs.write_s_se(<string>data, last, i);
|
|
266
|
+
// last = i + 2;
|
|
267
|
+
// // all chars 0-31 must be encoded as a four digit unicode escape sequence
|
|
268
|
+
// // \u0010 to \u001f handled here
|
|
269
|
+
// bs.write_64(13511005048209500) /* \\u00 */
|
|
270
|
+
// bs.write_32((intTo16(char) << 16) | 48); /* 0_ */
|
|
271
|
+
// }
|
|
272
|
+
// }
|
|
273
|
+
// } else if (char === BACK_SLASH) {
|
|
274
|
+
// bs.write_s_se(<string>data, last, i);
|
|
275
|
+
// bs.write_16(BACK_SLASH);
|
|
276
|
+
// last = i;
|
|
277
|
+
// }
|
|
278
|
+
// }
|
|
279
|
+
|
|
280
|
+
// if (last === 0) {
|
|
281
|
+
// bs.write_s(data);
|
|
282
|
+
// bs.write_16(QUOTE)
|
|
283
|
+
// } else {
|
|
284
|
+
// bs.write_s_se(<string>data, last, changetype<OBJECT>(changetype<usize>(data) - TOTAL_OVERHEAD).rtSize);
|
|
285
|
+
// bs.write_16(QUOTE);
|
|
286
|
+
// }
|
|
287
|
+
// }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-as",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.24",
|
|
4
4
|
"description": "The only JSON library you'll need for AssemblyScript. SIMD enabled",
|
|
5
5
|
"types": "assembly/index.ts",
|
|
6
6
|
"author": "Jairus Tanaka",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "ast test && rm -rf ./build/",
|
|
20
20
|
"pretest": "rm -rf ./build/ && ast build",
|
|
21
21
|
"bench": "astral --enable simd --runtime stub",
|
|
22
|
-
"build:test": "rm -rf ./build/ && asc assembly/test.ts --transform ./transform -o ./build/test.wasm
|
|
22
|
+
"build:test": "rm -rf ./build/ && asc assembly/test.ts --transform ./transform -o ./build/test.wasm",
|
|
23
23
|
"build:transform": "tsc -p ./transform",
|
|
24
24
|
"test:wasmtime": "wasmtime ./build/test.wasm",
|
|
25
25
|
"test:wavm": "wavm run ./build/test.wasm",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"visitor-as": "^0.11.4"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@hypermode/modus-sdk-as": "^0.13.0-prerelease-test-1",
|
|
47
48
|
"as-virtual": "^0.2.0",
|
|
48
49
|
"chalk": "^5.3.0"
|
|
49
50
|
},
|