|
1 |
| -let wasm |
| 1 | +let wasm; |
2 | 2 | export function __wbg_set_wasm(val) {
|
3 |
| - wasm = val |
| 3 | + wasm = val; |
4 | 4 | }
|
5 | 5 |
|
6 |
| -const heap = new Array(128).fill(undefined) |
7 | 6 |
|
8 |
| -heap.push(undefined, null, true, false) |
| 7 | +const heap = new Array(128).fill(undefined); |
9 | 8 |
|
10 |
| -function getObject(idx) { |
11 |
| - return heap[idx] |
12 |
| -} |
| 9 | +heap.push(undefined, null, true, false); |
| 10 | + |
| 11 | +function getObject(idx) { return heap[idx]; } |
13 | 12 |
|
14 |
| -let heap_next = heap.length |
| 13 | +let heap_next = heap.length; |
15 | 14 |
|
16 | 15 | function addHeapObject(obj) {
|
17 |
| - if (heap_next === heap.length) heap.push(heap.length + 1) |
18 |
| - const idx = heap_next |
19 |
| - heap_next = heap[idx] |
| 16 | + if (heap_next === heap.length) heap.push(heap.length + 1); |
| 17 | + const idx = heap_next; |
| 18 | + heap_next = heap[idx]; |
20 | 19 |
|
21 |
| - heap[idx] = obj |
22 |
| - return idx |
| 20 | + heap[idx] = obj; |
| 21 | + return idx; |
23 | 22 | }
|
24 | 23 |
|
25 | 24 | function dropObject(idx) {
|
26 |
| - if (idx < 132) return |
27 |
| - heap[idx] = heap_next |
28 |
| - heap_next = idx |
| 25 | + if (idx < 132) return; |
| 26 | + heap[idx] = heap_next; |
| 27 | + heap_next = idx; |
29 | 28 | }
|
30 | 29 |
|
31 | 30 | function takeObject(idx) {
|
32 |
| - const ret = getObject(idx) |
33 |
| - dropObject(idx) |
34 |
| - return ret |
| 31 | + const ret = getObject(idx); |
| 32 | + dropObject(idx); |
| 33 | + return ret; |
35 | 34 | }
|
36 | 35 |
|
37 |
| -const lTextDecoder = |
38 |
| - typeof TextDecoder === "undefined" |
39 |
| - ? (0, module.require)("util").TextDecoder |
40 |
| - : TextDecoder |
| 36 | +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; |
41 | 37 |
|
42 |
| -let cachedTextDecoder = new lTextDecoder("utf-8", { |
43 |
| - ignoreBOM: true, |
44 |
| - fatal: true, |
45 |
| -}) |
| 38 | +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); |
46 | 39 |
|
47 |
| -cachedTextDecoder.decode() |
| 40 | +cachedTextDecoder.decode(); |
48 | 41 |
|
49 |
| -let cachedUint8ArrayMemory0 = null |
| 42 | +let cachedUint8ArrayMemory0 = null; |
50 | 43 |
|
51 | 44 | function getUint8ArrayMemory0() {
|
52 |
| - if ( |
53 |
| - cachedUint8ArrayMemory0 === null || |
54 |
| - cachedUint8ArrayMemory0.byteLength === 0 |
55 |
| - ) { |
56 |
| - cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer) |
57 |
| - } |
58 |
| - return cachedUint8ArrayMemory0 |
| 45 | + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { |
| 46 | + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); |
| 47 | + } |
| 48 | + return cachedUint8ArrayMemory0; |
59 | 49 | }
|
60 | 50 |
|
61 | 51 | function getStringFromWasm0(ptr, len) {
|
62 |
| - ptr = ptr >>> 0 |
63 |
| - return cachedTextDecoder.decode( |
64 |
| - getUint8ArrayMemory0().subarray(ptr, ptr + len) |
65 |
| - ) |
| 52 | + ptr = ptr >>> 0; |
| 53 | + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); |
66 | 54 | }
|
67 | 55 |
|
68 |
| -let WASM_VECTOR_LEN = 0 |
| 56 | +let WASM_VECTOR_LEN = 0; |
69 | 57 |
|
70 | 58 | function passArray8ToWasm0(arg, malloc) {
|
71 |
| - const ptr = malloc(arg.length * 1, 1) >>> 0 |
72 |
| - getUint8ArrayMemory0().set(arg, ptr / 1) |
73 |
| - WASM_VECTOR_LEN = arg.length |
74 |
| - return ptr |
| 59 | + const ptr = malloc(arg.length * 1, 1) >>> 0; |
| 60 | + getUint8ArrayMemory0().set(arg, ptr / 1); |
| 61 | + WASM_VECTOR_LEN = arg.length; |
| 62 | + return ptr; |
75 | 63 | }
|
76 | 64 |
|
77 |
| -const WaosmFinalization = |
78 |
| - typeof FinalizationRegistry === "undefined" |
| 65 | +const WaosmFinalization = (typeof FinalizationRegistry === 'undefined') |
79 | 66 | ? { register: () => {}, unregister: () => {} }
|
80 |
| - : new FinalizationRegistry(ptr => wasm.__wbg_waosm_free(ptr >>> 0, 1)) |
| 67 | + : new FinalizationRegistry(ptr => wasm.__wbg_waosm_free(ptr >>> 0, 1)); |
81 | 68 |
|
82 | 69 | export class Waosm {
|
83 |
| - __destroy_into_raw() { |
84 |
| - const ptr = this.__wbg_ptr |
85 |
| - this.__wbg_ptr = 0 |
86 |
| - WaosmFinalization.unregister(this) |
87 |
| - return ptr |
88 |
| - } |
89 |
| - |
90 |
| - free() { |
91 |
| - const ptr = this.__destroy_into_raw() |
92 |
| - wasm.__wbg_waosm_free(ptr, 0) |
93 |
| - } |
94 |
| - constructor() { |
95 |
| - const ret = wasm.waosm_new() |
96 |
| - this.__wbg_ptr = ret >>> 0 |
97 |
| - WaosmFinalization.register(this, this.__wbg_ptr, this) |
98 |
| - return this |
99 |
| - } |
100 |
| - /** |
101 |
| - * @param {Uint8Array} data |
102 |
| - * @returns {Uint8Array} |
103 |
| - */ |
104 |
| - compress(data) { |
105 |
| - const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc) |
106 |
| - const len0 = WASM_VECTOR_LEN |
107 |
| - const ret = wasm.waosm_compress(this.__wbg_ptr, ptr0, len0) |
108 |
| - return takeObject(ret) |
109 |
| - } |
110 |
| - /** |
111 |
| - * @param {Uint8Array} data |
112 |
| - * @param {number} decompressed_size |
113 |
| - * @returns {Uint8Array} |
114 |
| - */ |
115 |
| - decompress(data, decompressed_size) { |
116 |
| - const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc) |
117 |
| - const len0 = WASM_VECTOR_LEN |
118 |
| - const ret = wasm.waosm_decompress( |
119 |
| - this.__wbg_ptr, |
120 |
| - ptr0, |
121 |
| - len0, |
122 |
| - decompressed_size |
123 |
| - ) |
124 |
| - return takeObject(ret) |
125 |
| - } |
| 70 | + |
| 71 | + __destroy_into_raw() { |
| 72 | + const ptr = this.__wbg_ptr; |
| 73 | + this.__wbg_ptr = 0; |
| 74 | + WaosmFinalization.unregister(this); |
| 75 | + return ptr; |
| 76 | + } |
| 77 | + |
| 78 | + free() { |
| 79 | + const ptr = this.__destroy_into_raw(); |
| 80 | + wasm.__wbg_waosm_free(ptr, 0); |
| 81 | + } |
| 82 | + constructor() { |
| 83 | + const ret = wasm.waosm_new(); |
| 84 | + this.__wbg_ptr = ret >>> 0; |
| 85 | + WaosmFinalization.register(this, this.__wbg_ptr, this); |
| 86 | + return this; |
| 87 | + } |
| 88 | + /** |
| 89 | + * @param {Uint8Array} data |
| 90 | + * @returns {Uint8Array} |
| 91 | + */ |
| 92 | + compress(data) { |
| 93 | + const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc); |
| 94 | + const len0 = WASM_VECTOR_LEN; |
| 95 | + const ret = wasm.waosm_compress(this.__wbg_ptr, ptr0, len0); |
| 96 | + return takeObject(ret); |
| 97 | + } |
| 98 | + /** |
| 99 | + * @param {Uint8Array} data |
| 100 | + * @param {number} decompressed_size |
| 101 | + * @returns {Uint8Array} |
| 102 | + */ |
| 103 | + decompress(data, decompressed_size) { |
| 104 | + const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc); |
| 105 | + const len0 = WASM_VECTOR_LEN; |
| 106 | + const ret = wasm.waosm_decompress(this.__wbg_ptr, ptr0, len0, decompressed_size); |
| 107 | + return takeObject(ret); |
| 108 | + } |
126 | 109 | }
|
127 | 110 |
|
128 | 111 | export function __wbg_buffer_609cc3eee51ed158(arg0) {
|
129 |
| - const ret = getObject(arg0).buffer |
130 |
| - return addHeapObject(ret) |
131 |
| -} |
| 112 | + const ret = getObject(arg0).buffer; |
| 113 | + return addHeapObject(ret); |
| 114 | +}; |
132 | 115 |
|
133 | 116 | export function __wbg_length_a446193dc22c12f8(arg0) {
|
134 |
| - const ret = getObject(arg0).length |
135 |
| - return ret |
136 |
| -} |
| 117 | + const ret = getObject(arg0).length; |
| 118 | + return ret; |
| 119 | +}; |
137 | 120 |
|
138 |
| -export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a( |
139 |
| - arg0, |
140 |
| - arg1, |
141 |
| - arg2 |
142 |
| -) { |
143 |
| - const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0) |
144 |
| - return addHeapObject(ret) |
145 |
| -} |
| 121 | +export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) { |
| 122 | + const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); |
| 123 | + return addHeapObject(ret); |
| 124 | +}; |
146 | 125 |
|
147 | 126 | export function __wbg_newwithlength_a381634e90c276d4(arg0) {
|
148 |
| - const ret = new Uint8Array(arg0 >>> 0) |
149 |
| - return addHeapObject(ret) |
150 |
| -} |
| 127 | + const ret = new Uint8Array(arg0 >>> 0); |
| 128 | + return addHeapObject(ret); |
| 129 | +}; |
151 | 130 |
|
152 | 131 | export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
153 |
| - getObject(arg0).set(getObject(arg1), arg2 >>> 0) |
154 |
| -} |
| 132 | + getObject(arg0).set(getObject(arg1), arg2 >>> 0); |
| 133 | +}; |
155 | 134 |
|
156 | 135 | export function __wbindgen_memory() {
|
157 |
| - const ret = wasm.memory |
158 |
| - return addHeapObject(ret) |
159 |
| -} |
| 136 | + const ret = wasm.memory; |
| 137 | + return addHeapObject(ret); |
| 138 | +}; |
160 | 139 |
|
161 | 140 | export function __wbindgen_object_drop_ref(arg0) {
|
162 |
| - takeObject(arg0) |
163 |
| -} |
| 141 | + takeObject(arg0); |
| 142 | +}; |
164 | 143 |
|
165 | 144 | export function __wbindgen_throw(arg0, arg1) {
|
166 |
| - throw new Error(getStringFromWasm0(arg0, arg1)) |
167 |
| -} |
| 145 | + throw new Error(getStringFromWasm0(arg0, arg1)); |
| 146 | +}; |
| 147 | + |
0 commit comments