jaelis-node 1.10.0 → 2.1.0
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/README.md +156 -439
- package/bin/jaelis-node.js +83 -504
- package/lib/index.js +31 -2840
- package/lib/node.js +309 -0
- package/lib/rpc.js +315 -0
- package/lib/storage.js +198 -0
- package/lib/sync.js +366 -0
- package/package.json +19 -53
- package/config/default.json +0 -74
- package/config/mainnet.json +0 -30
- package/config/testnet.json +0 -26
- package/lib/JAELIS-VM/lib/adapters/evm-adapter.js +0 -454
- package/lib/JAELIS-VM/lib/adapters/index.js +0 -411
- package/lib/JAELIS-VM/lib/adapters/svm-adapter.js +0 -457
- package/lib/JAELIS-VM/lib/compiler/jir-compiler.js +0 -1097
- package/lib/JAELIS-VM/lib/execution/engine.js +0 -1183
- package/lib/JAELIS-VM/lib/index.js +0 -440
- package/lib/JAELIS-VM/lib/integration/jaelis-integration.js +0 -543
- package/lib/JAELIS-VM/lib/serialization/serializer.js +0 -819
- package/lib/JAELIS-VM/lib/state/state-manager.js +0 -1116
- package/lib/JAELIS-VM/lib/translator/bytecode-translator.js +0 -1222
- package/lib/JAELIS-VM/lib/unified/cross-chain-deploy.js +0 -1678
- package/lib/JAELIS-VM/lib/unified/cross-chain-state.js +0 -836
- package/lib/JAELIS-VM/lib/unified/dynamic-contracts.js +0 -1127
- package/lib/JAELIS-VM/lib/unified/index.js +0 -456
- package/lib/JAELIS-VM/lib/unified/jaelis-abi.js +0 -1150
- package/lib/JAELIS-VM/lib/unified/unified-compiler.js +0 -1350
- package/lib/JAELIS-VM/node_modules/.bin/download-cbor-prebuilds +0 -12
- package/lib/JAELIS-VM/node_modules/.bin/download-cbor-prebuilds.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/.bin/download-cbor-prebuilds.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/.bin/download-msgpackr-prebuilds +0 -12
- package/lib/JAELIS-VM/node_modules/.bin/download-msgpackr-prebuilds.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/.bin/download-msgpackr-prebuilds.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages +0 -12
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-optional +0 -12
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-optional.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-optional.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-test +0 -12
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-test.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages-test.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/.bin/node-gyp-build-optional-packages.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/.package-lock.json +0 -127
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/README.md +0 -1
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/index.js +0 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/node.abi115.node +0 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/node.napi.node +0 -0
- package/lib/JAELIS-VM/node_modules/@cbor-extract/cbor-extract-win32-x64/package.json +0 -17
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/README.md +0 -1
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/index.js +0 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/node.abi115.node +0 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/node.napi.node +0 -0
- package/lib/JAELIS-VM/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64/package.json +0 -17
- package/lib/JAELIS-VM/node_modules/cbor-extract/LICENSE +0 -21
- package/lib/JAELIS-VM/node_modules/cbor-extract/README.md +0 -5
- package/lib/JAELIS-VM/node_modules/cbor-extract/bin/download-prebuilds.js +0 -11
- package/lib/JAELIS-VM/node_modules/cbor-extract/binding.gyp +0 -60
- package/lib/JAELIS-VM/node_modules/cbor-extract/index.js +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-extract/package.json +0 -50
- package/lib/JAELIS-VM/node_modules/cbor-extract/src/extract.cpp +0 -198
- package/lib/JAELIS-VM/node_modules/cbor-x/LICENSE +0 -21
- package/lib/JAELIS-VM/node_modules/cbor-x/README.md +0 -380
- package/lib/JAELIS-VM/node_modules/cbor-x/SECURITY.md +0 -11
- package/lib/JAELIS-VM/node_modules/cbor-x/benchmark.md +0 -73
- package/lib/JAELIS-VM/node_modules/cbor-x/browser.js +0 -11
- package/lib/JAELIS-VM/node_modules/cbor-x/decode.d.ts +0 -2
- package/lib/JAELIS-VM/node_modules/cbor-x/decode.js +0 -1300
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/decode-no-eval.cjs +0 -1244
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/decode-no-eval.cjs.map +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.cjs +0 -2509
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.cjs.map +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.min.js +0 -2
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index-no-eval.min.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.js +0 -2508
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.min.js +0 -2
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/index.min.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/node.cjs +0 -2629
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/node.cjs.map +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/test.js +0 -3343
- package/lib/JAELIS-VM/node_modules/cbor-x/dist/test.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/encode.d.ts +0 -1
- package/lib/JAELIS-VM/node_modules/cbor-x/encode.js +0 -1231
- package/lib/JAELIS-VM/node_modules/cbor-x/index.d.ts +0 -79
- package/lib/JAELIS-VM/node_modules/cbor-x/index.js +0 -3
- package/lib/JAELIS-VM/node_modules/cbor-x/iterators.js +0 -85
- package/lib/JAELIS-VM/node_modules/cbor-x/node-index.js +0 -24
- package/lib/JAELIS-VM/node_modules/cbor-x/package.json +0 -94
- package/lib/JAELIS-VM/node_modules/cbor-x/rollup.config.js +0 -88
- package/lib/JAELIS-VM/node_modules/cbor-x/stream.js +0 -61
- package/lib/JAELIS-VM/node_modules/cbor-x/webpack.config.js +0 -19
- package/lib/JAELIS-VM/node_modules/detect-libc/LICENSE +0 -201
- package/lib/JAELIS-VM/node_modules/detect-libc/README.md +0 -163
- package/lib/JAELIS-VM/node_modules/detect-libc/index.d.ts +0 -14
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/detect-libc.js +0 -313
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/elf.js +0 -39
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/filesystem.js +0 -51
- package/lib/JAELIS-VM/node_modules/detect-libc/lib/process.js +0 -24
- package/lib/JAELIS-VM/node_modules/detect-libc/package.json +0 -44
- package/lib/JAELIS-VM/node_modules/msgpackr/LICENSE +0 -21
- package/lib/JAELIS-VM/node_modules/msgpackr/README.md +0 -372
- package/lib/JAELIS-VM/node_modules/msgpackr/SECURITY.md +0 -11
- package/lib/JAELIS-VM/node_modules/msgpackr/benchmark.md +0 -67
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.cjs +0 -2407
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.cjs.map +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.min.js +0 -2
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index-no-eval.min.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.js +0 -2406
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.min.js +0 -2
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/index.min.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/node.cjs +0 -3320
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/node.cjs.map +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/test.js +0 -4540
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/test.js.map +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/unpack-no-eval.cjs +0 -1250
- package/lib/JAELIS-VM/node_modules/msgpackr/dist/unpack-no-eval.cjs.map +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/index.d.cts +0 -91
- package/lib/JAELIS-VM/node_modules/msgpackr/index.d.ts +0 -91
- package/lib/JAELIS-VM/node_modules/msgpackr/index.js +0 -5
- package/lib/JAELIS-VM/node_modules/msgpackr/iterators.js +0 -87
- package/lib/JAELIS-VM/node_modules/msgpackr/node-index.js +0 -25
- package/lib/JAELIS-VM/node_modules/msgpackr/pack.d.cts +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/pack.d.ts +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr/pack.js +0 -1141
- package/lib/JAELIS-VM/node_modules/msgpackr/package.json +0 -104
- package/lib/JAELIS-VM/node_modules/msgpackr/rollup.config.js +0 -88
- package/lib/JAELIS-VM/node_modules/msgpackr/stream.js +0 -57
- package/lib/JAELIS-VM/node_modules/msgpackr/struct.js +0 -815
- package/lib/JAELIS-VM/node_modules/msgpackr/test-worker.js +0 -3
- package/lib/JAELIS-VM/node_modules/msgpackr/unpack.d.cts +0 -2
- package/lib/JAELIS-VM/node_modules/msgpackr/unpack.d.ts +0 -2
- package/lib/JAELIS-VM/node_modules/msgpackr/unpack.js +0 -1221
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/LICENSE +0 -21
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/README.md +0 -5
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/bin/download-prebuilds.js +0 -13
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/binding.gyp +0 -63
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/index.js +0 -1
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages +0 -12
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-optional +0 -12
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-optional.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-optional.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-test +0 -12
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-test.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages-test.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages.cmd +0 -17
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/.bin/node-gyp-build-optional-packages.ps1 +0 -28
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/LICENSE +0 -21
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/README.md +0 -58
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/bin.js +0 -82
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/build-test.js +0 -19
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/index.js +0 -6
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/node-gyp-build.js +0 -236
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/optional.js +0 -7
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages/package.json +0 -32
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/package.json +0 -50
- package/lib/JAELIS-VM/node_modules/msgpackr-extract/src/extract.cpp +0 -274
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/LICENSE +0 -21
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/README.md +0 -58
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/bin.js +0 -77
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/build-test.js +0 -19
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/index.js +0 -224
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/optional.js +0 -7
- package/lib/JAELIS-VM/node_modules/node-gyp-build-optional-packages/package.json +0 -32
- package/lib/JAELIS-VM/package-lock.json +0 -284
- package/lib/JAELIS-VM/package.json +0 -38
- package/lib/JAELIS-VM/test/comprehensive.test.js +0 -267
- package/lib/JAELIS-VM/test/cross-chain-test.js +0 -470
- package/lib/JAELIS-VM/test/unified-vm-test.js +0 -459
- package/lib/JAELIS-VM/test/unified.test.js +0 -166
- package/lib/JAELIS-VM/test/vm.test.js +0 -599
- package/lib/settlement-server.js +0 -999
- package/lib/vm/index.js +0 -397
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "msgpackr",
|
|
3
|
-
"author": "Kris Zyp",
|
|
4
|
-
"version": "1.11.8",
|
|
5
|
-
"description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"types": "./index.d.ts",
|
|
8
|
-
"main": "./dist/node.cjs",
|
|
9
|
-
"module": "./index.js",
|
|
10
|
-
"react-native": "./index.js",
|
|
11
|
-
"keywords": [
|
|
12
|
-
"MessagePack",
|
|
13
|
-
"msgpack",
|
|
14
|
-
"performance",
|
|
15
|
-
"structured",
|
|
16
|
-
"clone"
|
|
17
|
-
],
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "http://github.com/kriszyp/msgpackr"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"benchmark": "node ./tests/benchmark.cjs",
|
|
24
|
-
"build": "rollup -c && cpy index.d.ts . --rename=index.d.cts && cpy pack.d.ts . --rename=pack.d.cts && cpy unpack.d.ts . --rename=unpack.d.cts",
|
|
25
|
-
"dry-run": "npm publish --dry-run",
|
|
26
|
-
"prepare": "npm run build",
|
|
27
|
-
"test": "mocha tests/test**.*js -u tdd --experimental-json-modules"
|
|
28
|
-
},
|
|
29
|
-
"type": "module",
|
|
30
|
-
"exports": {
|
|
31
|
-
".": {
|
|
32
|
-
"types": {
|
|
33
|
-
"require": "./index.d.cts",
|
|
34
|
-
"import": "./index.d.ts"
|
|
35
|
-
},
|
|
36
|
-
"browser": "./index.js",
|
|
37
|
-
"node": {
|
|
38
|
-
"require": "./dist/node.cjs",
|
|
39
|
-
"import": "./node-index.js"
|
|
40
|
-
},
|
|
41
|
-
"bun": {
|
|
42
|
-
"require": "./dist/node.cjs",
|
|
43
|
-
"import": "./node-index.js"
|
|
44
|
-
},
|
|
45
|
-
"default": "./index.js"
|
|
46
|
-
},
|
|
47
|
-
"./pack": {
|
|
48
|
-
"types": {
|
|
49
|
-
"require": "./pack.d.cts",
|
|
50
|
-
"import": "./pack.d.ts"
|
|
51
|
-
},
|
|
52
|
-
"browser": "./pack.js",
|
|
53
|
-
"node": {
|
|
54
|
-
"import": "./index.js",
|
|
55
|
-
"require": "./dist/node.cjs"
|
|
56
|
-
},
|
|
57
|
-
"bun": {
|
|
58
|
-
"import": "./index.js",
|
|
59
|
-
"require": "./dist/node.cjs"
|
|
60
|
-
},
|
|
61
|
-
"default": "./pack.js"
|
|
62
|
-
},
|
|
63
|
-
"./unpack": {
|
|
64
|
-
"types": {
|
|
65
|
-
"require": "./unpack.d.cts",
|
|
66
|
-
"import": "./unpack.d.ts"
|
|
67
|
-
},
|
|
68
|
-
"browser": "./unpack.js",
|
|
69
|
-
"node": {
|
|
70
|
-
"import": "./index.js",
|
|
71
|
-
"require": "./dist/node.cjs"
|
|
72
|
-
},
|
|
73
|
-
"bun": {
|
|
74
|
-
"import": "./index.js",
|
|
75
|
-
"require": "./dist/node.cjs"
|
|
76
|
-
},
|
|
77
|
-
"default": "./unpack.js"
|
|
78
|
-
},
|
|
79
|
-
"./unpack-no-eval": "./dist/unpack-no-eval.cjs",
|
|
80
|
-
"./index-no-eval": "./dist/index-no-eval.cjs"
|
|
81
|
-
},
|
|
82
|
-
"files": [
|
|
83
|
-
"/dist",
|
|
84
|
-
"*.md",
|
|
85
|
-
"/*.js",
|
|
86
|
-
"/*.ts",
|
|
87
|
-
"/*.cts"
|
|
88
|
-
],
|
|
89
|
-
"optionalDependencies": {
|
|
90
|
-
"msgpackr-extract": "^3.0.2"
|
|
91
|
-
},
|
|
92
|
-
"devDependencies": {
|
|
93
|
-
"@rollup/plugin-json": "^5.0.1",
|
|
94
|
-
"@rollup/plugin-replace": "^5.0.1",
|
|
95
|
-
"@types/node": "latest",
|
|
96
|
-
"async": "^3",
|
|
97
|
-
"chai": "^4.3.4",
|
|
98
|
-
"cpy-cli": "^4.1.0",
|
|
99
|
-
"esm": "^3.2.25",
|
|
100
|
-
"mocha": "^10.1.0",
|
|
101
|
-
"rollup": "^3.2.5",
|
|
102
|
-
"@rollup/plugin-terser": "^0.1.0"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import terser from '@rollup/plugin-terser';
|
|
2
|
-
import json from "@rollup/plugin-json";
|
|
3
|
-
import replace from "@rollup/plugin-replace";
|
|
4
|
-
|
|
5
|
-
export default [
|
|
6
|
-
{
|
|
7
|
-
input: "node-index.js",
|
|
8
|
-
output: [
|
|
9
|
-
{
|
|
10
|
-
file: "dist/node.cjs",
|
|
11
|
-
format: "cjs",
|
|
12
|
-
sourcemap: true
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
input: "index.js",
|
|
18
|
-
output: {
|
|
19
|
-
file: "dist/index.js",
|
|
20
|
-
format: "umd",
|
|
21
|
-
name: "msgpackr",
|
|
22
|
-
sourcemap: true
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
input: "index.js",
|
|
27
|
-
plugins: [
|
|
28
|
-
replace({ Function: 'BlockedFunction '})
|
|
29
|
-
],
|
|
30
|
-
output: {
|
|
31
|
-
file: "dist/index-no-eval.cjs",
|
|
32
|
-
format: "umd",
|
|
33
|
-
name: "msgpackr",
|
|
34
|
-
sourcemap: true
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
input: "unpack.js",
|
|
39
|
-
plugins: [
|
|
40
|
-
replace({ Function: 'BlockedFunction '})
|
|
41
|
-
],
|
|
42
|
-
output: {
|
|
43
|
-
file: "dist/unpack-no-eval.cjs",
|
|
44
|
-
format: "umd",
|
|
45
|
-
name: "msgpackr",
|
|
46
|
-
sourcemap: true
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
input: "index.js",
|
|
51
|
-
plugins: [
|
|
52
|
-
terser({})
|
|
53
|
-
],
|
|
54
|
-
output: {
|
|
55
|
-
file: "dist/index.min.js",
|
|
56
|
-
format: "umd",
|
|
57
|
-
name: "msgpackr",
|
|
58
|
-
sourcemap: true
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
input: "index.js",
|
|
63
|
-
plugins: [
|
|
64
|
-
replace({ Function: 'BlockedFunction '}),
|
|
65
|
-
terser({})
|
|
66
|
-
],
|
|
67
|
-
output: {
|
|
68
|
-
file: "dist/index-no-eval.min.js",
|
|
69
|
-
format: "umd",
|
|
70
|
-
name: "msgpackr",
|
|
71
|
-
sourcemap: true
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
input: "tests/test.js",
|
|
76
|
-
plugins: [json()],
|
|
77
|
-
external: ['chai', '../index.js'],
|
|
78
|
-
output: {
|
|
79
|
-
file: "dist/test.js",
|
|
80
|
-
format: "iife",
|
|
81
|
-
sourcemap: true,
|
|
82
|
-
globals: {
|
|
83
|
-
chai: 'chai',
|
|
84
|
-
'./index.js': 'msgpackr',
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
];
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Transform } from 'stream'
|
|
2
|
-
import { Packr } from './pack.js'
|
|
3
|
-
import { Unpackr } from './unpack.js'
|
|
4
|
-
var DEFAULT_OPTIONS = {objectMode: true}
|
|
5
|
-
|
|
6
|
-
export class PackrStream extends Transform {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
if (!options)
|
|
9
|
-
options = {}
|
|
10
|
-
options.writableObjectMode = true
|
|
11
|
-
super(options)
|
|
12
|
-
options.sequential = true
|
|
13
|
-
this.packr = options.packr || new Packr(options)
|
|
14
|
-
}
|
|
15
|
-
_transform(value, encoding, callback) {
|
|
16
|
-
this.push(this.packr.pack(value))
|
|
17
|
-
callback()
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export class UnpackrStream extends Transform {
|
|
22
|
-
constructor(options) {
|
|
23
|
-
if (!options)
|
|
24
|
-
options = {}
|
|
25
|
-
options.objectMode = true
|
|
26
|
-
super(options)
|
|
27
|
-
options.structures = []
|
|
28
|
-
this.unpackr = options.unpackr || new Unpackr(options)
|
|
29
|
-
}
|
|
30
|
-
_transform(chunk, encoding, callback) {
|
|
31
|
-
if (this.incompleteBuffer) {
|
|
32
|
-
chunk = Buffer.concat([this.incompleteBuffer, chunk])
|
|
33
|
-
this.incompleteBuffer = null
|
|
34
|
-
}
|
|
35
|
-
let values
|
|
36
|
-
try {
|
|
37
|
-
values = this.unpackr.unpackMultiple(chunk)
|
|
38
|
-
} catch(error) {
|
|
39
|
-
if (error.incomplete) {
|
|
40
|
-
this.incompleteBuffer = chunk.slice(error.lastPosition)
|
|
41
|
-
values = error.values
|
|
42
|
-
}
|
|
43
|
-
else
|
|
44
|
-
throw error
|
|
45
|
-
} finally {
|
|
46
|
-
for (let value of values || []) {
|
|
47
|
-
if (value === null)
|
|
48
|
-
value = this.getNullValue()
|
|
49
|
-
this.push(value)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (callback) callback()
|
|
53
|
-
}
|
|
54
|
-
getNullValue() {
|
|
55
|
-
return Symbol.for(null)
|
|
56
|
-
}
|
|
57
|
-
}
|