mq-nodejs 0.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.
@@ -0,0 +1,651 @@
1
+ /* @ts-self-types="./mq_wasm.d.ts" */
2
+
3
+ class ConversionOptions {
4
+ __destroy_into_raw() {
5
+ const ptr = this.__wbg_ptr;
6
+ this.__wbg_ptr = 0;
7
+ ConversionOptionsFinalization.unregister(this);
8
+ return ptr;
9
+ }
10
+ free() {
11
+ const ptr = this.__destroy_into_raw();
12
+ wasm.__wbg_conversionoptions_free(ptr, 0);
13
+ }
14
+ /**
15
+ * @returns {boolean}
16
+ */
17
+ get extract_scripts_as_code_blocks() {
18
+ const ret = wasm.__wbg_get_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr);
19
+ return ret !== 0;
20
+ }
21
+ /**
22
+ * @returns {boolean}
23
+ */
24
+ get generate_front_matter() {
25
+ const ret = wasm.__wbg_get_conversionoptions_generate_front_matter(this.__wbg_ptr);
26
+ return ret !== 0;
27
+ }
28
+ /**
29
+ * @returns {boolean}
30
+ */
31
+ get use_title_as_h1() {
32
+ const ret = wasm.__wbg_get_conversionoptions_use_title_as_h1(this.__wbg_ptr);
33
+ return ret !== 0;
34
+ }
35
+ /**
36
+ * @param {boolean} arg0
37
+ */
38
+ set extract_scripts_as_code_blocks(arg0) {
39
+ wasm.__wbg_set_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr, arg0);
40
+ }
41
+ /**
42
+ * @param {boolean} arg0
43
+ */
44
+ set generate_front_matter(arg0) {
45
+ wasm.__wbg_set_conversionoptions_generate_front_matter(this.__wbg_ptr, arg0);
46
+ }
47
+ /**
48
+ * @param {boolean} arg0
49
+ */
50
+ set use_title_as_h1(arg0) {
51
+ wasm.__wbg_set_conversionoptions_use_title_as_h1(this.__wbg_ptr, arg0);
52
+ }
53
+ }
54
+ if (Symbol.dispose) ConversionOptions.prototype[Symbol.dispose] = ConversionOptions.prototype.free;
55
+ exports.ConversionOptions = ConversionOptions;
56
+
57
+ class RunOptions {
58
+ __destroy_into_raw() {
59
+ const ptr = this.__wbg_ptr;
60
+ this.__wbg_ptr = 0;
61
+ RunOptionsFinalization.unregister(this);
62
+ return ptr;
63
+ }
64
+ free() {
65
+ const ptr = this.__destroy_into_raw();
66
+ wasm.__wbg_runoptions_free(ptr, 0);
67
+ }
68
+ }
69
+ if (Symbol.dispose) RunOptions.prototype[Symbol.dispose] = RunOptions.prototype.free;
70
+ exports.RunOptions = RunOptions;
71
+
72
+ /**
73
+ * @param {string} code
74
+ * @param {string | null} [module]
75
+ * @returns {Promise<any>}
76
+ */
77
+ function definedValues(code, module) {
78
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
79
+ const len0 = WASM_VECTOR_LEN;
80
+ var ptr1 = isLikeNone(module) ? 0 : passStringToWasm0(module, wasm.__wbindgen_export, wasm.__wbindgen_export2);
81
+ var len1 = WASM_VECTOR_LEN;
82
+ const ret = wasm.definedValues(ptr0, len0, ptr1, len1);
83
+ return takeObject(ret);
84
+ }
85
+ exports.definedValues = definedValues;
86
+
87
+ /**
88
+ * @param {string} code
89
+ * @param {boolean | null} [enable_type_check]
90
+ * @returns {Promise<any>}
91
+ */
92
+ function diagnostics(code, enable_type_check) {
93
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
94
+ const len0 = WASM_VECTOR_LEN;
95
+ const ret = wasm.diagnostics(ptr0, len0, isLikeNone(enable_type_check) ? 0xFFFFFF : enable_type_check ? 1 : 0);
96
+ return takeObject(ret);
97
+ }
98
+ exports.diagnostics = diagnostics;
99
+
100
+ /**
101
+ * @param {string} code
102
+ * @returns {Promise<string>}
103
+ */
104
+ function format(code) {
105
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
106
+ const len0 = WASM_VECTOR_LEN;
107
+ const ret = wasm.format(ptr0, len0);
108
+ return takeObject(ret);
109
+ }
110
+ exports.format = format;
111
+
112
+ /**
113
+ * @param {string} html_input
114
+ * @param {ConversionOptions | null} [options]
115
+ * @returns {Promise<string>}
116
+ */
117
+ function htmlToMarkdown(html_input, options) {
118
+ const ptr0 = passStringToWasm0(html_input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
119
+ const len0 = WASM_VECTOR_LEN;
120
+ let ptr1 = 0;
121
+ if (!isLikeNone(options)) {
122
+ _assertClass(options, ConversionOptions);
123
+ ptr1 = options.__destroy_into_raw();
124
+ }
125
+ const ret = wasm.htmlToMarkdown(ptr0, len0, ptr1);
126
+ return takeObject(ret);
127
+ }
128
+ exports.htmlToMarkdown = htmlToMarkdown;
129
+
130
+ /**
131
+ * @param {string} code
132
+ * @returns {Promise<any>}
133
+ */
134
+ function inlayHints(code) {
135
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
136
+ const len0 = WASM_VECTOR_LEN;
137
+ const ret = wasm.inlayHints(ptr0, len0);
138
+ return takeObject(ret);
139
+ }
140
+ exports.inlayHints = inlayHints;
141
+
142
+ /**
143
+ * @param {string} code
144
+ * @param {string} content
145
+ * @param {any} options
146
+ * @returns {Promise<string>}
147
+ */
148
+ function run(code, content, options) {
149
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
150
+ const len0 = WASM_VECTOR_LEN;
151
+ const ptr1 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
152
+ const len1 = WASM_VECTOR_LEN;
153
+ const ret = wasm.run(ptr0, len0, ptr1, len1, addHeapObject(options));
154
+ return takeObject(ret);
155
+ }
156
+ exports.run = run;
157
+
158
+ /**
159
+ * @param {string} code
160
+ * @returns {Promise<string>}
161
+ */
162
+ function toAst(code) {
163
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
164
+ const len0 = WASM_VECTOR_LEN;
165
+ const ret = wasm.toAst(ptr0, len0);
166
+ return takeObject(ret);
167
+ }
168
+ exports.toAst = toAst;
169
+
170
+ /**
171
+ * @param {string} markdown_input
172
+ * @returns {Promise<string>}
173
+ */
174
+ function toHtml(markdown_input) {
175
+ const ptr0 = passStringToWasm0(markdown_input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
176
+ const len0 = WASM_VECTOR_LEN;
177
+ const ret = wasm.toHtml(ptr0, len0);
178
+ return takeObject(ret);
179
+ }
180
+ exports.toHtml = toHtml;
181
+
182
+ function __wbg_get_imports() {
183
+ const import0 = {
184
+ __proto__: null,
185
+ __wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
186
+ const ret = Error(getStringFromWasm0(arg0, arg1));
187
+ return addHeapObject(ret);
188
+ },
189
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
190
+ const ret = String(getObject(arg1));
191
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
192
+ const len1 = WASM_VECTOR_LEN;
193
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
194
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
195
+ },
196
+ __wbg___wbindgen_boolean_get_a86c216575a75c30: function(arg0) {
197
+ const v = getObject(arg0);
198
+ const ret = typeof(v) === 'boolean' ? v : undefined;
199
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
200
+ },
201
+ __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
202
+ const ret = debugString(getObject(arg1));
203
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
204
+ const len1 = WASM_VECTOR_LEN;
205
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
206
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
207
+ },
208
+ __wbg___wbindgen_in_4bd7a57e54337366: function(arg0, arg1) {
209
+ const ret = getObject(arg0) in getObject(arg1);
210
+ return ret;
211
+ },
212
+ __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
213
+ const ret = typeof(getObject(arg0)) === 'function';
214
+ return ret;
215
+ },
216
+ __wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {
217
+ const val = getObject(arg0);
218
+ const ret = typeof(val) === 'object' && val !== null;
219
+ return ret;
220
+ },
221
+ __wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
222
+ const ret = typeof(getObject(arg0)) === 'string';
223
+ return ret;
224
+ },
225
+ __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
226
+ const ret = getObject(arg0) === undefined;
227
+ return ret;
228
+ },
229
+ __wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944: function(arg0, arg1) {
230
+ const ret = getObject(arg0) == getObject(arg1);
231
+ return ret;
232
+ },
233
+ __wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
234
+ const obj = getObject(arg1);
235
+ const ret = typeof(obj) === 'number' ? obj : undefined;
236
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
237
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
238
+ },
239
+ __wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
240
+ const obj = getObject(arg1);
241
+ const ret = typeof(obj) === 'string' ? obj : undefined;
242
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
243
+ var len1 = WASM_VECTOR_LEN;
244
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
245
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
246
+ },
247
+ __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
248
+ throw new Error(getStringFromWasm0(arg0, arg1));
249
+ },
250
+ __wbg__wbg_cb_unref_3c3b4f651835fbcb: function(arg0) {
251
+ getObject(arg0)._wbg_cb_unref();
252
+ },
253
+ __wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {
254
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
255
+ return addHeapObject(ret);
256
+ }, arguments); },
257
+ __wbg_entries_616b1a459b85be0b: function(arg0) {
258
+ const ret = Object.entries(getObject(arg0));
259
+ return addHeapObject(ret);
260
+ },
261
+ __wbg_get_4848e350b40afc16: function(arg0, arg1) {
262
+ const ret = getObject(arg0)[arg1 >>> 0];
263
+ return addHeapObject(ret);
264
+ },
265
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
266
+ const ret = getObject(arg0)[getObject(arg1)];
267
+ return addHeapObject(ret);
268
+ },
269
+ __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a: function(arg0) {
270
+ let result;
271
+ try {
272
+ result = getObject(arg0) instanceof ArrayBuffer;
273
+ } catch (_) {
274
+ result = false;
275
+ }
276
+ const ret = result;
277
+ return ret;
278
+ },
279
+ __wbg_instanceof_Uint8Array_4b8da683deb25d72: function(arg0) {
280
+ let result;
281
+ try {
282
+ result = getObject(arg0) instanceof Uint8Array;
283
+ } catch (_) {
284
+ result = false;
285
+ }
286
+ const ret = result;
287
+ return ret;
288
+ },
289
+ __wbg_length_0c32cb8543c8e4c8: function(arg0) {
290
+ const ret = getObject(arg0).length;
291
+ return ret;
292
+ },
293
+ __wbg_length_6e821edde497a532: function(arg0) {
294
+ const ret = getObject(arg0).length;
295
+ return ret;
296
+ },
297
+ __wbg_new_4f9fafbb3909af72: function() {
298
+ const ret = new Object();
299
+ return addHeapObject(ret);
300
+ },
301
+ __wbg_new_a560378ea1240b14: function(arg0) {
302
+ const ret = new Uint8Array(getObject(arg0));
303
+ return addHeapObject(ret);
304
+ },
305
+ __wbg_new_f3c9df4f38f3f798: function() {
306
+ const ret = new Array();
307
+ return addHeapObject(ret);
308
+ },
309
+ __wbg_new_typed_14d7cc391ce53d2c: function(arg0, arg1) {
310
+ try {
311
+ var state0 = {a: arg0, b: arg1};
312
+ var cb0 = (arg0, arg1) => {
313
+ const a = state0.a;
314
+ state0.a = 0;
315
+ try {
316
+ return __wasm_bindgen_func_elem_985(a, state0.b, arg0, arg1);
317
+ } finally {
318
+ state0.a = a;
319
+ }
320
+ };
321
+ const ret = new Promise(cb0);
322
+ return addHeapObject(ret);
323
+ } finally {
324
+ state0.a = 0;
325
+ }
326
+ },
327
+ __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
328
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
329
+ },
330
+ __wbg_queueMicrotask_abaf92f0bd4e80a4: function(arg0) {
331
+ const ret = getObject(arg0).queueMicrotask;
332
+ return addHeapObject(ret);
333
+ },
334
+ __wbg_queueMicrotask_df5a6dac26d818f3: function(arg0) {
335
+ queueMicrotask(getObject(arg0));
336
+ },
337
+ __wbg_resolve_0a79de24e9d2267b: function(arg0) {
338
+ const ret = Promise.resolve(getObject(arg0));
339
+ return addHeapObject(ret);
340
+ },
341
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
342
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
343
+ },
344
+ __wbg_set_6c60b2e8ad0e9383: function(arg0, arg1, arg2) {
345
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
346
+ },
347
+ __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
348
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
349
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
350
+ },
351
+ __wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
352
+ const ret = typeof global === 'undefined' ? null : global;
353
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
354
+ },
355
+ __wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
356
+ const ret = typeof self === 'undefined' ? null : self;
357
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
358
+ },
359
+ __wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
360
+ const ret = typeof window === 'undefined' ? null : window;
361
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
362
+ },
363
+ __wbg_then_a0c8db0381c8994c: function(arg0, arg1) {
364
+ const ret = getObject(arg0).then(getObject(arg1));
365
+ return addHeapObject(ret);
366
+ },
367
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
368
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 88, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
369
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_689);
370
+ return addHeapObject(ret);
371
+ },
372
+ __wbindgen_cast_0000000000000002: function(arg0) {
373
+ // Cast intrinsic for `F64 -> Externref`.
374
+ const ret = arg0;
375
+ return addHeapObject(ret);
376
+ },
377
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
378
+ // Cast intrinsic for `Ref(String) -> Externref`.
379
+ const ret = getStringFromWasm0(arg0, arg1);
380
+ return addHeapObject(ret);
381
+ },
382
+ __wbindgen_object_clone_ref: function(arg0) {
383
+ const ret = getObject(arg0);
384
+ return addHeapObject(ret);
385
+ },
386
+ __wbindgen_object_drop_ref: function(arg0) {
387
+ takeObject(arg0);
388
+ },
389
+ };
390
+ return {
391
+ __proto__: null,
392
+ "./mq_wasm_bg.js": import0,
393
+ };
394
+ }
395
+
396
+ function __wasm_bindgen_func_elem_689(arg0, arg1, arg2) {
397
+ try {
398
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
399
+ wasm.__wasm_bindgen_func_elem_689(retptr, arg0, arg1, addHeapObject(arg2));
400
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
401
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
402
+ if (r1) {
403
+ throw takeObject(r0);
404
+ }
405
+ } finally {
406
+ wasm.__wbindgen_add_to_stack_pointer(16);
407
+ }
408
+ }
409
+
410
+ function __wasm_bindgen_func_elem_985(arg0, arg1, arg2, arg3) {
411
+ wasm.__wasm_bindgen_func_elem_985(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
412
+ }
413
+
414
+ const ConversionOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
415
+ ? { register: () => {}, unregister: () => {} }
416
+ : new FinalizationRegistry(ptr => wasm.__wbg_conversionoptions_free(ptr >>> 0, 1));
417
+ const RunOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
418
+ ? { register: () => {}, unregister: () => {} }
419
+ : new FinalizationRegistry(ptr => wasm.__wbg_runoptions_free(ptr >>> 0, 1));
420
+
421
+ function addHeapObject(obj) {
422
+ if (heap_next === heap.length) heap.push(heap.length + 1);
423
+ const idx = heap_next;
424
+ heap_next = heap[idx];
425
+
426
+ heap[idx] = obj;
427
+ return idx;
428
+ }
429
+
430
+ function _assertClass(instance, klass) {
431
+ if (!(instance instanceof klass)) {
432
+ throw new Error(`expected instance of ${klass.name}`);
433
+ }
434
+ }
435
+
436
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
437
+ ? { register: () => {}, unregister: () => {} }
438
+ : new FinalizationRegistry(state => wasm.__wbindgen_export4(state.a, state.b));
439
+
440
+ function debugString(val) {
441
+ // primitive types
442
+ const type = typeof val;
443
+ if (type == 'number' || type == 'boolean' || val == null) {
444
+ return `${val}`;
445
+ }
446
+ if (type == 'string') {
447
+ return `"${val}"`;
448
+ }
449
+ if (type == 'symbol') {
450
+ const description = val.description;
451
+ if (description == null) {
452
+ return 'Symbol';
453
+ } else {
454
+ return `Symbol(${description})`;
455
+ }
456
+ }
457
+ if (type == 'function') {
458
+ const name = val.name;
459
+ if (typeof name == 'string' && name.length > 0) {
460
+ return `Function(${name})`;
461
+ } else {
462
+ return 'Function';
463
+ }
464
+ }
465
+ // objects
466
+ if (Array.isArray(val)) {
467
+ const length = val.length;
468
+ let debug = '[';
469
+ if (length > 0) {
470
+ debug += debugString(val[0]);
471
+ }
472
+ for(let i = 1; i < length; i++) {
473
+ debug += ', ' + debugString(val[i]);
474
+ }
475
+ debug += ']';
476
+ return debug;
477
+ }
478
+ // Test for built-in
479
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
480
+ let className;
481
+ if (builtInMatches && builtInMatches.length > 1) {
482
+ className = builtInMatches[1];
483
+ } else {
484
+ // Failed to match the standard '[object ClassName]'
485
+ return toString.call(val);
486
+ }
487
+ if (className == 'Object') {
488
+ // we're a user defined class or Object
489
+ // JSON.stringify avoids problems with cycles, and is generally much
490
+ // easier than looping through ownProperties of `val`.
491
+ try {
492
+ return 'Object(' + JSON.stringify(val) + ')';
493
+ } catch (_) {
494
+ return 'Object';
495
+ }
496
+ }
497
+ // errors
498
+ if (val instanceof Error) {
499
+ return `${val.name}: ${val.message}\n${val.stack}`;
500
+ }
501
+ // TODO we could test for more things here, like `Set`s and `Map`s.
502
+ return className;
503
+ }
504
+
505
+ function dropObject(idx) {
506
+ if (idx < 1028) return;
507
+ heap[idx] = heap_next;
508
+ heap_next = idx;
509
+ }
510
+
511
+ function getArrayU8FromWasm0(ptr, len) {
512
+ ptr = ptr >>> 0;
513
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
514
+ }
515
+
516
+ let cachedDataViewMemory0 = null;
517
+ function getDataViewMemory0() {
518
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
519
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
520
+ }
521
+ return cachedDataViewMemory0;
522
+ }
523
+
524
+ function getStringFromWasm0(ptr, len) {
525
+ ptr = ptr >>> 0;
526
+ return decodeText(ptr, len);
527
+ }
528
+
529
+ let cachedUint8ArrayMemory0 = null;
530
+ function getUint8ArrayMemory0() {
531
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
532
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
533
+ }
534
+ return cachedUint8ArrayMemory0;
535
+ }
536
+
537
+ function getObject(idx) { return heap[idx]; }
538
+
539
+ function handleError(f, args) {
540
+ try {
541
+ return f.apply(this, args);
542
+ } catch (e) {
543
+ wasm.__wbindgen_export3(addHeapObject(e));
544
+ }
545
+ }
546
+
547
+ let heap = new Array(1024).fill(undefined);
548
+ heap.push(undefined, null, true, false);
549
+
550
+ let heap_next = heap.length;
551
+
552
+ function isLikeNone(x) {
553
+ return x === undefined || x === null;
554
+ }
555
+
556
+ function makeMutClosure(arg0, arg1, f) {
557
+ const state = { a: arg0, b: arg1, cnt: 1 };
558
+ const real = (...args) => {
559
+
560
+ // First up with a closure we increment the internal reference
561
+ // count. This ensures that the Rust closure environment won't
562
+ // be deallocated while we're invoking it.
563
+ state.cnt++;
564
+ const a = state.a;
565
+ state.a = 0;
566
+ try {
567
+ return f(a, state.b, ...args);
568
+ } finally {
569
+ state.a = a;
570
+ real._wbg_cb_unref();
571
+ }
572
+ };
573
+ real._wbg_cb_unref = () => {
574
+ if (--state.cnt === 0) {
575
+ wasm.__wbindgen_export4(state.a, state.b);
576
+ state.a = 0;
577
+ CLOSURE_DTORS.unregister(state);
578
+ }
579
+ };
580
+ CLOSURE_DTORS.register(real, state, state);
581
+ return real;
582
+ }
583
+
584
+ function passStringToWasm0(arg, malloc, realloc) {
585
+ if (realloc === undefined) {
586
+ const buf = cachedTextEncoder.encode(arg);
587
+ const ptr = malloc(buf.length, 1) >>> 0;
588
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
589
+ WASM_VECTOR_LEN = buf.length;
590
+ return ptr;
591
+ }
592
+
593
+ let len = arg.length;
594
+ let ptr = malloc(len, 1) >>> 0;
595
+
596
+ const mem = getUint8ArrayMemory0();
597
+
598
+ let offset = 0;
599
+
600
+ for (; offset < len; offset++) {
601
+ const code = arg.charCodeAt(offset);
602
+ if (code > 0x7F) break;
603
+ mem[ptr + offset] = code;
604
+ }
605
+ if (offset !== len) {
606
+ if (offset !== 0) {
607
+ arg = arg.slice(offset);
608
+ }
609
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
610
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
611
+ const ret = cachedTextEncoder.encodeInto(arg, view);
612
+
613
+ offset += ret.written;
614
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
615
+ }
616
+
617
+ WASM_VECTOR_LEN = offset;
618
+ return ptr;
619
+ }
620
+
621
+ function takeObject(idx) {
622
+ const ret = getObject(idx);
623
+ dropObject(idx);
624
+ return ret;
625
+ }
626
+
627
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
628
+ cachedTextDecoder.decode();
629
+ function decodeText(ptr, len) {
630
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
631
+ }
632
+
633
+ const cachedTextEncoder = new TextEncoder();
634
+
635
+ if (!('encodeInto' in cachedTextEncoder)) {
636
+ cachedTextEncoder.encodeInto = function (arg, view) {
637
+ const buf = cachedTextEncoder.encode(arg);
638
+ view.set(buf);
639
+ return {
640
+ read: arg.length,
641
+ written: buf.length
642
+ };
643
+ };
644
+ }
645
+
646
+ let WASM_VECTOR_LEN = 0;
647
+
648
+ const wasmPath = `${__dirname}/mq_wasm_bg.wasm`;
649
+ const wasmBytes = require('fs').readFileSync(wasmPath);
650
+ const wasmModule = new WebAssembly.Module(wasmBytes);
651
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;