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