json-as 0.9.23 → 0.9.25
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 -1
- package/README.md +1 -1
- package/assembly/__benches__/misc.bench.ts +33 -0
- package/assembly/custom/util.ts +14 -11
- package/assembly/deserialize/array.ts +8 -0
- package/assembly/deserialize/bool.ts +16 -0
- package/assembly/deserialize/date.ts +17 -9
- package/assembly/deserialize/float.ts +12 -0
- package/assembly/deserialize/integer.ts +9 -0
- package/assembly/deserialize/map.ts +7 -0
- package/assembly/deserialize/object.ts +135 -0
- package/assembly/deserialize/string.ts +8 -2
- package/assembly/index.ts +59 -11
- package/assembly/serialize/bool.ts +0 -12
- package/assembly/serialize/string.ts +0 -11
- package/assembly/test.ts +23 -23
- package/package.json +3 -2
- package/transform/lib/index.js +155 -172
- package/transform/lib/index.js.map +1 -0
- package/transform/package.json +1 -1
- package/transform/src/index.ts +235 -189
- package/transform/tsconfig.json +6 -26
- package/assembly/__benches__/bool.bench.ts +0 -14
- package/assembly/__benches__/simd.bench.ts +0 -36
- package/assembly/__benches__/string.bench.ts +0 -21
- package/assembly/util/strings.ts +0 -0
package/transform/tsconfig.json
CHANGED
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"module": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"noImplicitAny": true,
|
|
10
|
-
"strictNullChecks": true,
|
|
11
|
-
"strictFunctionTypes": true,
|
|
12
|
-
"strictBindCallApply": true,
|
|
13
|
-
"strictPropertyInitialization": true,
|
|
14
|
-
"noImplicitThis": true,
|
|
15
|
-
"alwaysStrict": true,
|
|
16
|
-
|
|
17
|
-
"noUnusedLocals": true,
|
|
18
|
-
"noUnusedParameters": false,
|
|
19
|
-
"noImplicitReturns": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noUncheckedIndexedAccess": true,
|
|
22
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
23
|
-
|
|
24
|
-
"moduleResolution": "node",
|
|
25
|
-
"esModuleInterop": false,
|
|
26
|
-
|
|
27
|
-
"skipLibCheck": false,
|
|
28
|
-
"forceConsistentCasingInFileNames": true
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ES2020",
|
|
5
|
+
"moduleResolution": "Node",
|
|
6
|
+
"removeComments": true,
|
|
7
|
+
"outDir": "./lib",
|
|
8
|
+
"sourceMap": true
|
|
29
9
|
}
|
|
30
10
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// import { bs } from "../custom/bs";
|
|
2
|
-
// import { serializeBool, serializeBool_BS } from "../serialize/bool"
|
|
3
|
-
|
|
4
|
-
// const out = memory.data(65536);
|
|
5
|
-
|
|
6
|
-
// bench("Serialize Bool", () => {
|
|
7
|
-
// blackbox<string>(serializeBool(true));
|
|
8
|
-
// });
|
|
9
|
-
|
|
10
|
-
// bench("Serialize Bool BS", () => {
|
|
11
|
-
// serializeBool_BS(true);
|
|
12
|
-
// bs._out(out);
|
|
13
|
-
// bs.reset();
|
|
14
|
-
// });
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// function esc_128(data: string): bool {
|
|
2
|
-
// let len = data.length;
|
|
3
|
-
|
|
4
|
-
// let running = v128.splat<i64>(0);
|
|
5
|
-
// let i = 0;
|
|
6
|
-
|
|
7
|
-
// while (i + 15 < len) {
|
|
8
|
-
// let w = v128.load(changetype<usize>(data));
|
|
9
|
-
// running = v128.or(running, v128.eq<i16>(w, i16x8.splat(34)));
|
|
10
|
-
// running = v128.or(running, v128.eq<i16>(w, i16x8.splat(92)));
|
|
11
|
-
|
|
12
|
-
// const subtracted = v128.sub<i16>(w, i8x16.splat(31));
|
|
13
|
-
// running = v128.or(running, v128.eq<i16>(subtracted, v128.splat<i64>(0)));
|
|
14
|
-
// i += 16;
|
|
15
|
-
// }
|
|
16
|
-
|
|
17
|
-
// return v128.any_true(running);
|
|
18
|
-
// }
|
|
19
|
-
|
|
20
|
-
// function esc_16(data: string): bool {
|
|
21
|
-
// let len = data.length;
|
|
22
|
-
// let b: u16 = 0;
|
|
23
|
-
// while (len--) {
|
|
24
|
-
// const c = load<u16>(changetype<usize>(data) + (len << 1));
|
|
25
|
-
// b |= u16(c < 32) | u16(c == 34) | u16(c == 92);
|
|
26
|
-
// }
|
|
27
|
-
// return bool(b);
|
|
28
|
-
// }
|
|
29
|
-
|
|
30
|
-
// bench("needs escaping 128", () => {
|
|
31
|
-
// blackbox<bool>(esc_128("hel\"o !!"));
|
|
32
|
-
// })
|
|
33
|
-
|
|
34
|
-
// bench("needs escaping 16", () => {
|
|
35
|
-
// blackbox<bool>(esc_16("hel\"o !!"));
|
|
36
|
-
// })
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
|
|
7
|
-
bench("UTF-16 to UTF-8", () => {
|
|
8
|
-
blackbox<ArrayBuffer>(String.UTF8.encode(blackbox<string>("hello world")));
|
|
9
|
-
});
|
|
10
|
-
// bench("Serialize String Native", () => {
|
|
11
|
-
// blackbox<string>(serializeString("hello \"world abc"));
|
|
12
|
-
// });
|
|
13
|
-
|
|
14
|
-
// bench("Serialize String Sink", () => {
|
|
15
|
-
// serializeString_BS("hello \"world abc");
|
|
16
|
-
// bs.reset();
|
|
17
|
-
// });
|
|
18
|
-
|
|
19
|
-
// bench("Serialize String SIMD", () => {
|
|
20
|
-
// serialize_simd_v1("hello \"world abc", out);
|
|
21
|
-
// })
|
package/assembly/util/strings.ts
DELETED
|
File without changes
|