wao 0.11.0 → 0.11.2
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/cjs/aoconnect-base.js +1 -1
- package/cjs/armem-base.js +91 -69
- package/cjs/armem-web.js +1 -2
- package/cjs/armem.js +1 -2
- package/cjs/bao.js +8 -7
- package/cjs/compress.js +0 -1
- package/cjs/wao.js +61 -1
- package/cjs/waosm/waosm.js +19 -48
- package/cjs/waosm-node/waosm_bg.js +19 -48
- package/cjs/weavedrive.js +299 -370
- package/esm/aoconnect-base.js +1 -1
- package/esm/armem-base.js +26 -9
- package/esm/armem-web.js +2 -2
- package/esm/armem.js +2 -2
- package/esm/bao.js +2 -2
- package/esm/compress.js +0 -1
- package/esm/wao.js +19 -1
- package/esm/waosm/README.md +7 -3
- package/esm/waosm/waosm.d.ts +6 -12
- package/esm/waosm/waosm.js +11 -35
- package/esm/waosm/waosm_bg.wasm +0 -0
- package/esm/waosm/waosm_bg.wasm.d.ts +4 -6
- package/esm/waosm-node/README.md +7 -3
- package/esm/waosm-node/waosm.d.ts +2 -6
- package/esm/waosm-node/waosm_bg.js +11 -35
- package/esm/waosm-node/waosm_bg.wasm +0 -0
- package/esm/waosm-node/waosm_bg.wasm.d.ts +4 -6
- package/esm/weavedrive.js +145 -249
- package/package.json +1 -1
package/esm/aoconnect-base.js
CHANGED
|
@@ -467,7 +467,7 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
467
467
|
})
|
|
468
468
|
}
|
|
469
469
|
if (!p.handle) {
|
|
470
|
-
const { format, mod, wasm } = await mem.getWasm(p.
|
|
470
|
+
const { format, mod, wasm } = await mem.getWasm(p.module)
|
|
471
471
|
const wdrive = extensions[p.extention]
|
|
472
472
|
p.handle = await AoLoader(wasm, {
|
|
473
473
|
format,
|
package/esm/armem-base.js
CHANGED
|
@@ -6,6 +6,22 @@ import { last, assoc, is } from "ramda"
|
|
|
6
6
|
import { buildTags, tags } from "./utils.js"
|
|
7
7
|
import base64url from "base64url"
|
|
8
8
|
|
|
9
|
+
function eq(buf1, buf2, chunkSize = 1024 * 1024) {
|
|
10
|
+
if (buf1.byteLength !== buf2.byteLength) return false
|
|
11
|
+
|
|
12
|
+
const view1 = new Uint8Array(buf1)
|
|
13
|
+
const view2 = new Uint8Array(buf2)
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i < buf1.byteLength; i += chunkSize) {
|
|
16
|
+
const slice1 = view1.subarray(i, i + chunkSize)
|
|
17
|
+
const slice2 = view2.subarray(i, i + chunkSize)
|
|
18
|
+
|
|
19
|
+
if (!slice1.every((val, idx) => val === slice2[idx])) return false
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
9
25
|
export default class ArMemBase {
|
|
10
26
|
constructor({
|
|
11
27
|
MU_URL,
|
|
@@ -15,13 +31,11 @@ export default class ArMemBase {
|
|
|
15
31
|
scheduler,
|
|
16
32
|
cache,
|
|
17
33
|
init,
|
|
18
|
-
|
|
19
|
-
Decompressor,
|
|
34
|
+
Waosm,
|
|
20
35
|
} = {}) {
|
|
21
36
|
this.__type__ = "mem"
|
|
22
37
|
this._init = init
|
|
23
|
-
this.
|
|
24
|
-
this.Decompressor = Decompressor
|
|
38
|
+
this.Waosm = Waosm
|
|
25
39
|
this.isInit = false
|
|
26
40
|
this.keyInit = false
|
|
27
41
|
this.keys = {}
|
|
@@ -58,10 +72,12 @@ export default class ArMemBase {
|
|
|
58
72
|
if (key === "env") {
|
|
59
73
|
let memory = val.memory
|
|
60
74
|
try {
|
|
61
|
-
memory =
|
|
75
|
+
memory = this.waosm.compress(val.memory)
|
|
62
76
|
} catch (e) {
|
|
77
|
+
console.log(e)
|
|
63
78
|
memory = compress(val.memory)
|
|
64
79
|
}
|
|
80
|
+
this[key][field].original_size = val.memory.length
|
|
65
81
|
await this.db.put(
|
|
66
82
|
`${key}.${field}`,
|
|
67
83
|
assoc("memory", memory, this[key][field]),
|
|
@@ -154,8 +170,7 @@ export default class ArMemBase {
|
|
|
154
170
|
if (this.isInit) return
|
|
155
171
|
this.isInit = true
|
|
156
172
|
if (typeof this._init === "function") await this._init()
|
|
157
|
-
this.
|
|
158
|
-
this.decompressor = new this.Decompressor()
|
|
173
|
+
this.waosm = new this.Waosm()
|
|
159
174
|
if (this.db) {
|
|
160
175
|
for (const v of ["height", "blocks"]) this[v] = await this.get(v)
|
|
161
176
|
for (const v of [
|
|
@@ -177,10 +192,12 @@ export default class ArMemBase {
|
|
|
177
192
|
if (key === v) {
|
|
178
193
|
if (key.match(/^env/)) {
|
|
179
194
|
let v3 = await this.db.get(v2)
|
|
180
|
-
if (is(
|
|
195
|
+
if (is(Uint8Array, v3.memory)) {
|
|
181
196
|
try {
|
|
182
|
-
v3.memory = this.
|
|
197
|
+
v3.memory = this.waosm.decompress(v3.memory, v3.original_size)
|
|
198
|
+
console.log(v3)
|
|
183
199
|
} catch (e) {
|
|
200
|
+
console.log(e)
|
|
184
201
|
v3.memory = decompress(v3.memory)
|
|
185
202
|
}
|
|
186
203
|
}
|
package/esm/armem-web.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import wdb from "./lua/weavedb-lite.js"
|
|
2
2
|
import Base from "./armem-base.js"
|
|
3
3
|
import db from "./lfdb.js"
|
|
4
|
-
import init, {
|
|
4
|
+
import init, { Waosm } from "./waosm/waosm.js"
|
|
5
5
|
|
|
6
6
|
export default class ArMem extends Base {
|
|
7
7
|
constructor(args = {}) {
|
|
8
|
-
super({ ...args, init,
|
|
8
|
+
super({ ...args, init, Waosm })
|
|
9
9
|
this.db = db(this)
|
|
10
10
|
this.initSync()
|
|
11
11
|
}
|
package/esm/armem.js
CHANGED
|
@@ -5,12 +5,12 @@ import { open } from "lmdb"
|
|
|
5
5
|
import { readFileSync } from "fs"
|
|
6
6
|
import { resolve } from "path"
|
|
7
7
|
import Base from "./armem-base.js"
|
|
8
|
-
import {
|
|
8
|
+
import { Waosm } from "./waosm-node.js"
|
|
9
9
|
|
|
10
10
|
export default class ArMem extends Base {
|
|
11
11
|
constructor(args = {}) {
|
|
12
12
|
const { cache } = args
|
|
13
|
-
super({ ...args,
|
|
13
|
+
super({ ...args, Waosm })
|
|
14
14
|
if (cache) this.db = open({ path: cache, compression: true })
|
|
15
15
|
this.initSync()
|
|
16
16
|
}
|
package/esm/bao.js
CHANGED
|
@@ -50,6 +50,7 @@ class AO extends MAO {
|
|
|
50
50
|
constructor(opt = {}) {
|
|
51
51
|
super({ ...opt, in_memory: true })
|
|
52
52
|
this.in_memory = true
|
|
53
|
+
this.createDataItemSigner = opt.createDataItemSigner ?? createDataItemSigner
|
|
53
54
|
const {
|
|
54
55
|
modules,
|
|
55
56
|
results,
|
|
@@ -111,8 +112,7 @@ class AO extends MAO {
|
|
|
111
112
|
"Memory-Limit": "1-gb",
|
|
112
113
|
"Compute-Limit": "9000000000000",
|
|
113
114
|
})
|
|
114
|
-
|
|
115
|
-
const signer = createDataItemSigner(jwk)
|
|
115
|
+
const signer = this.createDataItemSigner(jwk)
|
|
116
116
|
const { id, owner, item } = await this.ar.dataitem({
|
|
117
117
|
tags: t,
|
|
118
118
|
data,
|
package/esm/compress.js
CHANGED
package/esm/wao.js
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import BAO from "./bao.js"
|
|
2
2
|
import { connect } from "./aoconnect-web.js"
|
|
3
3
|
import AR from "./war.js"
|
|
4
|
+
import * as WarpArBundles from "warp-arbundles"
|
|
5
|
+
const pkg = WarpArBundles.default ?? WarpArBundles
|
|
6
|
+
const { createData, ArweaveSigner } = pkg
|
|
7
|
+
|
|
8
|
+
function createDataItemSigner(wallet) {
|
|
9
|
+
const signer = async ({ data, tags, target, anchor }) => {
|
|
10
|
+
const signer = new ArweaveSigner(wallet)
|
|
11
|
+
const dataItem = createData(data, signer, { tags, target, anchor })
|
|
12
|
+
const sig = dataItem.sign(signer).then(async () => {
|
|
13
|
+
return {
|
|
14
|
+
id: await dataItem.id,
|
|
15
|
+
raw: await dataItem.getRaw(),
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
return sig
|
|
19
|
+
}
|
|
20
|
+
return signer
|
|
21
|
+
}
|
|
4
22
|
|
|
5
23
|
class AO extends BAO {
|
|
6
24
|
constructor(opt = {}) {
|
|
7
|
-
super({ ...opt, connect, AR })
|
|
25
|
+
super({ ...opt, connect, AR, createDataItemSigner })
|
|
8
26
|
}
|
|
9
27
|
}
|
|
10
28
|
|
package/esm/waosm/README.md
CHANGED
|
@@ -11,13 +11,17 @@ yarn build
|
|
|
11
11
|
Using Waosm in nodejs.
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import
|
|
14
|
+
import { Compressor, Decompressor } from "../src/waosm-node.js"
|
|
15
15
|
|
|
16
16
|
const main = async ()=>{
|
|
17
|
-
await init()
|
|
18
17
|
const compressor = new Compressor()
|
|
19
18
|
const decompressor = new Decompressor()
|
|
20
|
-
const memory = new Uint8Array(
|
|
19
|
+
const memory = new Uint8Array(
|
|
20
|
+
[
|
|
21
|
+
1, 2, 3, 4, 5, 5, 5, 6, 7, 8, 9, 0, 0, 0,
|
|
22
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
23
|
+
]
|
|
24
|
+
)
|
|
21
25
|
console.log(memory)
|
|
22
26
|
const compressed = compressor.compress(memory)
|
|
23
27
|
console.log(compressed)
|
package/esm/waosm/waosm.d.ts
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export class
|
|
3
|
+
export class Waosm {
|
|
4
4
|
free(): void;
|
|
5
5
|
constructor();
|
|
6
6
|
compress(data: Uint8Array): Uint8Array;
|
|
7
|
-
|
|
8
|
-
export class Decompressor {
|
|
9
|
-
free(): void;
|
|
10
|
-
constructor();
|
|
11
|
-
decompress(data: Uint8Array): Uint8Array;
|
|
7
|
+
decompress(data: Uint8Array, decompressed_size: number): Uint8Array;
|
|
12
8
|
}
|
|
13
9
|
|
|
14
10
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
15
11
|
|
|
16
12
|
export interface InitOutput {
|
|
17
13
|
readonly memory: WebAssembly.Memory;
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly __wbg_decompressor_free: (a: number, b: number) => void;
|
|
23
|
-
readonly decompressor_new: () => number;
|
|
14
|
+
readonly __wbg_waosm_free: (a: number, b: number) => void;
|
|
15
|
+
readonly waosm_new: () => number;
|
|
16
|
+
readonly waosm_compress: (a: number, b: number, c: number) => number;
|
|
17
|
+
readonly waosm_decompress: (a: number, b: number, c: number, d: number) => number;
|
|
24
18
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
25
19
|
}
|
|
26
20
|
|
package/esm/waosm/waosm.js
CHANGED
|
@@ -56,27 +56,27 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
56
56
|
return ptr;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const
|
|
59
|
+
const WaosmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
60
60
|
? { register: () => {}, unregister: () => {} }
|
|
61
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
61
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_waosm_free(ptr >>> 0, 1));
|
|
62
62
|
|
|
63
|
-
export class
|
|
63
|
+
export class Waosm {
|
|
64
64
|
|
|
65
65
|
__destroy_into_raw() {
|
|
66
66
|
const ptr = this.__wbg_ptr;
|
|
67
67
|
this.__wbg_ptr = 0;
|
|
68
|
-
|
|
68
|
+
WaosmFinalization.unregister(this);
|
|
69
69
|
return ptr;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
free() {
|
|
73
73
|
const ptr = this.__destroy_into_raw();
|
|
74
|
-
wasm.
|
|
74
|
+
wasm.__wbg_waosm_free(ptr, 0);
|
|
75
75
|
}
|
|
76
76
|
constructor() {
|
|
77
|
-
const ret = wasm.
|
|
77
|
+
const ret = wasm.waosm_new();
|
|
78
78
|
this.__wbg_ptr = ret >>> 0;
|
|
79
|
-
|
|
79
|
+
WaosmFinalization.register(this, this.__wbg_ptr, this);
|
|
80
80
|
return this;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
@@ -86,42 +86,18 @@ export class Compressor {
|
|
|
86
86
|
compress(data) {
|
|
87
87
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
88
88
|
const len0 = WASM_VECTOR_LEN;
|
|
89
|
-
const ret = wasm.
|
|
89
|
+
const ret = wasm.waosm_compress(this.__wbg_ptr, ptr0, len0);
|
|
90
90
|
return takeObject(ret);
|
|
91
91
|
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const DecompressorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
95
|
-
? { register: () => {}, unregister: () => {} }
|
|
96
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_decompressor_free(ptr >>> 0, 1));
|
|
97
|
-
|
|
98
|
-
export class Decompressor {
|
|
99
|
-
|
|
100
|
-
__destroy_into_raw() {
|
|
101
|
-
const ptr = this.__wbg_ptr;
|
|
102
|
-
this.__wbg_ptr = 0;
|
|
103
|
-
DecompressorFinalization.unregister(this);
|
|
104
|
-
return ptr;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
free() {
|
|
108
|
-
const ptr = this.__destroy_into_raw();
|
|
109
|
-
wasm.__wbg_decompressor_free(ptr, 0);
|
|
110
|
-
}
|
|
111
|
-
constructor() {
|
|
112
|
-
const ret = wasm.compressor_new();
|
|
113
|
-
this.__wbg_ptr = ret >>> 0;
|
|
114
|
-
DecompressorFinalization.register(this, this.__wbg_ptr, this);
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
92
|
/**
|
|
118
93
|
* @param {Uint8Array} data
|
|
94
|
+
* @param {number} decompressed_size
|
|
119
95
|
* @returns {Uint8Array}
|
|
120
96
|
*/
|
|
121
|
-
decompress(data) {
|
|
97
|
+
decompress(data, decompressed_size) {
|
|
122
98
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
123
99
|
const len0 = WASM_VECTOR_LEN;
|
|
124
|
-
const ret = wasm.
|
|
100
|
+
const ret = wasm.waosm_decompress(this.__wbg_ptr, ptr0, len0, decompressed_size);
|
|
125
101
|
return takeObject(ret);
|
|
126
102
|
}
|
|
127
103
|
}
|
package/esm/waosm/waosm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const __wbg_decompressor_free: (a: number, b: number) => void;
|
|
9
|
-
export const decompressor_new: () => number;
|
|
4
|
+
export const __wbg_waosm_free: (a: number, b: number) => void;
|
|
5
|
+
export const waosm_new: () => number;
|
|
6
|
+
export const waosm_compress: (a: number, b: number, c: number) => number;
|
|
7
|
+
export const waosm_decompress: (a: number, b: number, c: number, d: number) => number;
|
|
10
8
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
package/esm/waosm-node/README.md
CHANGED
|
@@ -11,13 +11,17 @@ yarn build
|
|
|
11
11
|
Using Waosm in nodejs.
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import
|
|
14
|
+
import { Compressor, Decompressor } from "../src/waosm-node.js"
|
|
15
15
|
|
|
16
16
|
const main = async ()=>{
|
|
17
|
-
await init()
|
|
18
17
|
const compressor = new Compressor()
|
|
19
18
|
const decompressor = new Decompressor()
|
|
20
|
-
const memory = new Uint8Array(
|
|
19
|
+
const memory = new Uint8Array(
|
|
20
|
+
[
|
|
21
|
+
1, 2, 3, 4, 5, 5, 5, 6, 7, 8, 9, 0, 0, 0,
|
|
22
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
23
|
+
]
|
|
24
|
+
)
|
|
21
25
|
console.log(memory)
|
|
22
26
|
const compressed = compressor.compress(memory)
|
|
23
27
|
console.log(compressed)
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export class
|
|
3
|
+
export class Waosm {
|
|
4
4
|
free(): void;
|
|
5
5
|
constructor();
|
|
6
6
|
compress(data: Uint8Array): Uint8Array;
|
|
7
|
-
|
|
8
|
-
export class Decompressor {
|
|
9
|
-
free(): void;
|
|
10
|
-
constructor();
|
|
11
|
-
decompress(data: Uint8Array): Uint8Array;
|
|
7
|
+
decompress(data: Uint8Array, decompressed_size: number): Uint8Array;
|
|
12
8
|
}
|
|
@@ -62,27 +62,27 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
62
62
|
return ptr;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const
|
|
65
|
+
const WaosmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
66
66
|
? { register: () => {}, unregister: () => {} }
|
|
67
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
67
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_waosm_free(ptr >>> 0, 1));
|
|
68
68
|
|
|
69
|
-
export class
|
|
69
|
+
export class Waosm {
|
|
70
70
|
|
|
71
71
|
__destroy_into_raw() {
|
|
72
72
|
const ptr = this.__wbg_ptr;
|
|
73
73
|
this.__wbg_ptr = 0;
|
|
74
|
-
|
|
74
|
+
WaosmFinalization.unregister(this);
|
|
75
75
|
return ptr;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
free() {
|
|
79
79
|
const ptr = this.__destroy_into_raw();
|
|
80
|
-
wasm.
|
|
80
|
+
wasm.__wbg_waosm_free(ptr, 0);
|
|
81
81
|
}
|
|
82
82
|
constructor() {
|
|
83
|
-
const ret = wasm.
|
|
83
|
+
const ret = wasm.waosm_new();
|
|
84
84
|
this.__wbg_ptr = ret >>> 0;
|
|
85
|
-
|
|
85
|
+
WaosmFinalization.register(this, this.__wbg_ptr, this);
|
|
86
86
|
return this;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
@@ -92,42 +92,18 @@ export class Compressor {
|
|
|
92
92
|
compress(data) {
|
|
93
93
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
94
94
|
const len0 = WASM_VECTOR_LEN;
|
|
95
|
-
const ret = wasm.
|
|
95
|
+
const ret = wasm.waosm_compress(this.__wbg_ptr, ptr0, len0);
|
|
96
96
|
return takeObject(ret);
|
|
97
97
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const DecompressorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
101
|
-
? { register: () => {}, unregister: () => {} }
|
|
102
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_decompressor_free(ptr >>> 0, 1));
|
|
103
|
-
|
|
104
|
-
export class Decompressor {
|
|
105
|
-
|
|
106
|
-
__destroy_into_raw() {
|
|
107
|
-
const ptr = this.__wbg_ptr;
|
|
108
|
-
this.__wbg_ptr = 0;
|
|
109
|
-
DecompressorFinalization.unregister(this);
|
|
110
|
-
return ptr;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
free() {
|
|
114
|
-
const ptr = this.__destroy_into_raw();
|
|
115
|
-
wasm.__wbg_decompressor_free(ptr, 0);
|
|
116
|
-
}
|
|
117
|
-
constructor() {
|
|
118
|
-
const ret = wasm.compressor_new();
|
|
119
|
-
this.__wbg_ptr = ret >>> 0;
|
|
120
|
-
DecompressorFinalization.register(this, this.__wbg_ptr, this);
|
|
121
|
-
return this;
|
|
122
|
-
}
|
|
123
98
|
/**
|
|
124
99
|
* @param {Uint8Array} data
|
|
100
|
+
* @param {number} decompressed_size
|
|
125
101
|
* @returns {Uint8Array}
|
|
126
102
|
*/
|
|
127
|
-
decompress(data) {
|
|
103
|
+
decompress(data, decompressed_size) {
|
|
128
104
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
129
105
|
const len0 = WASM_VECTOR_LEN;
|
|
130
|
-
const ret = wasm.
|
|
106
|
+
const ret = wasm.waosm_decompress(this.__wbg_ptr, ptr0, len0, decompressed_size);
|
|
131
107
|
return takeObject(ret);
|
|
132
108
|
}
|
|
133
109
|
}
|
|
Binary file
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const __wbg_decompressor_free: (a: number, b: number) => void;
|
|
9
|
-
export const decompressor_new: () => number;
|
|
4
|
+
export const __wbg_waosm_free: (a: number, b: number) => void;
|
|
5
|
+
export const waosm_new: () => number;
|
|
6
|
+
export const waosm_compress: (a: number, b: number, c: number) => number;
|
|
7
|
+
export const waosm_decompress: (a: number, b: number, c: number, d: number) => number;
|
|
10
8
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|