json-as 1.1.2 → 1.1.4

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.
@@ -11,7 +11,9 @@ jobs:
11
11
  uses: actions/checkout@v4
12
12
 
13
13
  - name: Install Wasmtime
14
- uses: jcbhmr/setup-wasmtime@v2
14
+ run: |
15
+ curl https://wasmtime.dev/install.sh -sSf | bash
16
+ echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
15
17
 
16
18
  - name: Setup Bun
17
19
  uses: oven-sh/setup-bun@v1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 2-25-05-23 - 1.1.4
4
+
5
+ - revert: grouping properties in favor of memory.compare
6
+
7
+ ## 2025-05-23 - 1.1.3
8
+
9
+ - feat: group properties of structs before code generation
10
+ - fix: break out of switch case after completion
11
+ - ci: make compatible with act for local testing
12
+
3
13
  ## 2025-05-22 - 1.1.2
4
14
 
5
15
  - fix: correct small typos in string value deserialization port
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
7
7
  █████ ███████ ██████ ██ ████ ██ ██ ███████
8
8
  </span>
9
- AssemblyScript - v1.1.2
9
+ AssemblyScript - v1.1.4
10
10
  </pre>
11
11
  </h6>
12
12
 
@@ -1,96 +1,96 @@
1
1
  import { JSON } from "..";
2
2
  import { describe, expect } from "./lib";
3
3
 
4
- describe("Should serialize integer arrays", () => {
5
- expect(JSON.stringify<u32[]>([0, 100, 101])).toBe("[0,100,101]");
6
-
7
- expect(JSON.stringify<u64[]>([0, 100, 101])).toBe("[0,100,101]");
8
-
9
- expect(JSON.stringify<i32[]>([0, 100, 101, -100, -101])).toBe("[0,100,101,-100,-101]");
10
-
11
- expect(JSON.stringify<i64[]>([0, 100, 101, -100, -101])).toBe("[0,100,101,-100,-101]");
12
- });
13
-
14
- describe("Should serialize float arrays", () => {
15
- expect(JSON.stringify<f64[]>([7.23, 10e2, 10e2, 123456e-5, 123456e-5, 0.0, 7.23])).toBe("[7.23,1000.0,1000.0,1.23456,1.23456,0.0,7.23]");
16
-
17
- expect(JSON.stringify<f64[]>([1e21, 1e22, 1e-7, 1e-8, 1e-9])).toBe("[1e+21,1e+22,1e-7,1e-8,1e-9]");
18
- });
19
-
20
- describe("Should serialize boolean arrays", () => {
21
- expect(JSON.stringify<bool[]>([true, false])).toBe("[true,false]");
22
-
23
- expect(JSON.stringify<boolean[]>([true, false])).toBe("[true,false]");
24
- });
25
-
26
- describe("Should serialize string arrays", () => {
27
- expect(JSON.stringify<string[]>(['string "with random spa\nces and \nnewlines\n\n\n'])).toBe('["string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"]');
28
- });
29
-
30
- describe("Should serialize nested integer arrays", () => {
31
- expect(JSON.stringify<i64[][]>([[100, 101], [-100, -101], [0]])).toBe("[[100,101],[-100,-101],[0]]");
32
- });
33
-
34
- describe("Should serialize nested float arrays", () => {
35
- expect(JSON.stringify<f64[][]>([[7.23], [10e2], [10e2], [123456e-5], [123456e-5], [0.0], [7.23]])).toBe("[[7.23],[1000.0],[1000.0],[1.23456],[1.23456],[0.0],[7.23]]");
36
- });
37
-
38
- describe("Should serialize nested boolean arrays", () => {
39
- expect(JSON.stringify<bool[][]>([[true], [false]])).toBe("[[true],[false]]");
40
-
41
- expect(JSON.stringify<boolean[][]>([[true], [false]])).toBe("[[true],[false]]");
42
- });
43
-
44
- describe("Should serialize object arrays", () => {
45
- expect(
46
- JSON.stringify<Vec3[]>([
47
- {
48
- x: 3.4,
49
- y: 1.2,
50
- z: 8.3,
51
- },
52
- {
53
- x: 3.4,
54
- y: -2.1,
55
- z: 9.3,
56
- },
57
- ]),
58
- ).toBe('[{"x":3.4,"y":1.2,"z":8.3},{"x":3.4,"y":-2.1,"z":9.3}]');
59
- });
60
-
61
- describe("Should deserialize integer arrays", () => {
62
- expect(JSON.stringify(JSON.parse<u32[]>("[0,100,101]"))).toBe("[0,100,101]");
63
- expect(JSON.stringify(JSON.parse<u64[]>("[0,100,101]"))).toBe("[0,100,101]");
64
- expect(JSON.stringify(JSON.parse<i32[]>("[0,100,101,-100,-101]"))).toBe("[0,100,101,-100,-101]");
65
- expect(JSON.stringify(JSON.parse<i64[]>("[0,100,101,-100,-101]"))).toBe("[0,100,101,-100,-101]");
66
- });
67
-
68
- describe("Should deserialize float arrays", () => {
69
- expect(JSON.stringify(JSON.parse<f64[]>("[7.23,1000.0,1000.0,1.23456,1.23456,0.0,7.23]"))).toBe("[7.23,1000.0,1000.0,1.23456,1.23456,0.0,7.23]");
70
- expect(JSON.stringify(JSON.parse<f64[]>("[1e+21,1e+22,1e-7,1e-8,1e-9]"))).toBe("[1e+21,1e+22,1e-7,1e-8,1e-9]");
71
- });
72
-
73
- describe("Should deserialize boolean arrays", () => {
74
- expect(JSON.stringify(JSON.parse<bool[]>("[true,false]"))).toBe("[true,false]");
75
- expect(JSON.stringify(JSON.parse<boolean[]>("[true,false]"))).toBe("[true,false]");
76
- });
77
-
78
- describe("Should deserialize string arrays", () => {
79
- expect(JSON.stringify(JSON.parse<string[]>('["string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"]'))).toBe('["string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"]');
80
- });
81
-
82
- describe("Should deserialize nested integer arrays", () => {
83
- expect(JSON.stringify(JSON.parse<i64[][]>("[[100,101],[-100,-101],[0]]"))).toBe("[[100,101],[-100,-101],[0]]");
84
- });
85
-
86
- describe("Should deserialize nested float arrays", () => {
87
- expect(JSON.stringify(JSON.parse<f64[][]>("[[7.23],[1000.0],[1000.0],[1.23456],[1.23456],[0.0],[7.23]]"))).toBe("[[7.23],[1000.0],[1000.0],[1.23456],[1.23456],[0.0],[7.23]]");
88
- });
89
-
90
- describe("Should deserialize nested boolean arrays", () => {
91
- expect(JSON.stringify(JSON.parse<bool[][]>("[[true],[false]]"))).toBe("[[true],[false]]");
92
- expect(JSON.stringify(JSON.parse<boolean[][]>("[[true],[false]]"))).toBe("[[true],[false]]");
93
- });
4
+ // describe("Should serialize integer arrays", () => {
5
+ // expect(JSON.stringify<u32[]>([0, 100, 101])).toBe("[0,100,101]");
6
+
7
+ // expect(JSON.stringify<u64[]>([0, 100, 101])).toBe("[0,100,101]");
8
+
9
+ // expect(JSON.stringify<i32[]>([0, 100, 101, -100, -101])).toBe("[0,100,101,-100,-101]");
10
+
11
+ // expect(JSON.stringify<i64[]>([0, 100, 101, -100, -101])).toBe("[0,100,101,-100,-101]");
12
+ // });
13
+
14
+ // describe("Should serialize float arrays", () => {
15
+ // expect(JSON.stringify<f64[]>([7.23, 10e2, 10e2, 123456e-5, 123456e-5, 0.0, 7.23])).toBe("[7.23,1000.0,1000.0,1.23456,1.23456,0.0,7.23]");
16
+
17
+ // expect(JSON.stringify<f64[]>([1e21, 1e22, 1e-7, 1e-8, 1e-9])).toBe("[1e+21,1e+22,1e-7,1e-8,1e-9]");
18
+ // });
19
+
20
+ // describe("Should serialize boolean arrays", () => {
21
+ // expect(JSON.stringify<bool[]>([true, false])).toBe("[true,false]");
22
+
23
+ // expect(JSON.stringify<boolean[]>([true, false])).toBe("[true,false]");
24
+ // });
25
+
26
+ // describe("Should serialize string arrays", () => {
27
+ // expect(JSON.stringify<string[]>(['string "with random spa\nces and \nnewlines\n\n\n'])).toBe('["string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"]');
28
+ // });
29
+
30
+ // describe("Should serialize nested integer arrays", () => {
31
+ // expect(JSON.stringify<i64[][]>([[100, 101], [-100, -101], [0]])).toBe("[[100,101],[-100,-101],[0]]");
32
+ // });
33
+
34
+ // describe("Should serialize nested float arrays", () => {
35
+ // expect(JSON.stringify<f64[][]>([[7.23], [10e2], [10e2], [123456e-5], [123456e-5], [0.0], [7.23]])).toBe("[[7.23],[1000.0],[1000.0],[1.23456],[1.23456],[0.0],[7.23]]");
36
+ // });
37
+
38
+ // describe("Should serialize nested boolean arrays", () => {
39
+ // expect(JSON.stringify<bool[][]>([[true], [false]])).toBe("[[true],[false]]");
40
+
41
+ // expect(JSON.stringify<boolean[][]>([[true], [false]])).toBe("[[true],[false]]");
42
+ // });
43
+
44
+ // describe("Should serialize object arrays", () => {
45
+ // expect(
46
+ // JSON.stringify<Vec3[]>([
47
+ // {
48
+ // x: 3.4,
49
+ // y: 1.2,
50
+ // z: 8.3,
51
+ // },
52
+ // {
53
+ // x: 3.4,
54
+ // y: -2.1,
55
+ // z: 9.3,
56
+ // },
57
+ // ]),
58
+ // ).toBe('[{"x":3.4,"y":1.2,"z":8.3},{"x":3.4,"y":-2.1,"z":9.3}]');
59
+ // });
60
+
61
+ // describe("Should deserialize integer arrays", () => {
62
+ // expect(JSON.stringify(JSON.parse<u32[]>("[0,100,101]"))).toBe("[0,100,101]");
63
+ // expect(JSON.stringify(JSON.parse<u64[]>("[0,100,101]"))).toBe("[0,100,101]");
64
+ // expect(JSON.stringify(JSON.parse<i32[]>("[0,100,101,-100,-101]"))).toBe("[0,100,101,-100,-101]");
65
+ // expect(JSON.stringify(JSON.parse<i64[]>("[0,100,101,-100,-101]"))).toBe("[0,100,101,-100,-101]");
66
+ // });
67
+
68
+ // describe("Should deserialize float arrays", () => {
69
+ // expect(JSON.stringify(JSON.parse<f64[]>("[7.23,1000.0,1000.0,1.23456,1.23456,0.0,7.23]"))).toBe("[7.23,1000.0,1000.0,1.23456,1.23456,0.0,7.23]");
70
+ // expect(JSON.stringify(JSON.parse<f64[]>("[1e+21,1e+22,1e-7,1e-8,1e-9]"))).toBe("[1e+21,1e+22,1e-7,1e-8,1e-9]");
71
+ // });
72
+
73
+ // describe("Should deserialize boolean arrays", () => {
74
+ // expect(JSON.stringify(JSON.parse<bool[]>("[true,false]"))).toBe("[true,false]");
75
+ // expect(JSON.stringify(JSON.parse<boolean[]>("[true,false]"))).toBe("[true,false]");
76
+ // });
77
+
78
+ // describe("Should deserialize string arrays", () => {
79
+ // expect(JSON.stringify(JSON.parse<string[]>('["string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"]'))).toBe('["string \\"with random spa\\nces and \\nnewlines\\n\\n\\n"]');
80
+ // });
81
+
82
+ // describe("Should deserialize nested integer arrays", () => {
83
+ // expect(JSON.stringify(JSON.parse<i64[][]>("[[100,101],[-100,-101],[0]]"))).toBe("[[100,101],[-100,-101],[0]]");
84
+ // });
85
+
86
+ // describe("Should deserialize nested float arrays", () => {
87
+ // expect(JSON.stringify(JSON.parse<f64[][]>("[[7.23],[1000.0],[1000.0],[1.23456],[1.23456],[0.0],[7.23]]"))).toBe("[[7.23],[1000.0],[1000.0],[1.23456],[1.23456],[0.0],[7.23]]");
88
+ // });
89
+
90
+ // describe("Should deserialize nested boolean arrays", () => {
91
+ // expect(JSON.stringify(JSON.parse<bool[][]>("[[true],[false]]"))).toBe("[[true],[false]]");
92
+ // expect(JSON.stringify(JSON.parse<boolean[][]>("[[true],[false]]"))).toBe("[[true],[false]]");
93
+ // });
94
94
 
95
95
  describe("Should deserialize object arrays", () => {
96
96
  expect(JSON.stringify(JSON.parse<Vec3[]>('[{"x":3.4,"y":1.2,"z":8.3},{"x":3.4,"y":-2.1,"z":9.3}]'))).toBe('[{"x":3.4,"y":1.2,"z":8.3},{"x":3.4,"y":-2.1,"z":9.3}]');
@@ -102,4 +102,70 @@ class Vec3 {
102
102
  x: f64 = 0.0;
103
103
  y: f64 = 0.0;
104
104
  z: f64 = 0.0;
105
+ __DESERIALIZE<__JSON_T>(srcStart: usize, srcEnd: usize, out: __JSON_T): __JSON_T {
106
+ let keyStart: usize = 0;
107
+ let keyEnd: usize = 0;
108
+ let isKey = false;
109
+ let lastIndex: usize = 0;
110
+
111
+ while (srcStart < srcEnd && JSON.Util.isSpace(load<u16>(srcStart))) srcStart += 2;
112
+ while (srcEnd > srcStart && JSON.Util.isSpace(load<u16>(srcEnd - 2))) srcEnd -= 2;
113
+ if (srcStart - srcEnd == 0) throw new Error("Input string had zero length or was all whitespace");
114
+ if (load<u16>(srcStart) != 123) throw new Error("Expected '{' at start of object at position " + (srcEnd - srcStart).toString());
115
+ if (load<u16>(srcEnd - 2) != 125) throw new Error("Expected '}' at end of object at position " + (srcEnd - srcStart).toString());
116
+ srcStart += 2;
117
+
118
+ while (srcStart < srcEnd) {
119
+ let code = load<u16>(srcStart);
120
+ while (JSON.Util.isSpace(code)) code = load<u16>(srcStart += 2);
121
+ if (keyStart == 0) {
122
+ if (code == 34 && load<u16>(srcStart - 2) !== 92) {
123
+ if (isKey) {
124
+ keyStart = lastIndex;
125
+ keyEnd = srcStart;
126
+ while (JSON.Util.isSpace((code = load<u16>((srcStart += 2))))) { }
127
+ if (code !== 58) throw new Error("Expected ':' after key at position " + (srcEnd - srcStart).toString());
128
+ isKey = false;
129
+ } else {
130
+ isKey = true;
131
+ lastIndex = srcStart + 2;
132
+ }
133
+ }
134
+ srcStart += 2;
135
+ } else {
136
+ if (code - 48 <= 9 || code == 45) {
137
+ lastIndex = srcStart;
138
+ srcStart += 2;
139
+ while (srcStart < srcEnd) {
140
+ const code = load<u16>(srcStart);
141
+ if (code == 44 || code == 125 || JSON.Util.isSpace(code)) {
142
+ switch (<u32>keyEnd - <u32>keyStart) {
143
+ case 2: {
144
+ const code16 = load<u16>(keyStart);
145
+ if (code16 == 120) { // x
146
+ store<f64>(changetype<usize>(out), JSON.__deserialize<f64>(lastIndex, srcStart), offsetof<this>("x"));
147
+ keyStart = 0;
148
+ break;
149
+ } else if (code16 == 121) { // y
150
+ store<f64>(changetype<usize>(out), JSON.__deserialize<f64>(lastIndex, srcStart), offsetof<this>("y"));
151
+ keyStart = 0;
152
+ break;
153
+ } else if (code16 == 122) { // z
154
+ store<f64>(changetype<usize>(out), JSON.__deserialize<f64>(lastIndex, srcStart), offsetof<this>("z"));
155
+ keyStart = 0;
156
+ break;
157
+ }
158
+ }
159
+ }
160
+ break;
161
+ }
162
+ srcStart += 2;
163
+ }
164
+ } else {
165
+ srcStart += 2;
166
+ }
167
+ }
168
+ }
169
+ return out;
170
+ }
105
171
  }
@@ -0,0 +1,149 @@
1
+ // misc.spec.ts
2
+
3
+ import { JSON } from "..";
4
+ import { describe, expect } from "./lib";
5
+
6
+ @json
7
+ class Obj {
8
+ a: string = "hello";
9
+ b: string = "world";
10
+ c: string = '"\t\f\u0000\u0001';
11
+ }
12
+
13
+ @json
14
+ class Vec3 {
15
+ x: f32 = 0.0;
16
+ y: f32 = 0.0;
17
+ z: f32 = 0.0;
18
+ }
19
+
20
+ @json
21
+ class Player {
22
+ @alias("first name")
23
+ firstName!: string;
24
+ lastName!: string;
25
+ lastActive!: i32[];
26
+ @omitif((self: Player) => self.age < 18)
27
+ age!: i32;
28
+ @omitnull()
29
+ pos!: Vec3 | null;
30
+ isVerified!: boolean;
31
+ }
32
+
33
+ @json class Point {}
34
+
35
+ @json
36
+ class NewPoint {
37
+ x: f64 = 0.0;
38
+ y: f64 = 0.0;
39
+
40
+ constructor(x: f64, y: f64) {
41
+ this.x = x;
42
+ this.y = y;
43
+ }
44
+
45
+ @serializer
46
+ serializer(self: NewPoint): string {
47
+ return `x=${self.x},y=${self.y}`;
48
+ }
49
+
50
+ @deserializer
51
+ deserializer(data: string): NewPoint {
52
+ const c = data.indexOf(",");
53
+ const x = data.slice(2, c);
54
+ const y = data.slice(c + 3);
55
+ return new NewPoint(f64.parse(x), f64.parse(y));
56
+ }
57
+ }
58
+
59
+ @json class InnerObj<T> { obj: T = instantiate<T>(); }
60
+ @json class ObjWithBracketString { data: string = ""; }
61
+
62
+ @json
63
+ class Foo {
64
+ id: string = "";
65
+ firstName: string = "";
66
+ lastName: string = "";
67
+ }
68
+
69
+ @json
70
+ class SrvInfo {
71
+ accessUrl: string = "https://example.com";
72
+ cardTypes: i32[] = [1, 2, 3];
73
+ customService: string = "Contact us at support@example.com";
74
+ invoiceApplicationStatus: i32 = 1;
75
+ isCertification: bool = true;
76
+ isOnlineRecharge: bool = false;
77
+ loginTypes: i32[] = [0, 1];
78
+ record: string = "ICP 12345678";
79
+ regCompanyAudit: i32 = 2;
80
+ regCompanyPipeline: i32[] = [101, 102, 103];
81
+ regPwdLimit: i32 = 8;
82
+ serverTime: i64 = 1650000000000;
83
+ srvDescription: string = "A demo service for handling customer operations.";
84
+ srvHiddenMenu: string[] = ["admin", "beta"];
85
+ srvHost: string = "srv.example.com";
86
+ srvId: i32 = 999;
87
+ srvKeywords: string[] = ["finance", "payments", "online"];
88
+ srvLogoImgUrl: string = "https://example.com/logo.png";
89
+ srvName: string = "ExampleService";
90
+ srvPageId: i32 = 5;
91
+ thirdAuthUrl: string = "https://auth.example.com";
92
+ userCenterStyle: i32 = 1;
93
+ }
94
+
95
+ describe("Basic JSON.stringify behavior", () => {
96
+ expect(JSON.stringify(new Obj())).toBe('{"a":"hello","b":"world","c":"\\"\\t\\f\\u0000\\u0001"}');
97
+
98
+ const player: Player = {
99
+ firstName: "Jairus",
100
+ lastName: "Tanaka",
101
+ lastActive: [2, 7, 2025],
102
+ age: 18,
103
+ pos: { x: 3.4, y: 1.2, z: 8.3 },
104
+ isVerified: true,
105
+ };
106
+
107
+ expect(JSON.stringify(player)).toBe(
108
+ '{"age":18,"pos":{"x":3.4,"y":1.2,"z":8.3},"first name":"Jairus","lastName":"Tanaka","lastActive":[2,7,2025],"isVerified":true}'
109
+ );
110
+
111
+ const raw = JSON.Raw.from('"hello world"');
112
+ expect(JSON.stringify<JSON.Raw>(raw)).toBe('"hello world"');
113
+
114
+ const emptyObj = new JSON.Obj();
115
+ expect(JSON.stringify(emptyObj)).toBe("{}");
116
+
117
+ emptyObj.set("x", 1.5);
118
+ emptyObj.set("y", 5.4);
119
+ emptyObj.set("z", 9.8);
120
+ expect(JSON.stringify(emptyObj)).toBe('{"x":1.5,"y":5.4,"z":9.8}');
121
+ });
122
+
123
+ describe("Parse and stringify combinations", () => {
124
+ const input = '{"x":3.4,"y":1.2,"z":8.3}';
125
+ const parsed = JSON.parse<JSON.Obj>(input);
126
+ expect(JSON.stringify(parsed)).toBe(input);
127
+
128
+ const strange = JSON.parse<InnerObj<ObjWithBracketString>>('{"obj":{"data":"hello} world"}}');
129
+ expect(JSON.stringify(strange)).toBe('{"obj":{"data":"hello} world"}}');
130
+
131
+ const point = new Point();
132
+ expect(JSON.stringify(point)).toBe('{}');
133
+ expect(JSON.stringify(JSON.parse<Point>(JSON.stringify(point)))).toBe('{}');
134
+
135
+ const np = new NewPoint(1.0, 2.0);
136
+ const ser = JSON.stringify(np);
137
+ expect(ser).toBe('x=1.0,y=2.0');
138
+ expect(JSON.stringify(JSON.parse<NewPoint>(ser))).toBe('x=1.0,y=2.0');
139
+ });
140
+
141
+ describe("SrvInfo consistency", () => {
142
+ const srv = new SrvInfo();
143
+ const serialized = JSON.stringify(srv);
144
+ const expected = '{"accessUrl":"https://example.com","cardTypes":[1,2,3],"customService":"Contact us at support@example.com","invoiceApplicationStatus":1,"isCertification":true,"isOnlineRecharge":false,"loginTypes":[0,1],"record":"ICP 12345678","regCompanyAudit":2,"regCompanyPipeline":[101,102,103],"regPwdLimit":8,"serverTime":1650000000000,"srvDescription":"A demo service for handling customer operations.","srvHiddenMenu":["admin","beta"],"srvHost":"srv.example.com","srvId":999,"srvKeywords":["finance","payments","online"],"srvLogoImgUrl":"https://example.com/logo.png","srvName":"ExampleService","srvPageId":5,"thirdAuthUrl":"https://auth.example.com","userCenterStyle":1}';
145
+
146
+ expect(serialized).toBe(expected);
147
+ const parsed = JSON.parse<SrvInfo>(serialized);
148
+ expect(JSON.stringify(parsed)).toBe(expected);
149
+ });
@@ -15,7 +15,7 @@ export function deserializeArbitrary(srcStart: usize, srcEnd: usize, dst: usize)
15
15
  return JSON.Value.from(deserializeArray<JSON.Value[]>(srcStart, srcEnd, 0));
16
16
  } else if (firstChar == 116 || firstChar == 102) return JSON.Value.from(deserializeBoolean(srcStart, srcEnd));
17
17
  else if (firstChar == CHAR_N) {
18
- return JSON.Value.from(null);
18
+ return JSON.Value.from<usize>(0);
19
19
  }
20
20
  return unreachable();
21
21
  }
package/assembly/index.ts CHANGED
@@ -8,7 +8,6 @@ import { serializeDate } from "./serialize/simple/date";
8
8
  import { deserializeBoolean } from "./deserialize/simple/bool";
9
9
  import { deserializeArray } from "./deserialize/simple/array";
10
10
  import { deserializeFloat } from "./deserialize/simple/float";
11
- import { deserializeStruct } from "./deserialize/simple/struct";
12
11
  import { deserializeMap } from "./deserialize/simple/map";
13
12
  import { deserializeDate } from "./deserialize/simple/date";
14
13
  import { deserializeInteger } from "./deserialize/simple/integer";
@@ -613,7 +612,7 @@ export namespace JSON {
613
612
  }
614
613
  throw new Error(`Could not deserialize data '${ptrToStr(srcStart, srcEnd).slice(0, 100)}' to type. Make sure to add the correct decorators to classes.`);
615
614
  }
616
- namespace Util {
615
+ export namespace Util {
617
616
  // @ts-ignore: decorator
618
617
  @inline export function isSpace(code: u16): boolean {
619
618
  return code == 0x20 || code - 9 <= 4;