@ox-content/wasm 2.2.0 → 2.4.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.
@@ -1,17 +1,20 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /**
5
+ * Parser options.
6
+ */
4
7
  export class WasmParserOptions {
5
- free(): void;
6
- [Symbol.dispose](): void;
7
- constructor();
8
- set tables(value: boolean);
9
- set autolinks(value: boolean);
10
- set footnotes(value: boolean);
11
- set taskLists(value: boolean);
12
- set strikethrough(value: boolean);
13
- set tocMaxDepth(value: number);
14
- set gfm(value: boolean);
8
+ free(): void;
9
+ [Symbol.dispose](): void;
10
+ constructor();
11
+ set autolinks(value: boolean);
12
+ set footnotes(value: boolean);
13
+ set gfm(value: boolean);
14
+ set strikethrough(value: boolean);
15
+ set tables(value: boolean);
16
+ set taskLists(value: boolean);
17
+ set tocMaxDepth(value: number);
15
18
  }
16
19
 
17
20
  /**
@@ -32,43 +35,43 @@ export function version(): string;
32
35
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
33
36
 
34
37
  export interface InitOutput {
35
- readonly memory: WebAssembly.Memory;
36
- readonly __wbg_wasmparseroptions_free: (a: number, b: number) => void;
37
- readonly parseAndRender: (a: number, b: number, c: number) => number;
38
- readonly transform: (a: number, b: number, c: number) => number;
39
- readonly version: (a: number) => void;
40
- readonly wasmparseroptions_new: () => number;
41
- readonly wasmparseroptions_set_autolinks: (a: number, b: number) => void;
42
- readonly wasmparseroptions_set_footnotes: (a: number, b: number) => void;
43
- readonly wasmparseroptions_set_gfm: (a: number, b: number) => void;
44
- readonly wasmparseroptions_set_strikethrough: (a: number, b: number) => void;
45
- readonly wasmparseroptions_set_tables: (a: number, b: number) => void;
46
- readonly wasmparseroptions_set_task_lists: (a: number, b: number) => void;
47
- readonly wasmparseroptions_set_toc_max_depth: (a: number, b: number) => void;
48
- readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
49
- readonly __wbindgen_export: (a: number, b: number, c: number) => void;
50
- readonly __wbindgen_export2: (a: number, b: number) => number;
51
- readonly __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
38
+ readonly memory: WebAssembly.Memory;
39
+ readonly __wbg_wasmparseroptions_free: (a: number, b: number) => void;
40
+ readonly parseAndRender: (a: number, b: number, c: number) => number;
41
+ readonly transform: (a: number, b: number, c: number) => number;
42
+ readonly version: (a: number) => void;
43
+ readonly wasmparseroptions_new: () => number;
44
+ readonly wasmparseroptions_set_autolinks: (a: number, b: number) => void;
45
+ readonly wasmparseroptions_set_footnotes: (a: number, b: number) => void;
46
+ readonly wasmparseroptions_set_gfm: (a: number, b: number) => void;
47
+ readonly wasmparseroptions_set_strikethrough: (a: number, b: number) => void;
48
+ readonly wasmparseroptions_set_tables: (a: number, b: number) => void;
49
+ readonly wasmparseroptions_set_task_lists: (a: number, b: number) => void;
50
+ readonly wasmparseroptions_set_toc_max_depth: (a: number, b: number) => void;
51
+ readonly __wbindgen_export: (a: number, b: number) => number;
52
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
53
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
54
+ readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
52
55
  }
53
56
 
54
57
  export type SyncInitInput = BufferSource | WebAssembly.Module;
55
58
 
56
59
  /**
57
- * Instantiates the given `module`, which can either be bytes or
58
- * a precompiled `WebAssembly.Module`.
59
- *
60
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
61
- *
62
- * @returns {InitOutput}
63
- */
60
+ * Instantiates the given `module`, which can either be bytes or
61
+ * a precompiled `WebAssembly.Module`.
62
+ *
63
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
64
+ *
65
+ * @returns {InitOutput}
66
+ */
64
67
  export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
65
68
 
66
69
  /**
67
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
68
- * for everything else, calls `WebAssembly.instantiate` directly.
69
- *
70
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
71
- *
72
- * @returns {Promise<InitOutput>}
73
- */
70
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
71
+ * for everything else, calls `WebAssembly.instantiate` directly.
72
+ *
73
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
74
+ *
75
+ * @returns {Promise<InitOutput>}
76
+ */
74
77
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -1,4 +1,199 @@
1
- let wasm;
1
+ /* @ts-self-types="./ox_content_wasm.d.ts" */
2
+
3
+ /**
4
+ * Parser options.
5
+ */
6
+ export class WasmParserOptions {
7
+ __destroy_into_raw() {
8
+ const ptr = this.__wbg_ptr;
9
+ this.__wbg_ptr = 0;
10
+ WasmParserOptionsFinalization.unregister(this);
11
+ return ptr;
12
+ }
13
+ free() {
14
+ const ptr = this.__destroy_into_raw();
15
+ wasm.__wbg_wasmparseroptions_free(ptr, 0);
16
+ }
17
+ constructor() {
18
+ const ret = wasm.wasmparseroptions_new();
19
+ this.__wbg_ptr = ret >>> 0;
20
+ WasmParserOptionsFinalization.register(this, this.__wbg_ptr, this);
21
+ return this;
22
+ }
23
+ /**
24
+ * @param {boolean} value
25
+ */
26
+ set autolinks(value) {
27
+ wasm.wasmparseroptions_set_autolinks(this.__wbg_ptr, value);
28
+ }
29
+ /**
30
+ * @param {boolean} value
31
+ */
32
+ set footnotes(value) {
33
+ wasm.wasmparseroptions_set_footnotes(this.__wbg_ptr, value);
34
+ }
35
+ /**
36
+ * @param {boolean} value
37
+ */
38
+ set gfm(value) {
39
+ wasm.wasmparseroptions_set_gfm(this.__wbg_ptr, value);
40
+ }
41
+ /**
42
+ * @param {boolean} value
43
+ */
44
+ set strikethrough(value) {
45
+ wasm.wasmparseroptions_set_strikethrough(this.__wbg_ptr, value);
46
+ }
47
+ /**
48
+ * @param {boolean} value
49
+ */
50
+ set tables(value) {
51
+ wasm.wasmparseroptions_set_tables(this.__wbg_ptr, value);
52
+ }
53
+ /**
54
+ * @param {boolean} value
55
+ */
56
+ set taskLists(value) {
57
+ wasm.wasmparseroptions_set_task_lists(this.__wbg_ptr, value);
58
+ }
59
+ /**
60
+ * @param {number} value
61
+ */
62
+ set tocMaxDepth(value) {
63
+ wasm.wasmparseroptions_set_toc_max_depth(this.__wbg_ptr, value);
64
+ }
65
+ }
66
+ if (Symbol.dispose) WasmParserOptions.prototype[Symbol.dispose] = WasmParserOptions.prototype.free;
67
+
68
+ /**
69
+ * Parses Markdown and renders to HTML.
70
+ * @param {string} source
71
+ * @param {WasmParserOptions | null} [options]
72
+ * @returns {any}
73
+ */
74
+ export function parseAndRender(source, options) {
75
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
76
+ const len0 = WASM_VECTOR_LEN;
77
+ let ptr1 = 0;
78
+ if (!isLikeNone(options)) {
79
+ _assertClass(options, WasmParserOptions);
80
+ ptr1 = options.__destroy_into_raw();
81
+ }
82
+ const ret = wasm.parseAndRender(ptr0, len0, ptr1);
83
+ return takeObject(ret);
84
+ }
85
+
86
+ /**
87
+ * Transforms Markdown source into HTML, frontmatter, and TOC.
88
+ * @param {string} source
89
+ * @param {WasmParserOptions | null} [options]
90
+ * @returns {any}
91
+ */
92
+ export function transform(source, options) {
93
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
94
+ const len0 = WASM_VECTOR_LEN;
95
+ let ptr1 = 0;
96
+ if (!isLikeNone(options)) {
97
+ _assertClass(options, WasmParserOptions);
98
+ ptr1 = options.__destroy_into_raw();
99
+ }
100
+ const ret = wasm.transform(ptr0, len0, ptr1);
101
+ return takeObject(ret);
102
+ }
103
+
104
+ /**
105
+ * Returns the version of ox_content_wasm.
106
+ * @returns {string}
107
+ */
108
+ export function version() {
109
+ let deferred1_0;
110
+ let deferred1_1;
111
+ try {
112
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
113
+ wasm.version(retptr);
114
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
115
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
116
+ deferred1_0 = r0;
117
+ deferred1_1 = r1;
118
+ return getStringFromWasm0(r0, r1);
119
+ } finally {
120
+ wasm.__wbindgen_add_to_stack_pointer(16);
121
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
122
+ }
123
+ }
124
+ function __wbg_get_imports() {
125
+ const import0 = {
126
+ __proto__: null,
127
+ __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
128
+ const ret = Error(getStringFromWasm0(arg0, arg1));
129
+ return addHeapObject(ret);
130
+ },
131
+ __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
132
+ const ret = typeof(getObject(arg0)) === 'string';
133
+ return ret;
134
+ },
135
+ __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
136
+ throw new Error(getStringFromWasm0(arg0, arg1));
137
+ },
138
+ __wbg_new_34d45cc8e36aaead: function() {
139
+ const ret = new Map();
140
+ return addHeapObject(ret);
141
+ },
142
+ __wbg_new_682678e2f47e32bc: function() {
143
+ const ret = new Array();
144
+ return addHeapObject(ret);
145
+ },
146
+ __wbg_new_aa8d0fa9762c29bd: function() {
147
+ const ret = new Object();
148
+ return addHeapObject(ret);
149
+ },
150
+ __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
151
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
152
+ },
153
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
154
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
155
+ },
156
+ __wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
157
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
158
+ return addHeapObject(ret);
159
+ },
160
+ __wbindgen_cast_0000000000000001: function(arg0) {
161
+ // Cast intrinsic for `F64 -> Externref`.
162
+ const ret = arg0;
163
+ return addHeapObject(ret);
164
+ },
165
+ __wbindgen_cast_0000000000000002: function(arg0) {
166
+ // Cast intrinsic for `I64 -> Externref`.
167
+ const ret = arg0;
168
+ return addHeapObject(ret);
169
+ },
170
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
171
+ // Cast intrinsic for `Ref(String) -> Externref`.
172
+ const ret = getStringFromWasm0(arg0, arg1);
173
+ return addHeapObject(ret);
174
+ },
175
+ __wbindgen_cast_0000000000000004: function(arg0) {
176
+ // Cast intrinsic for `U64 -> Externref`.
177
+ const ret = BigInt.asUintN(64, arg0);
178
+ return addHeapObject(ret);
179
+ },
180
+ __wbindgen_object_clone_ref: function(arg0) {
181
+ const ret = getObject(arg0);
182
+ return addHeapObject(ret);
183
+ },
184
+ __wbindgen_object_drop_ref: function(arg0) {
185
+ takeObject(arg0);
186
+ },
187
+ };
188
+ return {
189
+ __proto__: null,
190
+ "./ox_content_wasm_bg.js": import0,
191
+ };
192
+ }
193
+
194
+ const WasmParserOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
195
+ ? { register: () => {}, unregister: () => {} }
196
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmparseroptions_free(ptr >>> 0, 1));
2
197
 
3
198
  function addHeapObject(obj) {
4
199
  if (heap_next === heap.length) heap.push(heap.length + 1);
@@ -16,7 +211,7 @@ function _assertClass(instance, klass) {
16
211
  }
17
212
 
18
213
  function dropObject(idx) {
19
- if (idx < 132) return;
214
+ if (idx < 1028) return;
20
215
  heap[idx] = heap_next;
21
216
  heap_next = idx;
22
217
  }
@@ -44,7 +239,7 @@ function getUint8ArrayMemory0() {
44
239
 
45
240
  function getObject(idx) { return heap[idx]; }
46
241
 
47
- let heap = new Array(128).fill(undefined);
242
+ let heap = new Array(1024).fill(undefined);
48
243
  heap.push(undefined, null, true, false);
49
244
 
50
245
  let heap_next = heap.length;
@@ -120,153 +315,32 @@ if (!('encodeInto' in cachedTextEncoder)) {
120
315
  read: arg.length,
121
316
  written: buf.length
122
317
  };
123
- }
318
+ };
124
319
  }
125
320
 
126
321
  let WASM_VECTOR_LEN = 0;
127
322
 
128
- const WasmParserOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
129
- ? { register: () => {}, unregister: () => {} }
130
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmparseroptions_free(ptr >>> 0, 1));
131
-
132
- /**
133
- * Parser options.
134
- */
135
- export class WasmParserOptions {
136
- __destroy_into_raw() {
137
- const ptr = this.__wbg_ptr;
138
- this.__wbg_ptr = 0;
139
- WasmParserOptionsFinalization.unregister(this);
140
- return ptr;
141
- }
142
- free() {
143
- const ptr = this.__destroy_into_raw();
144
- wasm.__wbg_wasmparseroptions_free(ptr, 0);
145
- }
146
- /**
147
- * @param {boolean} value
148
- */
149
- set tables(value) {
150
- wasm.wasmparseroptions_set_tables(this.__wbg_ptr, value);
151
- }
152
- /**
153
- * @param {boolean} value
154
- */
155
- set autolinks(value) {
156
- wasm.wasmparseroptions_set_autolinks(this.__wbg_ptr, value);
157
- }
158
- /**
159
- * @param {boolean} value
160
- */
161
- set footnotes(value) {
162
- wasm.wasmparseroptions_set_footnotes(this.__wbg_ptr, value);
163
- }
164
- /**
165
- * @param {boolean} value
166
- */
167
- set taskLists(value) {
168
- wasm.wasmparseroptions_set_task_lists(this.__wbg_ptr, value);
169
- }
170
- /**
171
- * @param {boolean} value
172
- */
173
- set strikethrough(value) {
174
- wasm.wasmparseroptions_set_strikethrough(this.__wbg_ptr, value);
175
- }
176
- /**
177
- * @param {number} value
178
- */
179
- set tocMaxDepth(value) {
180
- wasm.wasmparseroptions_set_toc_max_depth(this.__wbg_ptr, value);
181
- }
182
- constructor() {
183
- const ret = wasm.wasmparseroptions_new();
184
- this.__wbg_ptr = ret >>> 0;
185
- WasmParserOptionsFinalization.register(this, this.__wbg_ptr, this);
186
- return this;
187
- }
188
- /**
189
- * @param {boolean} value
190
- */
191
- set gfm(value) {
192
- wasm.wasmparseroptions_set_gfm(this.__wbg_ptr, value);
193
- }
194
- }
195
- if (Symbol.dispose) WasmParserOptions.prototype[Symbol.dispose] = WasmParserOptions.prototype.free;
196
-
197
- /**
198
- * Parses Markdown and renders to HTML.
199
- * @param {string} source
200
- * @param {WasmParserOptions | null} [options]
201
- * @returns {any}
202
- */
203
- export function parseAndRender(source, options) {
204
- const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
205
- const len0 = WASM_VECTOR_LEN;
206
- let ptr1 = 0;
207
- if (!isLikeNone(options)) {
208
- _assertClass(options, WasmParserOptions);
209
- ptr1 = options.__destroy_into_raw();
210
- }
211
- const ret = wasm.parseAndRender(ptr0, len0, ptr1);
212
- return takeObject(ret);
213
- }
214
-
215
- /**
216
- * Transforms Markdown source into HTML, frontmatter, and TOC.
217
- * @param {string} source
218
- * @param {WasmParserOptions | null} [options]
219
- * @returns {any}
220
- */
221
- export function transform(source, options) {
222
- const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
223
- const len0 = WASM_VECTOR_LEN;
224
- let ptr1 = 0;
225
- if (!isLikeNone(options)) {
226
- _assertClass(options, WasmParserOptions);
227
- ptr1 = options.__destroy_into_raw();
228
- }
229
- const ret = wasm.transform(ptr0, len0, ptr1);
230
- return takeObject(ret);
231
- }
232
-
233
- /**
234
- * Returns the version of ox_content_wasm.
235
- * @returns {string}
236
- */
237
- export function version() {
238
- let deferred1_0;
239
- let deferred1_1;
240
- try {
241
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
242
- wasm.version(retptr);
243
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
244
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
245
- deferred1_0 = r0;
246
- deferred1_1 = r1;
247
- return getStringFromWasm0(r0, r1);
248
- } finally {
249
- wasm.__wbindgen_add_to_stack_pointer(16);
250
- wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
251
- }
323
+ let wasmModule, wasm;
324
+ function __wbg_finalize_init(instance, module) {
325
+ wasm = instance.exports;
326
+ wasmModule = module;
327
+ cachedDataViewMemory0 = null;
328
+ cachedUint8ArrayMemory0 = null;
329
+ return wasm;
252
330
  }
253
331
 
254
- const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
255
-
256
332
  async function __wbg_load(module, imports) {
257
333
  if (typeof Response === 'function' && module instanceof Response) {
258
334
  if (typeof WebAssembly.instantiateStreaming === 'function') {
259
335
  try {
260
336
  return await WebAssembly.instantiateStreaming(module, imports);
261
337
  } catch (e) {
262
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
338
+ const validResponse = module.ok && expectedResponseType(module.type);
263
339
 
264
340
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
265
341
  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);
266
342
 
267
- } else {
268
- throw e;
269
- }
343
+ } else { throw e; }
270
344
  }
271
345
  }
272
346
 
@@ -281,91 +355,20 @@ async function __wbg_load(module, imports) {
281
355
  return instance;
282
356
  }
283
357
  }
284
- }
285
358
 
286
- function __wbg_get_imports() {
287
- const imports = {};
288
- imports.wbg = {};
289
- imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
290
- const ret = Error(getStringFromWasm0(arg0, arg1));
291
- return addHeapObject(ret);
292
- };
293
- imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
294
- const ret = typeof(getObject(arg0)) === 'string';
295
- return ret;
296
- };
297
- imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
298
- throw new Error(getStringFromWasm0(arg0, arg1));
299
- };
300
- imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
301
- const ret = new Object();
302
- return addHeapObject(ret);
303
- };
304
- imports.wbg.__wbg_new_25f239778d6112b9 = function() {
305
- const ret = new Array();
306
- return addHeapObject(ret);
307
- };
308
- imports.wbg.__wbg_new_b546ae120718850e = function() {
309
- const ret = new Map();
310
- return addHeapObject(ret);
311
- };
312
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
313
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
314
- };
315
- imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
316
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
317
- };
318
- imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
319
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
320
- return addHeapObject(ret);
321
- };
322
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
323
- // Cast intrinsic for `Ref(String) -> Externref`.
324
- const ret = getStringFromWasm0(arg0, arg1);
325
- return addHeapObject(ret);
326
- };
327
- imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
328
- // Cast intrinsic for `U64 -> Externref`.
329
- const ret = BigInt.asUintN(64, arg0);
330
- return addHeapObject(ret);
331
- };
332
- imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
333
- // Cast intrinsic for `I64 -> Externref`.
334
- const ret = arg0;
335
- return addHeapObject(ret);
336
- };
337
- imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
338
- // Cast intrinsic for `F64 -> Externref`.
339
- const ret = arg0;
340
- return addHeapObject(ret);
341
- };
342
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
343
- const ret = getObject(arg0);
344
- return addHeapObject(ret);
345
- };
346
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
347
- takeObject(arg0);
348
- };
349
-
350
- return imports;
351
- }
352
-
353
- function __wbg_finalize_init(instance, module) {
354
- wasm = instance.exports;
355
- __wbg_init.__wbindgen_wasm_module = module;
356
- cachedDataViewMemory0 = null;
357
- cachedUint8ArrayMemory0 = null;
358
-
359
-
360
-
361
- return wasm;
359
+ function expectedResponseType(type) {
360
+ switch (type) {
361
+ case 'basic': case 'cors': case 'default': return true;
362
+ }
363
+ return false;
364
+ }
362
365
  }
363
366
 
364
367
  function initSync(module) {
365
368
  if (wasm !== undefined) return wasm;
366
369
 
367
370
 
368
- if (typeof module !== 'undefined') {
371
+ if (module !== undefined) {
369
372
  if (Object.getPrototypeOf(module) === Object.prototype) {
370
373
  ({module} = module)
371
374
  } else {
@@ -385,7 +388,7 @@ async function __wbg_init(module_or_path) {
385
388
  if (wasm !== undefined) return wasm;
386
389
 
387
390
 
388
- if (typeof module_or_path !== 'undefined') {
391
+ if (module_or_path !== undefined) {
389
392
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
390
393
  ({module_or_path} = module_or_path)
391
394
  } else {
@@ -393,7 +396,7 @@ async function __wbg_init(module_or_path) {
393
396
  }
394
397
  }
395
398
 
396
- if (typeof module_or_path === 'undefined') {
399
+ if (module_or_path === undefined) {
397
400
  module_or_path = new URL('ox_content_wasm_bg.wasm', import.meta.url);
398
401
  }
399
402
  const imports = __wbg_get_imports();
@@ -407,5 +410,4 @@ async function __wbg_init(module_or_path) {
407
410
  return __wbg_finalize_init(instance, module);
408
411
  }
409
412
 
410
- export { initSync };
411
- export default __wbg_init;
413
+ export { initSync, __wbg_init as default };
Binary file
@@ -13,7 +13,7 @@ export const wasmparseroptions_set_strikethrough: (a: number, b: number) => void
13
13
  export const wasmparseroptions_set_tables: (a: number, b: number) => void;
14
14
  export const wasmparseroptions_set_task_lists: (a: number, b: number) => void;
15
15
  export const wasmparseroptions_set_toc_max_depth: (a: number, b: number) => void;
16
+ export const __wbindgen_export: (a: number, b: number) => number;
17
+ export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
16
18
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
17
- export const __wbindgen_export: (a: number, b: number, c: number) => void;
18
- export const __wbindgen_export2: (a: number, b: number) => number;
19
- export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
19
+ export const __wbindgen_export3: (a: number, b: number, c: number) => void;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ox-content/wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for Ox Content - Browser-ready Markdown parser",
5
- "version": "2.2.0",
5
+ "version": "2.4.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -37,4 +37,4 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  }
40
- }
40
+ }