html-to-markdown-wasm 2.9.1 → 2.10.1
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/dist/README.md +13 -13
- package/dist/html_to_markdown_wasm.d.ts +42 -41
- package/dist/html_to_markdown_wasm_bg.js +398 -416
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/package.json +1 -1
- package/dist-node/README.md +13 -13
- package/dist-node/html_to_markdown_wasm.d.ts +42 -41
- package/dist-node/html_to_markdown_wasm.js +402 -416
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/package.json +1 -1
- package/dist-web/README.md +13 -13
- package/dist-web/html_to_markdown_wasm.d.ts +43 -41
- package/dist-web/html_to_markdown_wasm.js +395 -417
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/package.json +1 -1
- package/package.json +2 -2
|
@@ -2,34 +2,6 @@
|
|
|
2
2
|
let imports = {};
|
|
3
3
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
4
|
|
|
5
|
-
let cachedUint8ArrayMemory0 = null;
|
|
6
|
-
|
|
7
|
-
function getUint8ArrayMemory0() {
|
|
8
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
-
}
|
|
11
|
-
return cachedUint8ArrayMemory0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
15
|
-
|
|
16
|
-
cachedTextDecoder.decode();
|
|
17
|
-
|
|
18
|
-
function decodeText(ptr, len) {
|
|
19
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function getStringFromWasm0(ptr, len) {
|
|
23
|
-
ptr = ptr >>> 0;
|
|
24
|
-
return decodeText(ptr, len);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let heap = new Array(128).fill(undefined);
|
|
28
|
-
|
|
29
|
-
heap.push(undefined, null, true, false);
|
|
30
|
-
|
|
31
|
-
let heap_next = heap.length;
|
|
32
|
-
|
|
33
5
|
function addHeapObject(obj) {
|
|
34
6
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
35
7
|
const idx = heap_next;
|
|
@@ -39,73 +11,10 @@ function addHeapObject(obj) {
|
|
|
39
11
|
return idx;
|
|
40
12
|
}
|
|
41
13
|
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const cachedTextEncoder = new TextEncoder();
|
|
47
|
-
|
|
48
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
49
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
50
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
51
|
-
view.set(buf);
|
|
52
|
-
return {
|
|
53
|
-
read: arg.length,
|
|
54
|
-
written: buf.length
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
60
|
-
|
|
61
|
-
if (realloc === undefined) {
|
|
62
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
63
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
64
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
65
|
-
WASM_VECTOR_LEN = buf.length;
|
|
66
|
-
return ptr;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
let len = arg.length;
|
|
70
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
71
|
-
|
|
72
|
-
const mem = getUint8ArrayMemory0();
|
|
73
|
-
|
|
74
|
-
let offset = 0;
|
|
75
|
-
|
|
76
|
-
for (; offset < len; offset++) {
|
|
77
|
-
const code = arg.charCodeAt(offset);
|
|
78
|
-
if (code > 0x7F) break;
|
|
79
|
-
mem[ptr + offset] = code;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (offset !== len) {
|
|
83
|
-
if (offset !== 0) {
|
|
84
|
-
arg = arg.slice(offset);
|
|
85
|
-
}
|
|
86
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
87
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
88
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
89
|
-
|
|
90
|
-
offset += ret.written;
|
|
91
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
WASM_VECTOR_LEN = offset;
|
|
95
|
-
return ptr;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
let cachedDataViewMemory0 = null;
|
|
99
|
-
|
|
100
|
-
function getDataViewMemory0() {
|
|
101
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
102
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
14
|
+
function _assertClass(instance, klass) {
|
|
15
|
+
if (!(instance instanceof klass)) {
|
|
16
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
103
17
|
}
|
|
104
|
-
return cachedDataViewMemory0;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function isLikeNone(x) {
|
|
108
|
-
return x === undefined || x === null;
|
|
109
18
|
}
|
|
110
19
|
|
|
111
20
|
function debugString(val) {
|
|
@@ -173,12 +82,25 @@ function debugString(val) {
|
|
|
173
82
|
return className;
|
|
174
83
|
}
|
|
175
84
|
|
|
176
|
-
function
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
85
|
+
function dropObject(idx) {
|
|
86
|
+
if (idx < 132) return;
|
|
87
|
+
heap[idx] = heap_next;
|
|
88
|
+
heap_next = idx;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
92
|
+
ptr = ptr >>> 0;
|
|
93
|
+
const mem = getDataViewMemory0();
|
|
94
|
+
const result = [];
|
|
95
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
96
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
181
97
|
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
102
|
+
ptr = ptr >>> 0;
|
|
103
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
182
104
|
}
|
|
183
105
|
|
|
184
106
|
function getArrayU8FromWasm0(ptr, len) {
|
|
@@ -186,20 +108,20 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
186
108
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
187
109
|
}
|
|
188
110
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
111
|
+
let cachedDataViewMemory0 = null;
|
|
112
|
+
function getDataViewMemory0() {
|
|
113
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
114
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
115
|
+
}
|
|
116
|
+
return cachedDataViewMemory0;
|
|
193
117
|
}
|
|
194
118
|
|
|
195
|
-
function
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return ret;
|
|
119
|
+
function getStringFromWasm0(ptr, len) {
|
|
120
|
+
ptr = ptr >>> 0;
|
|
121
|
+
return decodeText(ptr, len);
|
|
199
122
|
}
|
|
200
123
|
|
|
201
124
|
let cachedUint32ArrayMemory0 = null;
|
|
202
|
-
|
|
203
125
|
function getUint32ArrayMemory0() {
|
|
204
126
|
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
205
127
|
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
@@ -207,256 +129,118 @@ function getUint32ArrayMemory0() {
|
|
|
207
129
|
return cachedUint32ArrayMemory0;
|
|
208
130
|
}
|
|
209
131
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
216
|
-
ptr = ptr >>> 0;
|
|
217
|
-
const mem = getDataViewMemory0();
|
|
218
|
-
const result = [];
|
|
219
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
220
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
132
|
+
let cachedUint8ArrayMemory0 = null;
|
|
133
|
+
function getUint8ArrayMemory0() {
|
|
134
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
135
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
221
136
|
}
|
|
222
|
-
return
|
|
137
|
+
return cachedUint8ArrayMemory0;
|
|
223
138
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
* * `html` - The HTML string to convert
|
|
230
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
231
|
-
*
|
|
232
|
-
* # Example
|
|
233
|
-
*
|
|
234
|
-
* ```javascript
|
|
235
|
-
* import { convert } from 'html-to-markdown-wasm';
|
|
236
|
-
*
|
|
237
|
-
* const html = '<h1>Hello World</h1>';
|
|
238
|
-
* const markdown = convert(html);
|
|
239
|
-
* console.log(markdown); // # Hello World
|
|
240
|
-
* ```
|
|
241
|
-
* @param {string} html
|
|
242
|
-
* @param {any} options
|
|
243
|
-
* @returns {string}
|
|
244
|
-
*/
|
|
245
|
-
exports.convert = function(html, options) {
|
|
246
|
-
let deferred3_0;
|
|
247
|
-
let deferred3_1;
|
|
139
|
+
|
|
140
|
+
function getObject(idx) { return heap[idx]; }
|
|
141
|
+
|
|
142
|
+
function handleError(f, args) {
|
|
248
143
|
try {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
253
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
254
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
255
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
256
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
257
|
-
var ptr2 = r0;
|
|
258
|
-
var len2 = r1;
|
|
259
|
-
if (r3) {
|
|
260
|
-
ptr2 = 0; len2 = 0;
|
|
261
|
-
throw takeObject(r2);
|
|
262
|
-
}
|
|
263
|
-
deferred3_0 = ptr2;
|
|
264
|
-
deferred3_1 = len2;
|
|
265
|
-
return getStringFromWasm0(ptr2, len2);
|
|
266
|
-
} finally {
|
|
267
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
268
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
144
|
+
return f.apply(this, args);
|
|
145
|
+
} catch (e) {
|
|
146
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
269
147
|
}
|
|
270
|
-
}
|
|
148
|
+
}
|
|
271
149
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
150
|
+
let heap = new Array(128).fill(undefined);
|
|
151
|
+
heap.push(undefined, null, true, false);
|
|
152
|
+
|
|
153
|
+
let heap_next = heap.length;
|
|
154
|
+
|
|
155
|
+
function isLikeNone(x) {
|
|
156
|
+
return x === undefined || x === null;
|
|
276
157
|
}
|
|
277
|
-
/**
|
|
278
|
-
* @param {string} html
|
|
279
|
-
* @param {any} options
|
|
280
|
-
* @param {WasmInlineImageConfig | null} [image_config]
|
|
281
|
-
* @returns {WasmHtmlExtraction}
|
|
282
|
-
*/
|
|
283
|
-
exports.convertWithInlineImages = function(html, options, image_config) {
|
|
284
|
-
try {
|
|
285
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
286
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
287
|
-
const len0 = WASM_VECTOR_LEN;
|
|
288
|
-
let ptr1 = 0;
|
|
289
|
-
if (!isLikeNone(image_config)) {
|
|
290
|
-
_assertClass(image_config, WasmInlineImageConfig);
|
|
291
|
-
ptr1 = image_config.__destroy_into_raw();
|
|
292
|
-
}
|
|
293
|
-
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
294
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
295
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
296
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
297
|
-
if (r2) {
|
|
298
|
-
throw takeObject(r1);
|
|
299
|
-
}
|
|
300
|
-
return WasmHtmlExtraction.__wrap(r0);
|
|
301
|
-
} finally {
|
|
302
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
158
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
let deferred2_1;
|
|
314
|
-
try {
|
|
315
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
316
|
-
_assertClass(handle, WasmConversionOptionsHandle);
|
|
317
|
-
wasm.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
|
|
318
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
319
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
320
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
321
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
322
|
-
var ptr1 = r0;
|
|
323
|
-
var len1 = r1;
|
|
324
|
-
if (r3) {
|
|
325
|
-
ptr1 = 0; len1 = 0;
|
|
326
|
-
throw takeObject(r2);
|
|
327
|
-
}
|
|
328
|
-
deferred2_0 = ptr1;
|
|
329
|
-
deferred2_1 = len1;
|
|
330
|
-
return getStringFromWasm0(ptr1, len1);
|
|
331
|
-
} finally {
|
|
332
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
333
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
159
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
160
|
+
if (realloc === undefined) {
|
|
161
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
162
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
163
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
164
|
+
WASM_VECTOR_LEN = buf.length;
|
|
165
|
+
return ptr;
|
|
334
166
|
}
|
|
335
|
-
};
|
|
336
167
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
* @param {any} options
|
|
340
|
-
* @param {WasmInlineImageConfig | null} [image_config]
|
|
341
|
-
* @returns {WasmHtmlExtraction}
|
|
342
|
-
*/
|
|
343
|
-
exports.convertBytesWithInlineImages = function(html, options, image_config) {
|
|
344
|
-
try {
|
|
345
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
346
|
-
let ptr0 = 0;
|
|
347
|
-
if (!isLikeNone(image_config)) {
|
|
348
|
-
_assertClass(image_config, WasmInlineImageConfig);
|
|
349
|
-
ptr0 = image_config.__destroy_into_raw();
|
|
350
|
-
}
|
|
351
|
-
wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
352
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
353
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
354
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
355
|
-
if (r2) {
|
|
356
|
-
throw takeObject(r1);
|
|
357
|
-
}
|
|
358
|
-
return WasmHtmlExtraction.__wrap(r0);
|
|
359
|
-
} finally {
|
|
360
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
361
|
-
}
|
|
362
|
-
};
|
|
168
|
+
let len = arg.length;
|
|
169
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
363
170
|
|
|
364
|
-
|
|
365
|
-
* @param {any} options
|
|
366
|
-
* @returns {WasmConversionOptionsHandle}
|
|
367
|
-
*/
|
|
368
|
-
exports.createConversionOptionsHandle = function(options) {
|
|
369
|
-
try {
|
|
370
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
371
|
-
wasm.createConversionOptionsHandle(retptr, addHeapObject(options));
|
|
372
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
373
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
374
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
375
|
-
if (r2) {
|
|
376
|
-
throw takeObject(r1);
|
|
377
|
-
}
|
|
378
|
-
return WasmConversionOptionsHandle.__wrap(r0);
|
|
379
|
-
} finally {
|
|
380
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
381
|
-
}
|
|
382
|
-
};
|
|
171
|
+
const mem = getUint8ArrayMemory0();
|
|
383
172
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
395
|
-
const len0 = WASM_VECTOR_LEN;
|
|
396
|
-
_assertClass(handle, WasmConversionOptionsHandle);
|
|
397
|
-
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
398
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
399
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
400
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
401
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
402
|
-
var ptr2 = r0;
|
|
403
|
-
var len2 = r1;
|
|
404
|
-
if (r3) {
|
|
405
|
-
ptr2 = 0; len2 = 0;
|
|
406
|
-
throw takeObject(r2);
|
|
173
|
+
let offset = 0;
|
|
174
|
+
|
|
175
|
+
for (; offset < len; offset++) {
|
|
176
|
+
const code = arg.charCodeAt(offset);
|
|
177
|
+
if (code > 0x7F) break;
|
|
178
|
+
mem[ptr + offset] = code;
|
|
179
|
+
}
|
|
180
|
+
if (offset !== len) {
|
|
181
|
+
if (offset !== 0) {
|
|
182
|
+
arg = arg.slice(offset);
|
|
407
183
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
184
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
185
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
186
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
187
|
+
|
|
188
|
+
offset += ret.written;
|
|
189
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
414
190
|
}
|
|
415
|
-
};
|
|
416
191
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
192
|
+
WASM_VECTOR_LEN = offset;
|
|
193
|
+
return ptr;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function takeObject(idx) {
|
|
197
|
+
const ret = getObject(idx);
|
|
198
|
+
dropObject(idx);
|
|
199
|
+
return ret;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
203
|
+
cachedTextDecoder.decode();
|
|
204
|
+
function decodeText(ptr, len) {
|
|
205
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const cachedTextEncoder = new TextEncoder();
|
|
209
|
+
|
|
210
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
211
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
212
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
213
|
+
view.set(buf);
|
|
214
|
+
return {
|
|
215
|
+
read: arg.length,
|
|
216
|
+
written: buf.length
|
|
217
|
+
};
|
|
444
218
|
}
|
|
445
|
-
}
|
|
219
|
+
}
|
|
446
220
|
|
|
447
|
-
|
|
448
|
-
* Initialize panic hook for better error messages in the browser
|
|
449
|
-
*/
|
|
450
|
-
exports.init = function() {
|
|
451
|
-
wasm.init();
|
|
452
|
-
};
|
|
221
|
+
let WASM_VECTOR_LEN = 0;
|
|
453
222
|
|
|
454
223
|
const WasmConversionOptionsHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
455
224
|
? { register: () => {}, unregister: () => {} }
|
|
456
225
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmconversionoptionshandle_free(ptr >>> 0, 1));
|
|
457
226
|
|
|
458
|
-
|
|
227
|
+
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
228
|
+
? { register: () => {}, unregister: () => {} }
|
|
229
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
230
|
+
|
|
231
|
+
const WasmInlineImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
232
|
+
? { register: () => {}, unregister: () => {} }
|
|
233
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimage_free(ptr >>> 0, 1));
|
|
234
|
+
|
|
235
|
+
const WasmInlineImageConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
236
|
+
? { register: () => {}, unregister: () => {} }
|
|
237
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimageconfig_free(ptr >>> 0, 1));
|
|
238
|
+
|
|
239
|
+
const WasmInlineImageWarningFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
240
|
+
? { register: () => {}, unregister: () => {} }
|
|
241
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimagewarning_free(ptr >>> 0, 1));
|
|
459
242
|
|
|
243
|
+
class WasmConversionOptionsHandle {
|
|
460
244
|
static __wrap(ptr) {
|
|
461
245
|
ptr = ptr >>> 0;
|
|
462
246
|
const obj = Object.create(WasmConversionOptionsHandle.prototype);
|
|
@@ -464,14 +248,12 @@ class WasmConversionOptionsHandle {
|
|
|
464
248
|
WasmConversionOptionsHandleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
465
249
|
return obj;
|
|
466
250
|
}
|
|
467
|
-
|
|
468
251
|
__destroy_into_raw() {
|
|
469
252
|
const ptr = this.__wbg_ptr;
|
|
470
253
|
this.__wbg_ptr = 0;
|
|
471
254
|
WasmConversionOptionsHandleFinalization.unregister(this);
|
|
472
255
|
return ptr;
|
|
473
256
|
}
|
|
474
|
-
|
|
475
257
|
free() {
|
|
476
258
|
const ptr = this.__destroy_into_raw();
|
|
477
259
|
wasm.__wbg_wasmconversionoptionshandle_free(ptr, 0);
|
|
@@ -498,17 +280,12 @@ class WasmConversionOptionsHandle {
|
|
|
498
280
|
}
|
|
499
281
|
}
|
|
500
282
|
if (Symbol.dispose) WasmConversionOptionsHandle.prototype[Symbol.dispose] = WasmConversionOptionsHandle.prototype.free;
|
|
501
|
-
|
|
502
283
|
exports.WasmConversionOptionsHandle = WasmConversionOptionsHandle;
|
|
503
284
|
|
|
504
|
-
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
505
|
-
? { register: () => {}, unregister: () => {} }
|
|
506
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
507
285
|
/**
|
|
508
286
|
* Result of HTML extraction with inline images
|
|
509
287
|
*/
|
|
510
288
|
class WasmHtmlExtraction {
|
|
511
|
-
|
|
512
289
|
static __wrap(ptr) {
|
|
513
290
|
ptr = ptr >>> 0;
|
|
514
291
|
const obj = Object.create(WasmHtmlExtraction.prototype);
|
|
@@ -516,14 +293,12 @@ class WasmHtmlExtraction {
|
|
|
516
293
|
WasmHtmlExtractionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
517
294
|
return obj;
|
|
518
295
|
}
|
|
519
|
-
|
|
520
296
|
__destroy_into_raw() {
|
|
521
297
|
const ptr = this.__wbg_ptr;
|
|
522
298
|
this.__wbg_ptr = 0;
|
|
523
299
|
WasmHtmlExtractionFinalization.unregister(this);
|
|
524
300
|
return ptr;
|
|
525
301
|
}
|
|
526
|
-
|
|
527
302
|
free() {
|
|
528
303
|
const ptr = this.__destroy_into_raw();
|
|
529
304
|
wasm.__wbg_wasmhtmlextraction_free(ptr, 0);
|
|
@@ -581,17 +356,12 @@ class WasmHtmlExtraction {
|
|
|
581
356
|
}
|
|
582
357
|
}
|
|
583
358
|
if (Symbol.dispose) WasmHtmlExtraction.prototype[Symbol.dispose] = WasmHtmlExtraction.prototype.free;
|
|
584
|
-
|
|
585
359
|
exports.WasmHtmlExtraction = WasmHtmlExtraction;
|
|
586
360
|
|
|
587
|
-
const WasmInlineImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
588
|
-
? { register: () => {}, unregister: () => {} }
|
|
589
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimage_free(ptr >>> 0, 1));
|
|
590
361
|
/**
|
|
591
362
|
* Inline image data
|
|
592
363
|
*/
|
|
593
364
|
class WasmInlineImage {
|
|
594
|
-
|
|
595
365
|
static __wrap(ptr) {
|
|
596
366
|
ptr = ptr >>> 0;
|
|
597
367
|
const obj = Object.create(WasmInlineImage.prototype);
|
|
@@ -599,14 +369,12 @@ class WasmInlineImage {
|
|
|
599
369
|
WasmInlineImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
600
370
|
return obj;
|
|
601
371
|
}
|
|
602
|
-
|
|
603
372
|
__destroy_into_raw() {
|
|
604
373
|
const ptr = this.__wbg_ptr;
|
|
605
374
|
this.__wbg_ptr = 0;
|
|
606
375
|
WasmInlineImageFinalization.unregister(this);
|
|
607
376
|
return ptr;
|
|
608
377
|
}
|
|
609
|
-
|
|
610
378
|
free() {
|
|
611
379
|
const ptr = this.__destroy_into_raw();
|
|
612
380
|
wasm.__wbg_wasminlineimage_free(ptr, 0);
|
|
@@ -722,24 +490,18 @@ class WasmInlineImage {
|
|
|
722
490
|
}
|
|
723
491
|
}
|
|
724
492
|
if (Symbol.dispose) WasmInlineImage.prototype[Symbol.dispose] = WasmInlineImage.prototype.free;
|
|
725
|
-
|
|
726
493
|
exports.WasmInlineImage = WasmInlineImage;
|
|
727
494
|
|
|
728
|
-
const WasmInlineImageConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
729
|
-
? { register: () => {}, unregister: () => {} }
|
|
730
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimageconfig_free(ptr >>> 0, 1));
|
|
731
495
|
/**
|
|
732
496
|
* Inline image configuration
|
|
733
497
|
*/
|
|
734
498
|
class WasmInlineImageConfig {
|
|
735
|
-
|
|
736
499
|
__destroy_into_raw() {
|
|
737
500
|
const ptr = this.__wbg_ptr;
|
|
738
501
|
this.__wbg_ptr = 0;
|
|
739
502
|
WasmInlineImageConfigFinalization.unregister(this);
|
|
740
503
|
return ptr;
|
|
741
504
|
}
|
|
742
|
-
|
|
743
505
|
free() {
|
|
744
506
|
const ptr = this.__destroy_into_raw();
|
|
745
507
|
wasm.__wbg_wasminlineimageconfig_free(ptr, 0);
|
|
@@ -775,17 +537,12 @@ class WasmInlineImageConfig {
|
|
|
775
537
|
}
|
|
776
538
|
}
|
|
777
539
|
if (Symbol.dispose) WasmInlineImageConfig.prototype[Symbol.dispose] = WasmInlineImageConfig.prototype.free;
|
|
778
|
-
|
|
779
540
|
exports.WasmInlineImageConfig = WasmInlineImageConfig;
|
|
780
541
|
|
|
781
|
-
const WasmInlineImageWarningFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
782
|
-
? { register: () => {}, unregister: () => {} }
|
|
783
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimagewarning_free(ptr >>> 0, 1));
|
|
784
542
|
/**
|
|
785
543
|
* Warning about inline image processing
|
|
786
544
|
*/
|
|
787
545
|
class WasmInlineImageWarning {
|
|
788
|
-
|
|
789
546
|
static __wrap(ptr) {
|
|
790
547
|
ptr = ptr >>> 0;
|
|
791
548
|
const obj = Object.create(WasmInlineImageWarning.prototype);
|
|
@@ -793,14 +550,12 @@ class WasmInlineImageWarning {
|
|
|
793
550
|
WasmInlineImageWarningFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
794
551
|
return obj;
|
|
795
552
|
}
|
|
796
|
-
|
|
797
553
|
__destroy_into_raw() {
|
|
798
554
|
const ptr = this.__wbg_ptr;
|
|
799
555
|
this.__wbg_ptr = 0;
|
|
800
556
|
WasmInlineImageWarningFinalization.unregister(this);
|
|
801
557
|
return ptr;
|
|
802
558
|
}
|
|
803
|
-
|
|
804
559
|
free() {
|
|
805
560
|
const ptr = this.__destroy_into_raw();
|
|
806
561
|
wasm.__wbg_wasminlineimagewarning_free(ptr, 0);
|
|
@@ -833,15 +588,247 @@ class WasmInlineImageWarning {
|
|
|
833
588
|
}
|
|
834
589
|
}
|
|
835
590
|
if (Symbol.dispose) WasmInlineImageWarning.prototype[Symbol.dispose] = WasmInlineImageWarning.prototype.free;
|
|
836
|
-
|
|
837
591
|
exports.WasmInlineImageWarning = WasmInlineImageWarning;
|
|
838
592
|
|
|
839
|
-
|
|
593
|
+
/**
|
|
594
|
+
* Convert HTML to Markdown
|
|
595
|
+
*
|
|
596
|
+
* # Arguments
|
|
597
|
+
*
|
|
598
|
+
* * `html` - The HTML string to convert
|
|
599
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
600
|
+
*
|
|
601
|
+
* # Example
|
|
602
|
+
*
|
|
603
|
+
* ```javascript
|
|
604
|
+
* import { convert } from 'html-to-markdown-wasm';
|
|
605
|
+
*
|
|
606
|
+
* const html = '<h1>Hello World</h1>';
|
|
607
|
+
* const markdown = convert(html);
|
|
608
|
+
* console.log(markdown); // # Hello World
|
|
609
|
+
* ```
|
|
610
|
+
* @param {string} html
|
|
611
|
+
* @param {any} options
|
|
612
|
+
* @returns {string}
|
|
613
|
+
*/
|
|
614
|
+
function convert(html, options) {
|
|
615
|
+
let deferred3_0;
|
|
616
|
+
let deferred3_1;
|
|
617
|
+
try {
|
|
618
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
619
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
620
|
+
const len0 = WASM_VECTOR_LEN;
|
|
621
|
+
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
622
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
623
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
624
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
625
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
626
|
+
var ptr2 = r0;
|
|
627
|
+
var len2 = r1;
|
|
628
|
+
if (r3) {
|
|
629
|
+
ptr2 = 0; len2 = 0;
|
|
630
|
+
throw takeObject(r2);
|
|
631
|
+
}
|
|
632
|
+
deferred3_0 = ptr2;
|
|
633
|
+
deferred3_1 = len2;
|
|
634
|
+
return getStringFromWasm0(ptr2, len2);
|
|
635
|
+
} finally {
|
|
636
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
637
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
exports.convert = convert;
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* @param {Uint8Array} html
|
|
644
|
+
* @param {any} options
|
|
645
|
+
* @returns {string}
|
|
646
|
+
*/
|
|
647
|
+
function convertBytes(html, options) {
|
|
648
|
+
let deferred2_0;
|
|
649
|
+
let deferred2_1;
|
|
650
|
+
try {
|
|
651
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
652
|
+
wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
|
|
653
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
654
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
655
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
656
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
657
|
+
var ptr1 = r0;
|
|
658
|
+
var len1 = r1;
|
|
659
|
+
if (r3) {
|
|
660
|
+
ptr1 = 0; len1 = 0;
|
|
661
|
+
throw takeObject(r2);
|
|
662
|
+
}
|
|
663
|
+
deferred2_0 = ptr1;
|
|
664
|
+
deferred2_1 = len1;
|
|
665
|
+
return getStringFromWasm0(ptr1, len1);
|
|
666
|
+
} finally {
|
|
667
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
668
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
exports.convertBytes = convertBytes;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* @param {Uint8Array} html
|
|
675
|
+
* @param {any} options
|
|
676
|
+
* @param {WasmInlineImageConfig | null} [image_config]
|
|
677
|
+
* @returns {WasmHtmlExtraction}
|
|
678
|
+
*/
|
|
679
|
+
function convertBytesWithInlineImages(html, options, image_config) {
|
|
680
|
+
try {
|
|
681
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
682
|
+
let ptr0 = 0;
|
|
683
|
+
if (!isLikeNone(image_config)) {
|
|
684
|
+
_assertClass(image_config, WasmInlineImageConfig);
|
|
685
|
+
ptr0 = image_config.__destroy_into_raw();
|
|
686
|
+
}
|
|
687
|
+
wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
688
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
689
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
690
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
691
|
+
if (r2) {
|
|
692
|
+
throw takeObject(r1);
|
|
693
|
+
}
|
|
694
|
+
return WasmHtmlExtraction.__wrap(r0);
|
|
695
|
+
} finally {
|
|
696
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
exports.convertBytesWithInlineImages = convertBytesWithInlineImages;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* @param {Uint8Array} html
|
|
703
|
+
* @param {WasmConversionOptionsHandle} handle
|
|
704
|
+
* @returns {string}
|
|
705
|
+
*/
|
|
706
|
+
function convertBytesWithOptionsHandle(html, handle) {
|
|
707
|
+
let deferred2_0;
|
|
708
|
+
let deferred2_1;
|
|
709
|
+
try {
|
|
710
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
711
|
+
_assertClass(handle, WasmConversionOptionsHandle);
|
|
712
|
+
wasm.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
|
|
713
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
714
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
715
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
716
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
717
|
+
var ptr1 = r0;
|
|
718
|
+
var len1 = r1;
|
|
719
|
+
if (r3) {
|
|
720
|
+
ptr1 = 0; len1 = 0;
|
|
721
|
+
throw takeObject(r2);
|
|
722
|
+
}
|
|
723
|
+
deferred2_0 = ptr1;
|
|
724
|
+
deferred2_1 = len1;
|
|
725
|
+
return getStringFromWasm0(ptr1, len1);
|
|
726
|
+
} finally {
|
|
727
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
728
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
exports.convertBytesWithOptionsHandle = convertBytesWithOptionsHandle;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* @param {string} html
|
|
735
|
+
* @param {any} options
|
|
736
|
+
* @param {WasmInlineImageConfig | null} [image_config]
|
|
737
|
+
* @returns {WasmHtmlExtraction}
|
|
738
|
+
*/
|
|
739
|
+
function convertWithInlineImages(html, options, image_config) {
|
|
740
|
+
try {
|
|
741
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
742
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
743
|
+
const len0 = WASM_VECTOR_LEN;
|
|
744
|
+
let ptr1 = 0;
|
|
745
|
+
if (!isLikeNone(image_config)) {
|
|
746
|
+
_assertClass(image_config, WasmInlineImageConfig);
|
|
747
|
+
ptr1 = image_config.__destroy_into_raw();
|
|
748
|
+
}
|
|
749
|
+
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
750
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
751
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
752
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
753
|
+
if (r2) {
|
|
754
|
+
throw takeObject(r1);
|
|
755
|
+
}
|
|
756
|
+
return WasmHtmlExtraction.__wrap(r0);
|
|
757
|
+
} finally {
|
|
758
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
exports.convertWithInlineImages = convertWithInlineImages;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* @param {string} html
|
|
765
|
+
* @param {WasmConversionOptionsHandle} handle
|
|
766
|
+
* @returns {string}
|
|
767
|
+
*/
|
|
768
|
+
function convertWithOptionsHandle(html, handle) {
|
|
769
|
+
let deferred3_0;
|
|
770
|
+
let deferred3_1;
|
|
771
|
+
try {
|
|
772
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
773
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
774
|
+
const len0 = WASM_VECTOR_LEN;
|
|
775
|
+
_assertClass(handle, WasmConversionOptionsHandle);
|
|
776
|
+
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
777
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
778
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
779
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
780
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
781
|
+
var ptr2 = r0;
|
|
782
|
+
var len2 = r1;
|
|
783
|
+
if (r3) {
|
|
784
|
+
ptr2 = 0; len2 = 0;
|
|
785
|
+
throw takeObject(r2);
|
|
786
|
+
}
|
|
787
|
+
deferred3_0 = ptr2;
|
|
788
|
+
deferred3_1 = len2;
|
|
789
|
+
return getStringFromWasm0(ptr2, len2);
|
|
790
|
+
} finally {
|
|
791
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
792
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
exports.convertWithOptionsHandle = convertWithOptionsHandle;
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* @param {any} options
|
|
799
|
+
* @returns {WasmConversionOptionsHandle}
|
|
800
|
+
*/
|
|
801
|
+
function createConversionOptionsHandle(options) {
|
|
802
|
+
try {
|
|
803
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
804
|
+
wasm.createConversionOptionsHandle(retptr, addHeapObject(options));
|
|
805
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
806
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
807
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
808
|
+
if (r2) {
|
|
809
|
+
throw takeObject(r1);
|
|
810
|
+
}
|
|
811
|
+
return WasmConversionOptionsHandle.__wrap(r0);
|
|
812
|
+
} finally {
|
|
813
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
exports.createConversionOptionsHandle = createConversionOptionsHandle;
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Initialize panic hook for better error messages in the browser
|
|
820
|
+
*/
|
|
821
|
+
function init() {
|
|
822
|
+
wasm.init();
|
|
823
|
+
}
|
|
824
|
+
exports.init = init;
|
|
825
|
+
|
|
826
|
+
exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
840
827
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
841
828
|
return addHeapObject(ret);
|
|
842
829
|
};
|
|
843
830
|
|
|
844
|
-
exports.
|
|
831
|
+
exports.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
845
832
|
const ret = Number(getObject(arg0));
|
|
846
833
|
return ret;
|
|
847
834
|
};
|
|
@@ -854,20 +841,20 @@ exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
|
854
841
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
855
842
|
};
|
|
856
843
|
|
|
857
|
-
exports.
|
|
844
|
+
exports.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
|
|
858
845
|
const v = getObject(arg1);
|
|
859
846
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
860
847
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
861
848
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
862
849
|
};
|
|
863
850
|
|
|
864
|
-
exports.
|
|
851
|
+
exports.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
865
852
|
const v = getObject(arg0);
|
|
866
853
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
867
854
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
868
855
|
};
|
|
869
856
|
|
|
870
|
-
exports.
|
|
857
|
+
exports.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
871
858
|
const ret = debugString(getObject(arg1));
|
|
872
859
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
873
860
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -875,60 +862,60 @@ exports.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
|
875
862
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
876
863
|
};
|
|
877
864
|
|
|
878
|
-
exports.
|
|
865
|
+
exports.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
879
866
|
const ret = getObject(arg0) in getObject(arg1);
|
|
880
867
|
return ret;
|
|
881
868
|
};
|
|
882
869
|
|
|
883
|
-
exports.
|
|
870
|
+
exports.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
|
|
884
871
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
885
872
|
return ret;
|
|
886
873
|
};
|
|
887
874
|
|
|
888
|
-
exports.
|
|
875
|
+
exports.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
|
|
889
876
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
890
877
|
return ret;
|
|
891
878
|
};
|
|
892
879
|
|
|
893
|
-
exports.
|
|
880
|
+
exports.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
|
|
894
881
|
const ret = getObject(arg0) === null;
|
|
895
882
|
return ret;
|
|
896
883
|
};
|
|
897
884
|
|
|
898
|
-
exports.
|
|
885
|
+
exports.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
899
886
|
const val = getObject(arg0);
|
|
900
887
|
const ret = typeof(val) === 'object' && val !== null;
|
|
901
888
|
return ret;
|
|
902
889
|
};
|
|
903
890
|
|
|
904
|
-
exports.
|
|
891
|
+
exports.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
905
892
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
906
893
|
return ret;
|
|
907
894
|
};
|
|
908
895
|
|
|
909
|
-
exports.
|
|
896
|
+
exports.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
910
897
|
const ret = getObject(arg0) === undefined;
|
|
911
898
|
return ret;
|
|
912
899
|
};
|
|
913
900
|
|
|
914
|
-
exports.
|
|
901
|
+
exports.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
|
|
915
902
|
const ret = getObject(arg0) === getObject(arg1);
|
|
916
903
|
return ret;
|
|
917
904
|
};
|
|
918
905
|
|
|
919
|
-
exports.
|
|
906
|
+
exports.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
920
907
|
const ret = getObject(arg0) == getObject(arg1);
|
|
921
908
|
return ret;
|
|
922
909
|
};
|
|
923
910
|
|
|
924
|
-
exports.
|
|
911
|
+
exports.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
925
912
|
const obj = getObject(arg1);
|
|
926
913
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
927
914
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
928
915
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
929
916
|
};
|
|
930
917
|
|
|
931
|
-
exports.
|
|
918
|
+
exports.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
932
919
|
const obj = getObject(arg1);
|
|
933
920
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
934
921
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -937,26 +924,26 @@ exports.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
|
937
924
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
938
925
|
};
|
|
939
926
|
|
|
940
|
-
exports.
|
|
927
|
+
exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
941
928
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
942
929
|
};
|
|
943
930
|
|
|
944
|
-
exports.
|
|
931
|
+
exports.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
|
|
945
932
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
946
933
|
return addHeapObject(ret);
|
|
947
934
|
}, arguments) };
|
|
948
935
|
|
|
949
|
-
exports.
|
|
936
|
+
exports.__wbg_codePointAt_6fd4439a1e465afd = function(arg0, arg1) {
|
|
950
937
|
const ret = getObject(arg0).codePointAt(arg1 >>> 0);
|
|
951
938
|
return addHeapObject(ret);
|
|
952
939
|
};
|
|
953
940
|
|
|
954
|
-
exports.
|
|
941
|
+
exports.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
955
942
|
const ret = getObject(arg0).done;
|
|
956
943
|
return ret;
|
|
957
944
|
};
|
|
958
945
|
|
|
959
|
-
exports.
|
|
946
|
+
exports.__wbg_entries_83c79938054e065f = function(arg0) {
|
|
960
947
|
const ret = Object.entries(getObject(arg0));
|
|
961
948
|
return addHeapObject(ret);
|
|
962
949
|
};
|
|
@@ -973,12 +960,12 @@ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
|
973
960
|
}
|
|
974
961
|
};
|
|
975
962
|
|
|
976
|
-
exports.
|
|
963
|
+
exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
977
964
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
978
965
|
return addHeapObject(ret);
|
|
979
966
|
};
|
|
980
967
|
|
|
981
|
-
exports.
|
|
968
|
+
exports.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
|
|
982
969
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
983
970
|
return addHeapObject(ret);
|
|
984
971
|
}, arguments) };
|
|
@@ -988,7 +975,7 @@ exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
|
988
975
|
return addHeapObject(ret);
|
|
989
976
|
};
|
|
990
977
|
|
|
991
|
-
exports.
|
|
978
|
+
exports.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
992
979
|
let result;
|
|
993
980
|
try {
|
|
994
981
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -999,7 +986,7 @@ exports.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
|
999
986
|
return ret;
|
|
1000
987
|
};
|
|
1001
988
|
|
|
1002
|
-
exports.
|
|
989
|
+
exports.__wbg_instanceof_Object_577e21051f7bcb79 = function(arg0) {
|
|
1003
990
|
let result;
|
|
1004
991
|
try {
|
|
1005
992
|
result = getObject(arg0) instanceof Object;
|
|
@@ -1010,7 +997,7 @@ exports.__wbg_instanceof_Object_10bb762262230c68 = function(arg0) {
|
|
|
1010
997
|
return ret;
|
|
1011
998
|
};
|
|
1012
999
|
|
|
1013
|
-
exports.
|
|
1000
|
+
exports.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
1014
1001
|
let result;
|
|
1015
1002
|
try {
|
|
1016
1003
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -1021,77 +1008,77 @@ exports.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
|
1021
1008
|
return ret;
|
|
1022
1009
|
};
|
|
1023
1010
|
|
|
1024
|
-
exports.
|
|
1011
|
+
exports.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
|
|
1025
1012
|
const ret = Array.isArray(getObject(arg0));
|
|
1026
1013
|
return ret;
|
|
1027
1014
|
};
|
|
1028
1015
|
|
|
1029
|
-
exports.
|
|
1016
|
+
exports.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
|
|
1030
1017
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1031
1018
|
return ret;
|
|
1032
1019
|
};
|
|
1033
1020
|
|
|
1034
|
-
exports.
|
|
1021
|
+
exports.__wbg_iterator_27b7c8b35ab3e86b = function() {
|
|
1035
1022
|
const ret = Symbol.iterator;
|
|
1036
1023
|
return addHeapObject(ret);
|
|
1037
1024
|
};
|
|
1038
1025
|
|
|
1039
|
-
exports.
|
|
1026
|
+
exports.__wbg_keys_f5c6002ff150fc6c = function(arg0) {
|
|
1040
1027
|
const ret = Object.keys(getObject(arg0));
|
|
1041
1028
|
return addHeapObject(ret);
|
|
1042
1029
|
};
|
|
1043
1030
|
|
|
1044
|
-
exports.
|
|
1031
|
+
exports.__wbg_length_1f83b8e5895c84aa = function(arg0) {
|
|
1045
1032
|
const ret = getObject(arg0).length;
|
|
1046
1033
|
return ret;
|
|
1047
1034
|
};
|
|
1048
1035
|
|
|
1049
|
-
exports.
|
|
1036
|
+
exports.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
1050
1037
|
const ret = getObject(arg0).length;
|
|
1051
1038
|
return ret;
|
|
1052
1039
|
};
|
|
1053
1040
|
|
|
1054
|
-
exports.
|
|
1041
|
+
exports.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
1055
1042
|
const ret = getObject(arg0).length;
|
|
1056
1043
|
return ret;
|
|
1057
1044
|
};
|
|
1058
1045
|
|
|
1059
|
-
exports.
|
|
1046
|
+
exports.__wbg_new_1ba21ce319a06297 = function() {
|
|
1060
1047
|
const ret = new Object();
|
|
1061
1048
|
return addHeapObject(ret);
|
|
1062
1049
|
};
|
|
1063
1050
|
|
|
1064
|
-
exports.
|
|
1051
|
+
exports.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
1065
1052
|
const ret = new Uint8Array(getObject(arg0));
|
|
1066
1053
|
return addHeapObject(ret);
|
|
1067
1054
|
};
|
|
1068
1055
|
|
|
1069
|
-
exports.__wbg_new_68651c719dcda04e = function() {
|
|
1070
|
-
const ret = new Map();
|
|
1071
|
-
return addHeapObject(ret);
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
1056
|
exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
1075
1057
|
const ret = new Error();
|
|
1076
1058
|
return addHeapObject(ret);
|
|
1077
1059
|
};
|
|
1078
1060
|
|
|
1079
|
-
exports.
|
|
1080
|
-
const ret = new
|
|
1061
|
+
exports.__wbg_new_b546ae120718850e = function() {
|
|
1062
|
+
const ret = new Map();
|
|
1081
1063
|
return addHeapObject(ret);
|
|
1082
1064
|
};
|
|
1083
1065
|
|
|
1084
|
-
exports.
|
|
1085
|
-
const ret =
|
|
1066
|
+
exports.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
|
|
1067
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1086
1068
|
return addHeapObject(ret);
|
|
1087
|
-
}
|
|
1069
|
+
};
|
|
1088
1070
|
|
|
1089
|
-
exports.
|
|
1071
|
+
exports.__wbg_next_138a17bbf04e926c = function(arg0) {
|
|
1090
1072
|
const ret = getObject(arg0).next;
|
|
1091
1073
|
return addHeapObject(ret);
|
|
1092
1074
|
};
|
|
1093
1075
|
|
|
1094
|
-
exports.
|
|
1076
|
+
exports.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
|
|
1077
|
+
const ret = getObject(arg0).next();
|
|
1078
|
+
return addHeapObject(ret);
|
|
1079
|
+
}, arguments) };
|
|
1080
|
+
|
|
1081
|
+
exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
1095
1082
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1096
1083
|
};
|
|
1097
1084
|
|
|
@@ -1099,7 +1086,7 @@ exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
|
1099
1086
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1100
1087
|
};
|
|
1101
1088
|
|
|
1102
|
-
exports.
|
|
1089
|
+
exports.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
|
|
1103
1090
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
1104
1091
|
return addHeapObject(ret);
|
|
1105
1092
|
};
|
|
@@ -1112,7 +1099,7 @@ exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
|
1112
1099
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1113
1100
|
};
|
|
1114
1101
|
|
|
1115
|
-
exports.
|
|
1102
|
+
exports.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
1116
1103
|
const ret = getObject(arg0).value;
|
|
1117
1104
|
return addHeapObject(ret);
|
|
1118
1105
|
};
|
|
@@ -1154,4 +1141,3 @@ const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
|
1154
1141
|
const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
|
|
1155
1142
|
|
|
1156
1143
|
wasm.__wbindgen_start();
|
|
1157
|
-
|