toiljs 0.0.55 → 0.0.57
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 +10 -0
- package/README.md +72 -14
- package/build/backend/.tsbuildinfo +1 -1
- package/build/cli/.tsbuildinfo +1 -1
- package/build/cli/index.js +293 -142
- package/build/client/.tsbuildinfo +1 -1
- package/build/client/auth.js +1 -1
- package/build/client/components/Image.d.ts +1 -1
- package/build/client/dev/devtools.js +4 -2
- package/build/client/index.d.ts +2 -2
- package/build/client/index.js +2 -2
- package/build/client/routing/Router.js +1 -1
- package/build/client/routing/hooks.js +2 -2
- package/build/client/routing/mount.js +1 -1
- package/build/compiler/.tsbuildinfo +1 -1
- package/build/compiler/docs.js +1 -1
- package/build/compiler/seo.js +1 -3
- package/build/compiler/template-build.d.ts +5 -2
- package/build/compiler/template-build.js +19 -7
- package/build/devserver/.tsbuildinfo +1 -1
- package/build/devserver/cache.js +0 -0
- package/build/devserver/crypto.js +45 -17
- package/build/devserver/database.d.ts +1 -1
- package/build/devserver/database.js +84 -0
- package/build/devserver/email/caps.js +0 -0
- package/build/devserver/email/config.js +7 -2
- package/build/devserver/email/validate.js +1 -4
- package/build/devserver/host.js +18 -1
- package/build/devserver/index.d.ts +1 -1
- package/build/devserver/index.js +3 -2
- package/build/devserver/module.js +51 -12
- package/build/devserver/proxy.js +2 -1
- package/build/io/.tsbuildinfo +1 -1
- package/build/io/codec.d.ts +5 -5
- package/build/io/codec.js +193 -77
- package/examples/basic/client/components/HoneycombBackground.tsx +1 -1
- package/examples/basic/client/public/images/logo.svg +37 -34
- package/examples/basic/client/public/index.html +14 -14
- package/examples/basic/client/routes/auth.tsx +18 -10
- package/examples/basic/client/routes/cookies.tsx +15 -24
- package/examples/basic/client/routes/crypto.tsx +4 -5
- package/examples/basic/client/routes/features/template/template.tsx +1 -1
- package/examples/basic/client/routes/hello.tsx +1 -1
- package/examples/basic/client/routes/pq.tsx +14 -14
- package/examples/basic/client/routes/rest.tsx +1 -3
- package/examples/basic/client/styles/main.css +25 -22
- package/examples/basic/client/toil.tsx +1 -1
- package/examples/basic/server/README.md +8 -8
- package/examples/basic/server/core/AppHandler.ts +4 -7
- package/examples/basic/server/routes/Auth.ts +13 -10
- package/examples/basic/server/routes/EnvDemo.ts +9 -3
- package/examples/basic/server/routes/Guestbook.ts +2 -4
- package/package.json +26 -26
- package/src/backend/index.ts +4 -2
- package/src/cli/create.ts +19 -4
- package/src/cli/diagnostics.ts +48 -0
- package/src/cli/doctor.ts +155 -9
- package/src/cli/notify.ts +1 -6
- package/src/cli/ui.ts +3 -3
- package/src/cli/version-check.ts +5 -1
- package/src/client/auth.ts +33 -10
- package/src/client/components/Form.tsx +2 -2
- package/src/client/components/Image.tsx +1 -1
- package/src/client/components/Script.tsx +1 -1
- package/src/client/components/Slot.tsx +1 -1
- package/src/client/dev/devtools.tsx +126 -55
- package/src/client/dev/error-overlay.tsx +7 -1
- package/src/client/head/metadata.ts +1 -1
- package/src/client/index.ts +13 -2
- package/src/client/routing/Router.tsx +2 -2
- package/src/client/routing/error-boundary.tsx +1 -1
- package/src/client/routing/hooks.ts +5 -3
- package/src/client/routing/loader.ts +2 -2
- package/src/client/routing/mount.tsx +5 -6
- package/src/compiler/docs.ts +1 -1
- package/src/compiler/email-preview.ts +1 -1
- package/src/compiler/generate.ts +1 -1
- package/src/compiler/seo.ts +1 -3
- package/src/compiler/ssg.ts +10 -4
- package/src/compiler/template-build.ts +43 -11
- package/src/compiler/template.ts +1 -4
- package/src/compiler/vite.ts +1 -1
- package/src/devserver/cache.ts +0 -0
- package/src/devserver/crypto.ts +140 -51
- package/src/devserver/database.ts +168 -9
- package/src/devserver/dotenv.ts +10 -2
- package/src/devserver/email/caps.ts +0 -0
- package/src/devserver/email/config.ts +8 -2
- package/src/devserver/email/index.ts +3 -3
- package/src/devserver/email/validate.ts +1 -4
- package/src/devserver/envelope.ts +3 -3
- package/src/devserver/host.ts +46 -6
- package/src/devserver/index.ts +15 -6
- package/src/devserver/module.ts +56 -14
- package/src/devserver/proxy.ts +5 -7
- package/src/io/codec.ts +226 -83
- package/test/devserver-database.test.ts +60 -0
- package/test/devserver-secrets.test.ts +59 -0
- package/test/doctor.test.ts +30 -0
package/build/devserver/host.js
CHANGED
|
@@ -49,11 +49,28 @@ function readGuestString(ref, ptr) {
|
|
|
49
49
|
return '';
|
|
50
50
|
return m.toString('utf16le', ptr, ptr + byteLen);
|
|
51
51
|
}
|
|
52
|
+
const INSECURE_DEFAULT_SECRETS = {
|
|
53
|
+
AUTH_SESSION_SECRET: 'session cookies will be signed with a PUBLISHED key, so anyone can forge one and skip login',
|
|
54
|
+
AUTH_OPRF_SEED: 'the password OPRF seed will be the published dev value',
|
|
55
|
+
AUTH_KEM_SK: 'the server ML-KEM secret key will be the published dev value',
|
|
56
|
+
};
|
|
57
|
+
const warnedInsecureSecrets = new Set();
|
|
58
|
+
function warnInsecureSecretFallback(key) {
|
|
59
|
+
if (warnedInsecureSecrets.has(key))
|
|
60
|
+
return;
|
|
61
|
+
warnedInsecureSecrets.add(key);
|
|
62
|
+
process.stdout.write(` ⚠ ${key} is not set: ${INSECURE_DEFAULT_SECRETS[key]}. ` +
|
|
63
|
+
`Fine for local dev, but a deployed node MUST set it in .env.secrets (or on your deploy target). ` +
|
|
64
|
+
`Generate one: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"\n`);
|
|
65
|
+
}
|
|
52
66
|
function envLookup(ref, keyPtr, keyLen, outPtr, outCap, secure) {
|
|
53
67
|
const key = readBytes(ref, keyPtr, keyLen).toString('utf8');
|
|
54
68
|
const val = secure ? devEnvGetSecure(key) : devEnvGet(key);
|
|
55
|
-
if (val === null)
|
|
69
|
+
if (val === null) {
|
|
70
|
+
if (secure && key in INSECURE_DEFAULT_SECRETS)
|
|
71
|
+
warnInsecureSecretFallback(key);
|
|
56
72
|
return -2;
|
|
73
|
+
}
|
|
57
74
|
const bytes = Buffer.from(val, 'utf8');
|
|
58
75
|
if (bytes.length > outCap)
|
|
59
76
|
return -1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmailBackendConfig } from 'toiljs/shared';
|
|
2
2
|
import { type ViteTarget } from './proxy.js';
|
|
3
|
-
export { METHOD_CODES, encodeRequestEnvelope, decodeResponseEnvelope, unpackHandleResult } from './envelope.js';
|
|
3
|
+
export { METHOD_CODES, encodeRequestEnvelope, decodeResponseEnvelope, unpackHandleResult, } from './envelope.js';
|
|
4
4
|
export type { EnvelopeRequest, EnvelopeResponse } from './envelope.js';
|
|
5
5
|
export { WasmServerModule, WasmAbortError, UNHANDLED_HEADER } from './module.js';
|
|
6
6
|
export type { WasmDispatchResult } from './module.js';
|
package/build/devserver/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { initEmailService } from './email/index.js';
|
|
|
7
7
|
import { METHOD_CODES } from './envelope.js';
|
|
8
8
|
import { WasmServerModule } from './module.js';
|
|
9
9
|
import { proxyToVite, wireWebsocketProxy } from './proxy.js';
|
|
10
|
-
export { METHOD_CODES, encodeRequestEnvelope, decodeResponseEnvelope, unpackHandleResult } from './envelope.js';
|
|
10
|
+
export { METHOD_CODES, encodeRequestEnvelope, decodeResponseEnvelope, unpackHandleResult, } from './envelope.js';
|
|
11
11
|
export { WasmServerModule, WasmAbortError, UNHANDLED_HEADER } from './module.js';
|
|
12
12
|
export { buildHostImports, freshDispatchState } from './host.js';
|
|
13
13
|
const DEFAULT_MAX_BODY_LENGTH = 1024 * 1024 * 8;
|
|
@@ -146,7 +146,8 @@ export async function startDevServer(options) {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
catch (e) {
|
|
149
|
-
process.stdout.write(pc.red(` ✗ ${request.method} ${request.path} server error: ${String(e)}`) +
|
|
149
|
+
process.stdout.write(pc.red(` ✗ ${request.method} ${request.path} server error: ${String(e)}`) +
|
|
150
|
+
'\n');
|
|
150
151
|
response.status(500).send('internal error\n');
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
@@ -5,18 +5,57 @@ export { WasmAbortError } from './host.js';
|
|
|
5
5
|
export const UNHANDLED_HEADER = 'x-toil-unhandled';
|
|
6
6
|
const WASM_PAGE = 65536;
|
|
7
7
|
const PROVIDED_IMPORTS = new Set([
|
|
8
|
-
'abort',
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
8
|
+
'abort',
|
|
9
|
+
'set_status',
|
|
10
|
+
'set_header',
|
|
11
|
+
'respond_file',
|
|
12
|
+
'thread_spawn',
|
|
13
|
+
'Date.now',
|
|
14
|
+
'client_ip',
|
|
15
|
+
'ratelimit_check',
|
|
16
|
+
'email_send',
|
|
17
|
+
'env_get',
|
|
18
|
+
'env_get_secure',
|
|
19
|
+
'crypto.fill_random',
|
|
20
|
+
'crypto.random_uuid',
|
|
21
|
+
'crypto.take_result',
|
|
22
|
+
'crypto.digest',
|
|
23
|
+
'crypto.import_key',
|
|
24
|
+
'crypto.export_key',
|
|
25
|
+
'crypto.encrypt',
|
|
26
|
+
'crypto.decrypt',
|
|
27
|
+
'crypto.sign',
|
|
28
|
+
'crypto.verify',
|
|
29
|
+
'crypto.derive_bits',
|
|
30
|
+
'crypto.mldsa_verify',
|
|
31
|
+
'crypto.mlkem_decapsulate',
|
|
32
|
+
'crypto.voprf_evaluate',
|
|
33
|
+
'data.resolve_collection',
|
|
34
|
+
'data.get',
|
|
35
|
+
'data.get_many',
|
|
36
|
+
'data.exists',
|
|
37
|
+
'data.create',
|
|
38
|
+
'data.patch',
|
|
39
|
+
'data.delete',
|
|
40
|
+
'data.get_delete',
|
|
41
|
+
'data.unique_lookup',
|
|
42
|
+
'data.unique_claim',
|
|
43
|
+
'data.unique_release',
|
|
44
|
+
'data.view_get',
|
|
45
|
+
'data.view_publish',
|
|
46
|
+
'data.membership_contains',
|
|
47
|
+
'data.membership_add',
|
|
48
|
+
'data.membership_remove',
|
|
49
|
+
'data.membership_list',
|
|
50
|
+
'data.counter_get',
|
|
51
|
+
'data.counter_add',
|
|
52
|
+
'data.append',
|
|
53
|
+
'data.latest',
|
|
54
|
+
'data.capacity_set_total',
|
|
55
|
+
'data.capacity_available',
|
|
56
|
+
'data.capacity_reserve',
|
|
57
|
+
'data.capacity_confirm',
|
|
58
|
+
'data.capacity_cancel',
|
|
20
59
|
'data.take_result',
|
|
21
60
|
]);
|
|
22
61
|
export class WasmServerModule {
|
package/build/devserver/proxy.js
CHANGED
|
@@ -90,7 +90,8 @@ export function wireWebsocketProxy(app, target) {
|
|
|
90
90
|
pending.push(m);
|
|
91
91
|
});
|
|
92
92
|
ws.on('close', () => {
|
|
93
|
-
if (upstream.readyState === WebSocket.OPEN ||
|
|
93
|
+
if (upstream.readyState === WebSocket.OPEN ||
|
|
94
|
+
upstream.readyState === WebSocket.CONNECTING) {
|
|
94
95
|
upstream.close();
|
|
95
96
|
}
|
|
96
97
|
});
|
package/build/io/.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.es2025.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../node_modules/typescript/lib/lib.webworker.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/io/FastMap.ts","../../src/io/FastSet.ts","../../src/io/codec.ts","../../src/io/types.ts","../../src/io/index.ts","../../src/io/lengths.ts"],"fileIdsList":[[94],[94,95,96,97]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"d52ed68e7eb5881768a55713c9b5c7c443e6b46de15c04e348928b8efd20b110","affectsGlobalScope":true,"impliedFormat":1},{"version":"2a2de5b9459b3fc44decd9ce6100b72f1b002ef523126c1d3d8b2a4a63d74d78","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"5b2a4e30698cf563707a5180e8385abe9b66bc47527b1c367550156c461a9a50","signature":"6a4c287c863003342a42d8bf876c7df4c2e82e95f556af5ade71f05255845200"},{"version":"e343f9744a8f2af61013fe28d816e9a87e22021f229f8f38b7c536bf744f9d41","signature":"272e7bc3a3734cc9e7419625f04cff7095131e315e51a83fa992a5134763df49"},{"version":"2af5edb6361b480abbb5b61a36685af9126e6aab68b25bb8c7940b56bafb6fed","signature":"95d7fc009e516b8c2fc93192181dbf7858c70402d070ed85c61c34be685df103"},{"version":"ae4c9fffb9d6bff06cc5bd31285ad95ba0c5665436338a016e8e232d1a1b994a","signature":"3952955b5e83c1164fc78d7d54377fd4d09d2c11b79763cba53a7ff4b27a0601"},{"version":"8837ae5eb915aa1eb59dc7f608e02b8bae62e0f465ad689bffdf78d68f143d4c","signature":"48d0d0bebe2ccfd875953713d746fe4adae81b1e3a91ffafae29ead23fd5c39b"},{"version":"0c4bac17cf8fa8f3d7a210ced552058c2aa9cd3304c89fefea4aa8807ee841f4","signature":"c1631eafa81ab01bbddca5005243f1d9b5110681fa30a78564ad51637a9f310e"}],"root":[[94,99]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":99,"noImplicitAny":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"../../src/io","skipLibCheck":true,"sourceMap":false,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"suppressImplicitAnyIndexErrors":false,"target":99,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[95,1],[98,2]],"version":"6.0.3"}
|
|
1
|
+
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.es2025.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../node_modules/typescript/lib/lib.webworker.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/io/FastMap.ts","../../src/io/FastSet.ts","../../src/io/codec.ts","../../src/io/types.ts","../../src/io/index.ts","../../src/io/lengths.ts"],"fileIdsList":[[94],[94,95,96,97]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"d52ed68e7eb5881768a55713c9b5c7c443e6b46de15c04e348928b8efd20b110","affectsGlobalScope":true,"impliedFormat":1},{"version":"2a2de5b9459b3fc44decd9ce6100b72f1b002ef523126c1d3d8b2a4a63d74d78","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"5b2a4e30698cf563707a5180e8385abe9b66bc47527b1c367550156c461a9a50","signature":"6a4c287c863003342a42d8bf876c7df4c2e82e95f556af5ade71f05255845200"},{"version":"e343f9744a8f2af61013fe28d816e9a87e22021f229f8f38b7c536bf744f9d41","signature":"272e7bc3a3734cc9e7419625f04cff7095131e315e51a83fa992a5134763df49"},{"version":"0a5536b34eaf83f6553714284698a8e5b59c69ab897f677ecb366e934f584c3b","signature":"b9f2341c8b486561706db362b6f89ee6b149ef08fb4fa6aaea1041bce04fe1c5"},{"version":"ae4c9fffb9d6bff06cc5bd31285ad95ba0c5665436338a016e8e232d1a1b994a","signature":"3952955b5e83c1164fc78d7d54377fd4d09d2c11b79763cba53a7ff4b27a0601"},{"version":"8837ae5eb915aa1eb59dc7f608e02b8bae62e0f465ad689bffdf78d68f143d4c","signature":"48d0d0bebe2ccfd875953713d746fe4adae81b1e3a91ffafae29ead23fd5c39b"},{"version":"0c4bac17cf8fa8f3d7a210ced552058c2aa9cd3304c89fefea4aa8807ee841f4","signature":"c1631eafa81ab01bbddca5005243f1d9b5110681fa30a78564ad51637a9f310e"}],"root":[[94,99]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":99,"noImplicitAny":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"../../src/io","skipLibCheck":true,"sourceMap":false,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"suppressImplicitAnyIndexErrors":false,"target":99,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[95,1],[98,2]],"version":"6.0.3"}
|
package/build/io/codec.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export declare class DataWriter {
|
|
|
3
3
|
private view;
|
|
4
4
|
private off;
|
|
5
5
|
constructor(capacity?: number);
|
|
6
|
-
private reserve;
|
|
7
6
|
writeU8(v: number): this;
|
|
8
7
|
writeU16(v: number, be?: boolean): this;
|
|
9
8
|
writeU32(v: number, be?: boolean): this;
|
|
@@ -15,7 +14,6 @@ export declare class DataWriter {
|
|
|
15
14
|
writeF32(v: number, be?: boolean): this;
|
|
16
15
|
writeF64(v: number, be?: boolean): this;
|
|
17
16
|
writeBool(v: boolean): this;
|
|
18
|
-
private writeLimbs;
|
|
19
17
|
writeBytes(bytes: Uint8Array, be?: boolean): this;
|
|
20
18
|
writeString(value: string, be?: boolean): this;
|
|
21
19
|
writeU128(v: bigint, be?: boolean): this;
|
|
@@ -24,14 +22,15 @@ export declare class DataWriter {
|
|
|
24
22
|
writeI256(v: bigint, be?: boolean): this;
|
|
25
23
|
length(): number;
|
|
26
24
|
toBytes(): Uint8Array<ArrayBuffer>;
|
|
25
|
+
private reserve;
|
|
26
|
+
private writeLimbs;
|
|
27
27
|
}
|
|
28
28
|
export declare class DataReader {
|
|
29
|
+
ok: boolean;
|
|
29
30
|
private buf;
|
|
30
31
|
private view;
|
|
31
32
|
private off;
|
|
32
|
-
ok: boolean;
|
|
33
33
|
constructor(bytes: Uint8Array);
|
|
34
|
-
private has;
|
|
35
34
|
readU8(): number;
|
|
36
35
|
readU16(be?: boolean): number;
|
|
37
36
|
readU32(be?: boolean): number;
|
|
@@ -43,7 +42,6 @@ export declare class DataReader {
|
|
|
43
42
|
readF32(be?: boolean): number;
|
|
44
43
|
readF64(be?: boolean): number;
|
|
45
44
|
readBool(): boolean;
|
|
46
|
-
private readLimbs;
|
|
47
45
|
readBytes(be?: boolean): Uint8Array;
|
|
48
46
|
readString(be?: boolean): string;
|
|
49
47
|
readU128(be?: boolean): bigint;
|
|
@@ -51,4 +49,6 @@ export declare class DataReader {
|
|
|
51
49
|
readU256(be?: boolean): bigint;
|
|
52
50
|
readI256(be?: boolean): bigint;
|
|
53
51
|
remaining(): number;
|
|
52
|
+
private has;
|
|
53
|
+
private readLimbs;
|
|
54
54
|
}
|
package/build/io/codec.js
CHANGED
|
@@ -9,6 +9,94 @@ export class DataWriter {
|
|
|
9
9
|
this.buf = new Uint8Array(capacity > 0 ? capacity : 1);
|
|
10
10
|
this.view = new DataView(this.buf.buffer);
|
|
11
11
|
}
|
|
12
|
+
writeU8(v) {
|
|
13
|
+
const at = this.reserve(1);
|
|
14
|
+
this.view.setUint8(at, v & 0xff);
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
writeU16(v, be) {
|
|
18
|
+
const at = this.reserve(2);
|
|
19
|
+
this.view.setUint16(at, v & 0xffff, !be);
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
writeU32(v, be) {
|
|
23
|
+
const at = this.reserve(4);
|
|
24
|
+
this.view.setUint32(at, v >>> 0, !be);
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
writeU64(v, be) {
|
|
28
|
+
const at = this.reserve(8);
|
|
29
|
+
this.view.setBigUint64(at, v & MASK64, !be);
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
writeI8(v) {
|
|
33
|
+
const at = this.reserve(1);
|
|
34
|
+
this.view.setInt8(at, v);
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
writeI16(v, be) {
|
|
38
|
+
const at = this.reserve(2);
|
|
39
|
+
this.view.setInt16(at, v, !be);
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
writeI32(v, be) {
|
|
43
|
+
const at = this.reserve(4);
|
|
44
|
+
this.view.setInt32(at, v | 0, !be);
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
writeI64(v, be) {
|
|
48
|
+
const at = this.reserve(8);
|
|
49
|
+
this.view.setBigInt64(at, BigInt.asIntN(64, v), !be);
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
writeF32(v, be) {
|
|
53
|
+
const at = this.reserve(4);
|
|
54
|
+
this.view.setFloat32(at, v, !be);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
writeF64(v, be) {
|
|
58
|
+
const at = this.reserve(8);
|
|
59
|
+
this.view.setFloat64(at, v, !be);
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
writeBool(v) {
|
|
63
|
+
return this.writeU8(v ? 1 : 0);
|
|
64
|
+
}
|
|
65
|
+
writeBytes(bytes, be) {
|
|
66
|
+
this.writeU32(bytes.length, be);
|
|
67
|
+
if (bytes.length) {
|
|
68
|
+
const at = this.reserve(bytes.length);
|
|
69
|
+
this.buf.set(bytes, at);
|
|
70
|
+
}
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
writeString(value, be) {
|
|
74
|
+
const utf8 = utf8Encoder.encode(value);
|
|
75
|
+
this.writeU32(utf8.length, be);
|
|
76
|
+
if (utf8.length) {
|
|
77
|
+
const at = this.reserve(utf8.length);
|
|
78
|
+
this.buf.set(utf8, at);
|
|
79
|
+
}
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
writeU128(v, be) {
|
|
83
|
+
return this.writeLimbs(BigInt.asUintN(128, v), 2, !!be);
|
|
84
|
+
}
|
|
85
|
+
writeI128(v, be) {
|
|
86
|
+
return this.writeLimbs(BigInt.asUintN(128, v), 2, !!be);
|
|
87
|
+
}
|
|
88
|
+
writeU256(v, be) {
|
|
89
|
+
return this.writeLimbs(BigInt.asUintN(256, v), 4, !!be);
|
|
90
|
+
}
|
|
91
|
+
writeI256(v, be) {
|
|
92
|
+
return this.writeLimbs(BigInt.asUintN(256, v), 4, !!be);
|
|
93
|
+
}
|
|
94
|
+
length() {
|
|
95
|
+
return this.off;
|
|
96
|
+
}
|
|
97
|
+
toBytes() {
|
|
98
|
+
return this.buf.slice(0, this.off);
|
|
99
|
+
}
|
|
12
100
|
reserve(extra) {
|
|
13
101
|
const need = this.off + extra;
|
|
14
102
|
if (need > this.buf.length) {
|
|
@@ -24,17 +112,6 @@ export class DataWriter {
|
|
|
24
112
|
this.off += extra;
|
|
25
113
|
return at;
|
|
26
114
|
}
|
|
27
|
-
writeU8(v) { const at = this.reserve(1); this.view.setUint8(at, v & 0xff); return this; }
|
|
28
|
-
writeU16(v, be) { const at = this.reserve(2); this.view.setUint16(at, v & 0xffff, !be); return this; }
|
|
29
|
-
writeU32(v, be) { const at = this.reserve(4); this.view.setUint32(at, v >>> 0, !be); return this; }
|
|
30
|
-
writeU64(v, be) { const at = this.reserve(8); this.view.setBigUint64(at, v & MASK64, !be); return this; }
|
|
31
|
-
writeI8(v) { const at = this.reserve(1); this.view.setInt8(at, v); return this; }
|
|
32
|
-
writeI16(v, be) { const at = this.reserve(2); this.view.setInt16(at, v, !be); return this; }
|
|
33
|
-
writeI32(v, be) { const at = this.reserve(4); this.view.setInt32(at, v | 0, !be); return this; }
|
|
34
|
-
writeI64(v, be) { const at = this.reserve(8); this.view.setBigInt64(at, BigInt.asIntN(64, v), !be); return this; }
|
|
35
|
-
writeF32(v, be) { const at = this.reserve(4); this.view.setFloat32(at, v, !be); return this; }
|
|
36
|
-
writeF64(v, be) { const at = this.reserve(8); this.view.setFloat64(at, v, !be); return this; }
|
|
37
|
-
writeBool(v) { return this.writeU8(v ? 1 : 0); }
|
|
38
115
|
writeLimbs(u, count, be) {
|
|
39
116
|
if (be) {
|
|
40
117
|
for (let i = count - 1; i >= 0; i--)
|
|
@@ -46,39 +123,120 @@ export class DataWriter {
|
|
|
46
123
|
}
|
|
47
124
|
return this;
|
|
48
125
|
}
|
|
49
|
-
writeBytes(bytes, be) {
|
|
50
|
-
this.writeU32(bytes.length, be);
|
|
51
|
-
if (bytes.length) {
|
|
52
|
-
const at = this.reserve(bytes.length);
|
|
53
|
-
this.buf.set(bytes, at);
|
|
54
|
-
}
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
writeString(value, be) {
|
|
58
|
-
const utf8 = utf8Encoder.encode(value);
|
|
59
|
-
this.writeU32(utf8.length, be);
|
|
60
|
-
if (utf8.length) {
|
|
61
|
-
const at = this.reserve(utf8.length);
|
|
62
|
-
this.buf.set(utf8, at);
|
|
63
|
-
}
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
writeU128(v, be) { return this.writeLimbs(BigInt.asUintN(128, v), 2, !!be); }
|
|
67
|
-
writeI128(v, be) { return this.writeLimbs(BigInt.asUintN(128, v), 2, !!be); }
|
|
68
|
-
writeU256(v, be) { return this.writeLimbs(BigInt.asUintN(256, v), 4, !!be); }
|
|
69
|
-
writeI256(v, be) { return this.writeLimbs(BigInt.asUintN(256, v), 4, !!be); }
|
|
70
|
-
length() { return this.off; }
|
|
71
|
-
toBytes() { return this.buf.slice(0, this.off); }
|
|
72
126
|
}
|
|
73
127
|
export class DataReader {
|
|
128
|
+
ok = true;
|
|
74
129
|
buf;
|
|
75
130
|
view;
|
|
76
131
|
off = 0;
|
|
77
|
-
ok = true;
|
|
78
132
|
constructor(bytes) {
|
|
79
133
|
this.buf = bytes;
|
|
80
134
|
this.view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
81
135
|
}
|
|
136
|
+
readU8() {
|
|
137
|
+
if (!this.has(1))
|
|
138
|
+
return 0;
|
|
139
|
+
const v = this.view.getUint8(this.off);
|
|
140
|
+
this.off += 1;
|
|
141
|
+
return v;
|
|
142
|
+
}
|
|
143
|
+
readU16(be) {
|
|
144
|
+
if (!this.has(2))
|
|
145
|
+
return 0;
|
|
146
|
+
const v = this.view.getUint16(this.off, !be);
|
|
147
|
+
this.off += 2;
|
|
148
|
+
return v;
|
|
149
|
+
}
|
|
150
|
+
readU32(be) {
|
|
151
|
+
if (!this.has(4))
|
|
152
|
+
return 0;
|
|
153
|
+
const v = this.view.getUint32(this.off, !be);
|
|
154
|
+
this.off += 4;
|
|
155
|
+
return v >>> 0;
|
|
156
|
+
}
|
|
157
|
+
readU64(be) {
|
|
158
|
+
if (!this.has(8))
|
|
159
|
+
return 0n;
|
|
160
|
+
const v = this.view.getBigUint64(this.off, !be);
|
|
161
|
+
this.off += 8;
|
|
162
|
+
return v;
|
|
163
|
+
}
|
|
164
|
+
readI8() {
|
|
165
|
+
if (!this.has(1))
|
|
166
|
+
return 0;
|
|
167
|
+
const v = this.view.getInt8(this.off);
|
|
168
|
+
this.off += 1;
|
|
169
|
+
return v;
|
|
170
|
+
}
|
|
171
|
+
readI16(be) {
|
|
172
|
+
if (!this.has(2))
|
|
173
|
+
return 0;
|
|
174
|
+
const v = this.view.getInt16(this.off, !be);
|
|
175
|
+
this.off += 2;
|
|
176
|
+
return v;
|
|
177
|
+
}
|
|
178
|
+
readI32(be) {
|
|
179
|
+
if (!this.has(4))
|
|
180
|
+
return 0;
|
|
181
|
+
const v = this.view.getInt32(this.off, !be);
|
|
182
|
+
this.off += 4;
|
|
183
|
+
return v;
|
|
184
|
+
}
|
|
185
|
+
readI64(be) {
|
|
186
|
+
if (!this.has(8))
|
|
187
|
+
return 0n;
|
|
188
|
+
const v = this.view.getBigInt64(this.off, !be);
|
|
189
|
+
this.off += 8;
|
|
190
|
+
return v;
|
|
191
|
+
}
|
|
192
|
+
readF32(be) {
|
|
193
|
+
if (!this.has(4))
|
|
194
|
+
return 0;
|
|
195
|
+
const v = this.view.getFloat32(this.off, !be);
|
|
196
|
+
this.off += 4;
|
|
197
|
+
return v;
|
|
198
|
+
}
|
|
199
|
+
readF64(be) {
|
|
200
|
+
if (!this.has(8))
|
|
201
|
+
return 0;
|
|
202
|
+
const v = this.view.getFloat64(this.off, !be);
|
|
203
|
+
this.off += 8;
|
|
204
|
+
return v;
|
|
205
|
+
}
|
|
206
|
+
readBool() {
|
|
207
|
+
return this.readU8() !== 0;
|
|
208
|
+
}
|
|
209
|
+
readBytes(be) {
|
|
210
|
+
const len = this.readU32(be);
|
|
211
|
+
if (!this.has(len))
|
|
212
|
+
return new Uint8Array(0);
|
|
213
|
+
const out = this.buf.slice(this.off, this.off + len);
|
|
214
|
+
this.off += len;
|
|
215
|
+
return out;
|
|
216
|
+
}
|
|
217
|
+
readString(be) {
|
|
218
|
+
const len = this.readU32(be);
|
|
219
|
+
if (!this.has(len))
|
|
220
|
+
return '';
|
|
221
|
+
const s = utf8Decoder.decode(this.buf.subarray(this.off, this.off + len));
|
|
222
|
+
this.off += len;
|
|
223
|
+
return s;
|
|
224
|
+
}
|
|
225
|
+
readU128(be) {
|
|
226
|
+
return this.readLimbs(2, !!be);
|
|
227
|
+
}
|
|
228
|
+
readI128(be) {
|
|
229
|
+
return BigInt.asIntN(128, this.readLimbs(2, !!be));
|
|
230
|
+
}
|
|
231
|
+
readU256(be) {
|
|
232
|
+
return this.readLimbs(4, !!be);
|
|
233
|
+
}
|
|
234
|
+
readI256(be) {
|
|
235
|
+
return BigInt.asIntN(256, this.readLimbs(4, !!be));
|
|
236
|
+
}
|
|
237
|
+
remaining() {
|
|
238
|
+
return this.buf.length - this.off;
|
|
239
|
+
}
|
|
82
240
|
has(n) {
|
|
83
241
|
if (n < 0 || this.off + n > this.buf.length) {
|
|
84
242
|
this.ok = false;
|
|
@@ -86,27 +244,6 @@ export class DataReader {
|
|
|
86
244
|
}
|
|
87
245
|
return true;
|
|
88
246
|
}
|
|
89
|
-
readU8() { if (!this.has(1))
|
|
90
|
-
return 0; const v = this.view.getUint8(this.off); this.off += 1; return v; }
|
|
91
|
-
readU16(be) { if (!this.has(2))
|
|
92
|
-
return 0; const v = this.view.getUint16(this.off, !be); this.off += 2; return v; }
|
|
93
|
-
readU32(be) { if (!this.has(4))
|
|
94
|
-
return 0; const v = this.view.getUint32(this.off, !be); this.off += 4; return v >>> 0; }
|
|
95
|
-
readU64(be) { if (!this.has(8))
|
|
96
|
-
return 0n; const v = this.view.getBigUint64(this.off, !be); this.off += 8; return v; }
|
|
97
|
-
readI8() { if (!this.has(1))
|
|
98
|
-
return 0; const v = this.view.getInt8(this.off); this.off += 1; return v; }
|
|
99
|
-
readI16(be) { if (!this.has(2))
|
|
100
|
-
return 0; const v = this.view.getInt16(this.off, !be); this.off += 2; return v; }
|
|
101
|
-
readI32(be) { if (!this.has(4))
|
|
102
|
-
return 0; const v = this.view.getInt32(this.off, !be); this.off += 4; return v; }
|
|
103
|
-
readI64(be) { if (!this.has(8))
|
|
104
|
-
return 0n; const v = this.view.getBigInt64(this.off, !be); this.off += 8; return v; }
|
|
105
|
-
readF32(be) { if (!this.has(4))
|
|
106
|
-
return 0; const v = this.view.getFloat32(this.off, !be); this.off += 4; return v; }
|
|
107
|
-
readF64(be) { if (!this.has(8))
|
|
108
|
-
return 0; const v = this.view.getFloat64(this.off, !be); this.off += 8; return v; }
|
|
109
|
-
readBool() { return this.readU8() !== 0; }
|
|
110
247
|
readLimbs(count, be) {
|
|
111
248
|
let result = 0n;
|
|
112
249
|
if (be) {
|
|
@@ -119,25 +256,4 @@ export class DataReader {
|
|
|
119
256
|
}
|
|
120
257
|
return result;
|
|
121
258
|
}
|
|
122
|
-
readBytes(be) {
|
|
123
|
-
const len = this.readU32(be);
|
|
124
|
-
if (!this.has(len))
|
|
125
|
-
return new Uint8Array(0);
|
|
126
|
-
const out = this.buf.slice(this.off, this.off + len);
|
|
127
|
-
this.off += len;
|
|
128
|
-
return out;
|
|
129
|
-
}
|
|
130
|
-
readString(be) {
|
|
131
|
-
const len = this.readU32(be);
|
|
132
|
-
if (!this.has(len))
|
|
133
|
-
return "";
|
|
134
|
-
const s = utf8Decoder.decode(this.buf.subarray(this.off, this.off + len));
|
|
135
|
-
this.off += len;
|
|
136
|
-
return s;
|
|
137
|
-
}
|
|
138
|
-
readU128(be) { return this.readLimbs(2, !!be); }
|
|
139
|
-
readI128(be) { return BigInt.asIntN(128, this.readLimbs(2, !!be)); }
|
|
140
|
-
readU256(be) { return this.readLimbs(4, !!be); }
|
|
141
|
-
readI256(be) { return BigInt.asIntN(256, this.readLimbs(4, !!be)); }
|
|
142
|
-
remaining() { return this.buf.length - this.off; }
|
|
143
259
|
}
|