|
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) |
6 | 7 |
|
7 |
| -const heap = new Array(128).fill(undefined); |
| 8 | +heap.push(undefined, null, true, false) |
8 | 9 |
|
9 |
| -heap.push(undefined, null, true, false); |
10 |
| - |
11 |
| -function getObject(idx) { return heap[idx]; } |
| 10 | +function getObject(idx) { |
| 11 | + return heap[idx] |
| 12 | +} |
12 | 13 |
|
13 |
| -let heap_next = heap.length; |
| 14 | +let heap_next = heap.length |
14 | 15 |
|
15 | 16 | function addHeapObject(obj) {
|
16 |
| - if (heap_next === heap.length) heap.push(heap.length + 1); |
17 |
| - const idx = heap_next; |
18 |
| - heap_next = heap[idx]; |
| 17 | + if (heap_next === heap.length) heap.push(heap.length + 1) |
| 18 | + const idx = heap_next |
| 19 | + heap_next = heap[idx] |
19 | 20 |
|
20 |
| - heap[idx] = obj; |
21 |
| - return idx; |
| 21 | + heap[idx] = obj |
| 22 | + return idx |
22 | 23 | }
|
23 | 24 |
|
24 | 25 | function dropObject(idx) {
|
25 |
| - if (idx < 132) return; |
26 |
| - heap[idx] = heap_next; |
27 |
| - heap_next = idx; |
| 26 | + if (idx < 132) return |
| 27 | + heap[idx] = heap_next |
| 28 | + heap_next = idx |
28 | 29 | }
|
29 | 30 |
|
30 | 31 | function takeObject(idx) {
|
31 |
| - const ret = getObject(idx); |
32 |
| - dropObject(idx); |
33 |
| - return ret; |
| 32 | + const ret = getObject(idx) |
| 33 | + dropObject(idx) |
| 34 | + return ret |
34 | 35 | }
|
35 | 36 |
|
36 |
| -const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; |
| 37 | +const lTextDecoder = |
| 38 | + typeof TextDecoder === "undefined" |
| 39 | + ? (0, module.require)("util").TextDecoder |
| 40 | + : TextDecoder |
37 | 41 |
|
38 |
| -let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); |
| 42 | +let cachedTextDecoder = new lTextDecoder("utf-8", { |
| 43 | + ignoreBOM: true, |
| 44 | + fatal: true, |
| 45 | +}) |
39 | 46 |
|
40 |
| -cachedTextDecoder.decode(); |
| 47 | +cachedTextDecoder.decode() |
41 | 48 |
|
42 |
| -let cachedUint8ArrayMemory0 = null; |
| 49 | +let cachedUint8ArrayMemory0 = null |
43 | 50 |
|
44 | 51 | function getUint8ArrayMemory0() {
|
45 |
| - if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { |
46 |
| - cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); |
47 |
| - } |
48 |
| - return cachedUint8ArrayMemory0; |
| 52 | + if ( |
| 53 | + cachedUint8ArrayMemory0 === null || |
| 54 | + cachedUint8ArrayMemory0.byteLength === 0 |
| 55 | + ) { |
| 56 | + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer) |
| 57 | + } |
| 58 | + return cachedUint8ArrayMemory0 |
49 | 59 | }
|
50 | 60 |
|
51 | 61 | function getStringFromWasm0(ptr, len) {
|
52 |
| - ptr = ptr >>> 0; |
53 |
| - return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); |
| 62 | + ptr = ptr >>> 0 |
| 63 | + return cachedTextDecoder.decode( |
| 64 | + getUint8ArrayMemory0().subarray(ptr, ptr + len) |
| 65 | + ) |
54 | 66 | }
|
55 | 67 |
|
56 |
| -let WASM_VECTOR_LEN = 0; |
| 68 | +let WASM_VECTOR_LEN = 0 |
57 | 69 |
|
58 | 70 | function passArray8ToWasm0(arg, malloc) {
|
59 |
| - const ptr = malloc(arg.length * 1, 1) >>> 0; |
60 |
| - getUint8ArrayMemory0().set(arg, ptr / 1); |
61 |
| - WASM_VECTOR_LEN = arg.length; |
62 |
| - return ptr; |
| 71 | + const ptr = malloc(arg.length * 1, 1) >>> 0 |
| 72 | + getUint8ArrayMemory0().set(arg, ptr / 1) |
| 73 | + WASM_VECTOR_LEN = arg.length |
| 74 | + return ptr |
63 | 75 | }
|
64 | 76 |
|
65 |
| -const WaosmFinalization = (typeof FinalizationRegistry === 'undefined') |
| 77 | +const WaosmFinalization = |
| 78 | + typeof FinalizationRegistry === "undefined" |
66 | 79 | ? { register: () => {}, unregister: () => {} }
|
67 |
| - : new FinalizationRegistry(ptr => wasm.__wbg_waosm_free(ptr >>> 0, 1)); |
| 80 | + : new FinalizationRegistry(ptr => wasm.__wbg_waosm_free(ptr >>> 0, 1)) |
68 | 81 |
|
69 | 82 | export class Waosm {
|
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 |
| - } |
| 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 | + } |
109 | 126 | }
|
110 | 127 |
|
111 | 128 | export function __wbg_buffer_609cc3eee51ed158(arg0) {
|
112 |
| - const ret = getObject(arg0).buffer; |
113 |
| - return addHeapObject(ret); |
114 |
| -}; |
| 129 | + const ret = getObject(arg0).buffer |
| 130 | + return addHeapObject(ret) |
| 131 | +} |
115 | 132 |
|
116 | 133 | export function __wbg_length_a446193dc22c12f8(arg0) {
|
117 |
| - const ret = getObject(arg0).length; |
118 |
| - return ret; |
119 |
| -}; |
| 134 | + const ret = getObject(arg0).length |
| 135 | + return ret |
| 136 | +} |
120 | 137 |
|
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 |
| -}; |
| 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 | +} |
125 | 146 |
|
126 | 147 | export function __wbg_newwithlength_a381634e90c276d4(arg0) {
|
127 |
| - const ret = new Uint8Array(arg0 >>> 0); |
128 |
| - return addHeapObject(ret); |
129 |
| -}; |
| 148 | + const ret = new Uint8Array(arg0 >>> 0) |
| 149 | + return addHeapObject(ret) |
| 150 | +} |
130 | 151 |
|
131 | 152 | export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
132 |
| - getObject(arg0).set(getObject(arg1), arg2 >>> 0); |
133 |
| -}; |
| 153 | + getObject(arg0).set(getObject(arg1), arg2 >>> 0) |
| 154 | +} |
134 | 155 |
|
135 | 156 | export function __wbindgen_memory() {
|
136 |
| - const ret = wasm.memory; |
137 |
| - return addHeapObject(ret); |
138 |
| -}; |
| 157 | + const ret = wasm.memory |
| 158 | + return addHeapObject(ret) |
| 159 | +} |
139 | 160 |
|
140 | 161 | export function __wbindgen_object_drop_ref(arg0) {
|
141 |
| - takeObject(arg0); |
142 |
| -}; |
| 162 | + takeObject(arg0) |
| 163 | +} |
143 | 164 |
|
144 | 165 | export function __wbindgen_throw(arg0, arg1) {
|
145 |
| - throw new Error(getStringFromWasm0(arg0, arg1)); |
146 |
| -}; |
147 |
| - |
| 166 | + throw new Error(getStringFromWasm0(arg0, arg1)) |
| 167 | +} |
0 commit comments