merfix 0.1.15
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 +23 -0
- package/merfix.d.ts +62 -0
- package/merfix.js +377 -0
- package/merfix_bg.wasm +0 -0
- package/package.json +15 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# merfix
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
### Install wasm-pack
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Available functions
|
|
12
|
+
|
|
13
|
+
| Function | Description | Arguments |
|
|
14
|
+
|------------------------------|------------------------------------------------------------|--------------------|
|
|
15
|
+
| ```supported_mime_types``` | Returns list of library supported mime types | None |
|
|
16
|
+
| ```supported_extensions``` | Returns list of library supported file extensions | None |
|
|
17
|
+
| ```detect_image_mime_type``` | Detects image mime type based on data content of the image | Uint8Array |
|
|
18
|
+
| ```detect_image_extension``` | Detects image extension based on data content of the image | Uint8Array |
|
|
19
|
+
| ```remove_exif``` | Removes all the EXIF metadata from the image | Uint8Array, String |
|
|
20
|
+
|
|
21
|
+
## JavaScript Integration
|
|
22
|
+
|
|
23
|
+
```TODO```
|
package/merfix.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export function supported_mime_types(): any[];
|
|
4
|
+
export function supported_extensions(): any[];
|
|
5
|
+
export function detect_image_mime_type(data: Uint8Array): string | undefined;
|
|
6
|
+
export function detect_image_extension(data: Uint8Array): string | undefined;
|
|
7
|
+
export function remove_exif(input: Uint8Array, extension: string): ExifRemovalResult;
|
|
8
|
+
export enum ExifRemovalStatus {
|
|
9
|
+
Success = 0,
|
|
10
|
+
Error = 1,
|
|
11
|
+
}
|
|
12
|
+
export class ExifRemovalResult {
|
|
13
|
+
private constructor();
|
|
14
|
+
free(): void;
|
|
15
|
+
status(): string;
|
|
16
|
+
is_error(): boolean;
|
|
17
|
+
get_data(): Uint8Array | undefined;
|
|
18
|
+
get_error(): string | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
22
|
+
|
|
23
|
+
export interface InitOutput {
|
|
24
|
+
readonly memory: WebAssembly.Memory;
|
|
25
|
+
readonly __wbg_exifremovalresult_free: (a: number, b: number) => void;
|
|
26
|
+
readonly exifremovalresult_status: (a: number) => [number, number];
|
|
27
|
+
readonly exifremovalresult_is_error: (a: number) => number;
|
|
28
|
+
readonly exifremovalresult_get_data: (a: number) => [number, number];
|
|
29
|
+
readonly exifremovalresult_get_error: (a: number) => [number, number];
|
|
30
|
+
readonly supported_mime_types: () => [number, number];
|
|
31
|
+
readonly supported_extensions: () => [number, number];
|
|
32
|
+
readonly detect_image_mime_type: (a: number, b: number) => [number, number];
|
|
33
|
+
readonly detect_image_extension: (a: number, b: number) => [number, number];
|
|
34
|
+
readonly remove_exif: (a: number, b: number, c: number, d: number) => number;
|
|
35
|
+
readonly __wbindgen_export_0: WebAssembly.Table;
|
|
36
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
37
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
38
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
39
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
40
|
+
readonly __wbindgen_start: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
44
|
+
/**
|
|
45
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
46
|
+
* a precompiled `WebAssembly.Module`.
|
|
47
|
+
*
|
|
48
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
49
|
+
*
|
|
50
|
+
* @returns {InitOutput}
|
|
51
|
+
*/
|
|
52
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
56
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
57
|
+
*
|
|
58
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
59
|
+
*
|
|
60
|
+
* @returns {Promise<InitOutput>}
|
|
61
|
+
*/
|
|
62
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/merfix.js
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
4
|
+
|
|
5
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
|
+
|
|
7
|
+
let cachedUint8ArrayMemory0 = null;
|
|
8
|
+
|
|
9
|
+
function getUint8ArrayMemory0() {
|
|
10
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
11
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
+
}
|
|
13
|
+
return cachedUint8ArrayMemory0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getStringFromWasm0(ptr, len) {
|
|
17
|
+
ptr = ptr >>> 0;
|
|
18
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
22
|
+
ptr = ptr >>> 0;
|
|
23
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let cachedDataViewMemory0 = null;
|
|
27
|
+
|
|
28
|
+
function getDataViewMemory0() {
|
|
29
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
30
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
31
|
+
}
|
|
32
|
+
return cachedDataViewMemory0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
36
|
+
ptr = ptr >>> 0;
|
|
37
|
+
const mem = getDataViewMemory0();
|
|
38
|
+
const result = [];
|
|
39
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
40
|
+
result.push(wasm.__wbindgen_export_0.get(mem.getUint32(i, true)));
|
|
41
|
+
}
|
|
42
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @returns {any[]}
|
|
47
|
+
*/
|
|
48
|
+
export function supported_mime_types() {
|
|
49
|
+
const ret = wasm.supported_mime_types();
|
|
50
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
51
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
52
|
+
return v1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @returns {any[]}
|
|
57
|
+
*/
|
|
58
|
+
export function supported_extensions() {
|
|
59
|
+
const ret = wasm.supported_extensions();
|
|
60
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
61
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
62
|
+
return v1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let WASM_VECTOR_LEN = 0;
|
|
66
|
+
|
|
67
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
68
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
69
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
70
|
+
WASM_VECTOR_LEN = arg.length;
|
|
71
|
+
return ptr;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @param {Uint8Array} data
|
|
75
|
+
* @returns {string | undefined}
|
|
76
|
+
*/
|
|
77
|
+
export function detect_image_mime_type(data) {
|
|
78
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
79
|
+
const len0 = WASM_VECTOR_LEN;
|
|
80
|
+
const ret = wasm.detect_image_mime_type(ptr0, len0);
|
|
81
|
+
let v2;
|
|
82
|
+
if (ret[0] !== 0) {
|
|
83
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
84
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
85
|
+
}
|
|
86
|
+
return v2;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @param {Uint8Array} data
|
|
91
|
+
* @returns {string | undefined}
|
|
92
|
+
*/
|
|
93
|
+
export function detect_image_extension(data) {
|
|
94
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
95
|
+
const len0 = WASM_VECTOR_LEN;
|
|
96
|
+
const ret = wasm.detect_image_extension(ptr0, len0);
|
|
97
|
+
let v2;
|
|
98
|
+
if (ret[0] !== 0) {
|
|
99
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
100
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
101
|
+
}
|
|
102
|
+
return v2;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
106
|
+
|
|
107
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
108
|
+
? function (arg, view) {
|
|
109
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
110
|
+
}
|
|
111
|
+
: function (arg, view) {
|
|
112
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
113
|
+
view.set(buf);
|
|
114
|
+
return {
|
|
115
|
+
read: arg.length,
|
|
116
|
+
written: buf.length
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
121
|
+
|
|
122
|
+
if (realloc === undefined) {
|
|
123
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
124
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
125
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
126
|
+
WASM_VECTOR_LEN = buf.length;
|
|
127
|
+
return ptr;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
let len = arg.length;
|
|
131
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
132
|
+
|
|
133
|
+
const mem = getUint8ArrayMemory0();
|
|
134
|
+
|
|
135
|
+
let offset = 0;
|
|
136
|
+
|
|
137
|
+
for (; offset < len; offset++) {
|
|
138
|
+
const code = arg.charCodeAt(offset);
|
|
139
|
+
if (code > 0x7F) break;
|
|
140
|
+
mem[ptr + offset] = code;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (offset !== len) {
|
|
144
|
+
if (offset !== 0) {
|
|
145
|
+
arg = arg.slice(offset);
|
|
146
|
+
}
|
|
147
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
148
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
149
|
+
const ret = encodeString(arg, view);
|
|
150
|
+
|
|
151
|
+
offset += ret.written;
|
|
152
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
WASM_VECTOR_LEN = offset;
|
|
156
|
+
return ptr;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @param {Uint8Array} input
|
|
160
|
+
* @param {string} extension
|
|
161
|
+
* @returns {ExifRemovalResult}
|
|
162
|
+
*/
|
|
163
|
+
export function remove_exif(input, extension) {
|
|
164
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
165
|
+
const len0 = WASM_VECTOR_LEN;
|
|
166
|
+
const ptr1 = passStringToWasm0(extension, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
167
|
+
const len1 = WASM_VECTOR_LEN;
|
|
168
|
+
const ret = wasm.remove_exif(ptr0, len0, ptr1, len1);
|
|
169
|
+
return ExifRemovalResult.__wrap(ret);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @enum {0 | 1}
|
|
174
|
+
*/
|
|
175
|
+
export const ExifRemovalStatus = Object.freeze({
|
|
176
|
+
Success: 0, "0": "Success",
|
|
177
|
+
Error: 1, "1": "Error",
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const ExifRemovalResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
181
|
+
? { register: () => {}, unregister: () => {} }
|
|
182
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_exifremovalresult_free(ptr >>> 0, 1));
|
|
183
|
+
|
|
184
|
+
export class ExifRemovalResult {
|
|
185
|
+
|
|
186
|
+
static __wrap(ptr) {
|
|
187
|
+
ptr = ptr >>> 0;
|
|
188
|
+
const obj = Object.create(ExifRemovalResult.prototype);
|
|
189
|
+
obj.__wbg_ptr = ptr;
|
|
190
|
+
ExifRemovalResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
191
|
+
return obj;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
__destroy_into_raw() {
|
|
195
|
+
const ptr = this.__wbg_ptr;
|
|
196
|
+
this.__wbg_ptr = 0;
|
|
197
|
+
ExifRemovalResultFinalization.unregister(this);
|
|
198
|
+
return ptr;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
free() {
|
|
202
|
+
const ptr = this.__destroy_into_raw();
|
|
203
|
+
wasm.__wbg_exifremovalresult_free(ptr, 0);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* @returns {string}
|
|
207
|
+
*/
|
|
208
|
+
status() {
|
|
209
|
+
let deferred1_0;
|
|
210
|
+
let deferred1_1;
|
|
211
|
+
try {
|
|
212
|
+
const ret = wasm.exifremovalresult_status(this.__wbg_ptr);
|
|
213
|
+
deferred1_0 = ret[0];
|
|
214
|
+
deferred1_1 = ret[1];
|
|
215
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
216
|
+
} finally {
|
|
217
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* @returns {boolean}
|
|
222
|
+
*/
|
|
223
|
+
is_error() {
|
|
224
|
+
const ret = wasm.exifremovalresult_is_error(this.__wbg_ptr);
|
|
225
|
+
return ret !== 0;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @returns {Uint8Array | undefined}
|
|
229
|
+
*/
|
|
230
|
+
get_data() {
|
|
231
|
+
const ret = wasm.exifremovalresult_get_data(this.__wbg_ptr);
|
|
232
|
+
let v1;
|
|
233
|
+
if (ret[0] !== 0) {
|
|
234
|
+
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
235
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
236
|
+
}
|
|
237
|
+
return v1;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* @returns {string | undefined}
|
|
241
|
+
*/
|
|
242
|
+
get_error() {
|
|
243
|
+
const ret = wasm.exifremovalresult_get_error(this.__wbg_ptr);
|
|
244
|
+
let v1;
|
|
245
|
+
if (ret[0] !== 0) {
|
|
246
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
247
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
248
|
+
}
|
|
249
|
+
return v1;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
async function __wbg_load(module, imports) {
|
|
254
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
255
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
256
|
+
try {
|
|
257
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
258
|
+
|
|
259
|
+
} catch (e) {
|
|
260
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
261
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
262
|
+
|
|
263
|
+
} else {
|
|
264
|
+
throw e;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const bytes = await module.arrayBuffer();
|
|
270
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
271
|
+
|
|
272
|
+
} else {
|
|
273
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
274
|
+
|
|
275
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
276
|
+
return { instance, module };
|
|
277
|
+
|
|
278
|
+
} else {
|
|
279
|
+
return instance;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function __wbg_get_imports() {
|
|
285
|
+
const imports = {};
|
|
286
|
+
imports.wbg = {};
|
|
287
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
288
|
+
const table = wasm.__wbindgen_export_0;
|
|
289
|
+
const offset = table.grow(4);
|
|
290
|
+
table.set(0, undefined);
|
|
291
|
+
table.set(offset + 0, undefined);
|
|
292
|
+
table.set(offset + 1, null);
|
|
293
|
+
table.set(offset + 2, true);
|
|
294
|
+
table.set(offset + 3, false);
|
|
295
|
+
;
|
|
296
|
+
};
|
|
297
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
298
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
299
|
+
return ret;
|
|
300
|
+
};
|
|
301
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
302
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
return imports;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function __wbg_init_memory(imports, memory) {
|
|
309
|
+
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function __wbg_finalize_init(instance, module) {
|
|
313
|
+
wasm = instance.exports;
|
|
314
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
315
|
+
cachedDataViewMemory0 = null;
|
|
316
|
+
cachedUint8ArrayMemory0 = null;
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
wasm.__wbindgen_start();
|
|
320
|
+
return wasm;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function initSync(module) {
|
|
324
|
+
if (wasm !== undefined) return wasm;
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
if (typeof module !== 'undefined') {
|
|
328
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
329
|
+
({module} = module)
|
|
330
|
+
} else {
|
|
331
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const imports = __wbg_get_imports();
|
|
336
|
+
|
|
337
|
+
__wbg_init_memory(imports);
|
|
338
|
+
|
|
339
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
340
|
+
module = new WebAssembly.Module(module);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
344
|
+
|
|
345
|
+
return __wbg_finalize_init(instance, module);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
async function __wbg_init(module_or_path) {
|
|
349
|
+
if (wasm !== undefined) return wasm;
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
if (typeof module_or_path !== 'undefined') {
|
|
353
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
354
|
+
({module_or_path} = module_or_path)
|
|
355
|
+
} else {
|
|
356
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (typeof module_or_path === 'undefined') {
|
|
361
|
+
module_or_path = new URL('merfix_bg.wasm', import.meta.url);
|
|
362
|
+
}
|
|
363
|
+
const imports = __wbg_get_imports();
|
|
364
|
+
|
|
365
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
366
|
+
module_or_path = fetch(module_or_path);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
__wbg_init_memory(imports);
|
|
370
|
+
|
|
371
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
372
|
+
|
|
373
|
+
return __wbg_finalize_init(instance, module);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export { initSync };
|
|
377
|
+
export default __wbg_init;
|
package/merfix_bg.wasm
ADDED
|
Binary file
|
package/package.json
ADDED