@kreuzberg/html-to-markdown-wasm 3.6.0-rc.7 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pkg/bundler/html_to_markdown_wasm.d.ts +74 -10
- package/pkg/bundler/html_to_markdown_wasm.js +1 -1
- package/pkg/bundler/html_to_markdown_wasm_bg.js +473 -79
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm.d.ts +35 -22
- package/pkg/bundler/package.json +1 -1
- package/pkg/deno/html_to_markdown_wasm.d.ts +74 -10
- package/pkg/deno/html_to_markdown_wasm.js +473 -79
- package/pkg/deno/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/deno/html_to_markdown_wasm_bg.wasm.d.ts +35 -22
- package/pkg/nodejs/html_to_markdown_wasm.d.ts +74 -10
- package/pkg/nodejs/html_to_markdown_wasm.js +475 -79
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm.d.ts +35 -22
- package/pkg/nodejs/package.json +1 -1
- package/pkg/web/html_to_markdown_wasm.d.ts +109 -32
- package/pkg/web/html_to_markdown_wasm.js +473 -79
- package/pkg/web/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/web/html_to_markdown_wasm_bg.wasm.d.ts +35 -22
- package/pkg/web/package.json +1 -1
|
@@ -2092,22 +2092,6 @@ export class WasmConversionResult {
|
|
|
2092
2092
|
const ret = wasm.wasmconversionresult_document(this.__wbg_ptr);
|
|
2093
2093
|
return ret === 0 ? undefined : WasmDocumentStructure.__wrap(ret);
|
|
2094
2094
|
}
|
|
2095
|
-
/**
|
|
2096
|
-
* @returns {string[]}
|
|
2097
|
-
*/
|
|
2098
|
-
get images() {
|
|
2099
|
-
try {
|
|
2100
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2101
|
-
wasm.wasmconversionresult_images(retptr, this.__wbg_ptr);
|
|
2102
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2103
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2104
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2105
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2106
|
-
return v1;
|
|
2107
|
-
} finally {
|
|
2108
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
2095
|
/**
|
|
2112
2096
|
* @returns {WasmHtmlMetadata}
|
|
2113
2097
|
*/
|
|
@@ -2157,14 +2141,6 @@ export class WasmConversionResult {
|
|
|
2157
2141
|
}
|
|
2158
2142
|
wasm.wasmconversionresult_set_document(this.__wbg_ptr, ptr0);
|
|
2159
2143
|
}
|
|
2160
|
-
/**
|
|
2161
|
-
* @param {string[]} value
|
|
2162
|
-
*/
|
|
2163
|
-
set images(value) {
|
|
2164
|
-
const ptr0 = passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
2165
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2166
|
-
wasm.wasmconversionresult_set_images(this.__wbg_ptr, ptr0, len0);
|
|
2167
|
-
}
|
|
2168
2144
|
/**
|
|
2169
2145
|
* @param {WasmHtmlMetadata} value
|
|
2170
2146
|
*/
|
|
@@ -3315,6 +3291,77 @@ export class WasmHtmlMetadata {
|
|
|
3315
3291
|
}
|
|
3316
3292
|
if (Symbol.dispose) WasmHtmlMetadata.prototype[Symbol.dispose] = WasmHtmlMetadata.prototype.free;
|
|
3317
3293
|
|
|
3294
|
+
/**
|
|
3295
|
+
* Image dimensions in pixels.
|
|
3296
|
+
*
|
|
3297
|
+
* Binding-safe replacement for `(u32, u32)` tuples, which degrade to
|
|
3298
|
+
* `Vec<Vec<String>>` when sanitized for cross-language binding generation.
|
|
3299
|
+
* Used by both `ImageMetadata` and
|
|
3300
|
+
* `InlineImage`.
|
|
3301
|
+
*/
|
|
3302
|
+
export class WasmImageDimensions {
|
|
3303
|
+
static __wrap(ptr) {
|
|
3304
|
+
const obj = Object.create(WasmImageDimensions.prototype);
|
|
3305
|
+
obj.__wbg_ptr = ptr;
|
|
3306
|
+
WasmImageDimensionsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3307
|
+
return obj;
|
|
3308
|
+
}
|
|
3309
|
+
__destroy_into_raw() {
|
|
3310
|
+
const ptr = this.__wbg_ptr;
|
|
3311
|
+
this.__wbg_ptr = 0;
|
|
3312
|
+
WasmImageDimensionsFinalization.unregister(this);
|
|
3313
|
+
return ptr;
|
|
3314
|
+
}
|
|
3315
|
+
free() {
|
|
3316
|
+
const ptr = this.__destroy_into_raw();
|
|
3317
|
+
wasm.__wbg_wasmimagedimensions_free(ptr, 0);
|
|
3318
|
+
}
|
|
3319
|
+
/**
|
|
3320
|
+
* @returns {WasmImageDimensions}
|
|
3321
|
+
*/
|
|
3322
|
+
static default() {
|
|
3323
|
+
const ret = wasm.wasmimagedimensions_default();
|
|
3324
|
+
return WasmImageDimensions.__wrap(ret);
|
|
3325
|
+
}
|
|
3326
|
+
/**
|
|
3327
|
+
* @returns {number}
|
|
3328
|
+
*/
|
|
3329
|
+
get height() {
|
|
3330
|
+
const ret = wasm.wasmimagedimensions_height(this.__wbg_ptr);
|
|
3331
|
+
return ret >>> 0;
|
|
3332
|
+
}
|
|
3333
|
+
/**
|
|
3334
|
+
* @param {number} width
|
|
3335
|
+
* @param {number} height
|
|
3336
|
+
*/
|
|
3337
|
+
constructor(width, height) {
|
|
3338
|
+
const ret = wasm.wasmimagedimensions_new(width, height);
|
|
3339
|
+
this.__wbg_ptr = ret;
|
|
3340
|
+
WasmImageDimensionsFinalization.register(this, this.__wbg_ptr, this);
|
|
3341
|
+
return this;
|
|
3342
|
+
}
|
|
3343
|
+
/**
|
|
3344
|
+
* @param {number} value
|
|
3345
|
+
*/
|
|
3346
|
+
set height(value) {
|
|
3347
|
+
wasm.wasmimagedimensions_set_height(this.__wbg_ptr, value);
|
|
3348
|
+
}
|
|
3349
|
+
/**
|
|
3350
|
+
* @param {number} value
|
|
3351
|
+
*/
|
|
3352
|
+
set width(value) {
|
|
3353
|
+
wasm.wasmimagedimensions_set_width(this.__wbg_ptr, value);
|
|
3354
|
+
}
|
|
3355
|
+
/**
|
|
3356
|
+
* @returns {number}
|
|
3357
|
+
*/
|
|
3358
|
+
get width() {
|
|
3359
|
+
const ret = wasm.wasmimagedimensions_width(this.__wbg_ptr);
|
|
3360
|
+
return ret >>> 0;
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
if (Symbol.dispose) WasmImageDimensions.prototype[Symbol.dispose] = WasmImageDimensions.prototype.free;
|
|
3364
|
+
|
|
3318
3365
|
/**
|
|
3319
3366
|
* Image metadata with source and dimensions.
|
|
3320
3367
|
*
|
|
@@ -3380,23 +3427,11 @@ export class WasmImageMetadata {
|
|
|
3380
3427
|
return WasmImageMetadata.__wrap(ret);
|
|
3381
3428
|
}
|
|
3382
3429
|
/**
|
|
3383
|
-
* @returns {
|
|
3430
|
+
* @returns {WasmImageDimensions | undefined}
|
|
3384
3431
|
*/
|
|
3385
3432
|
get dimensions() {
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
wasm.wasmimagemetadata_dimensions(retptr, this.__wbg_ptr);
|
|
3389
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3390
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3391
|
-
let v1;
|
|
3392
|
-
if (r0 !== 0) {
|
|
3393
|
-
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
3394
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
3395
|
-
}
|
|
3396
|
-
return v1;
|
|
3397
|
-
} finally {
|
|
3398
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3399
|
-
}
|
|
3433
|
+
const ret = wasm.wasmimagemetadata_dimensions(this.__wbg_ptr);
|
|
3434
|
+
return ret === 0 ? undefined : WasmImageDimensions.__wrap(ret);
|
|
3400
3435
|
}
|
|
3401
3436
|
/**
|
|
3402
3437
|
* @returns {string}
|
|
@@ -3423,7 +3458,7 @@ export class WasmImageMetadata {
|
|
|
3423
3458
|
* @param {any} attributes
|
|
3424
3459
|
* @param {string | null} [alt]
|
|
3425
3460
|
* @param {string | null} [title]
|
|
3426
|
-
* @param {
|
|
3461
|
+
* @param {WasmImageDimensions | null} [dimensions]
|
|
3427
3462
|
*/
|
|
3428
3463
|
constructor(src, imageType, attributes, alt, title, dimensions) {
|
|
3429
3464
|
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -3432,9 +3467,12 @@ export class WasmImageMetadata {
|
|
|
3432
3467
|
var len1 = WASM_VECTOR_LEN;
|
|
3433
3468
|
var ptr2 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3434
3469
|
var len2 = WASM_VECTOR_LEN;
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3470
|
+
let ptr3 = 0;
|
|
3471
|
+
if (!isLikeNone(dimensions)) {
|
|
3472
|
+
_assertClass(dimensions, WasmImageDimensions);
|
|
3473
|
+
ptr3 = dimensions.__destroy_into_raw();
|
|
3474
|
+
}
|
|
3475
|
+
const ret = wasm.wasmimagemetadata_new(ptr0, len0, imageType, addHeapObject(attributes), ptr1, len1, ptr2, len2, ptr3);
|
|
3438
3476
|
this.__wbg_ptr = ret;
|
|
3439
3477
|
WasmImageMetadataFinalization.register(this, this.__wbg_ptr, this);
|
|
3440
3478
|
return this;
|
|
@@ -3454,12 +3492,15 @@ export class WasmImageMetadata {
|
|
|
3454
3492
|
wasm.wasmimagemetadata_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
3455
3493
|
}
|
|
3456
3494
|
/**
|
|
3457
|
-
* @param {
|
|
3495
|
+
* @param {WasmImageDimensions | null} [value]
|
|
3458
3496
|
*/
|
|
3459
3497
|
set dimensions(value) {
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3498
|
+
let ptr0 = 0;
|
|
3499
|
+
if (!isLikeNone(value)) {
|
|
3500
|
+
_assertClass(value, WasmImageDimensions);
|
|
3501
|
+
ptr0 = value.__destroy_into_raw();
|
|
3502
|
+
}
|
|
3503
|
+
wasm.wasmimagemetadata_set_dimensions(this.__wbg_ptr, ptr0);
|
|
3463
3504
|
}
|
|
3464
3505
|
/**
|
|
3465
3506
|
* @param {WasmImageType} value
|
|
@@ -3780,6 +3821,114 @@ export const WasmListIndentType = Object.freeze({
|
|
|
3780
3821
|
Tabs: 1, "1": "Tabs",
|
|
3781
3822
|
});
|
|
3782
3823
|
|
|
3824
|
+
/**
|
|
3825
|
+
* A single key-value metadata entry from `<head>` meta tags.
|
|
3826
|
+
*
|
|
3827
|
+
* Binding-safe replacement for `(String, String)` tuples used in
|
|
3828
|
+
* `NodeContent.MetadataBlock`. Tuple pairs cannot be represented
|
|
3829
|
+
* across language boundaries without lossy degradation.
|
|
3830
|
+
*/
|
|
3831
|
+
export class WasmMetadataEntry {
|
|
3832
|
+
static __wrap(ptr) {
|
|
3833
|
+
const obj = Object.create(WasmMetadataEntry.prototype);
|
|
3834
|
+
obj.__wbg_ptr = ptr;
|
|
3835
|
+
WasmMetadataEntryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3836
|
+
return obj;
|
|
3837
|
+
}
|
|
3838
|
+
static __unwrap(jsValue) {
|
|
3839
|
+
if (!(jsValue instanceof WasmMetadataEntry)) {
|
|
3840
|
+
return 0;
|
|
3841
|
+
}
|
|
3842
|
+
return jsValue.__destroy_into_raw();
|
|
3843
|
+
}
|
|
3844
|
+
__destroy_into_raw() {
|
|
3845
|
+
const ptr = this.__wbg_ptr;
|
|
3846
|
+
this.__wbg_ptr = 0;
|
|
3847
|
+
WasmMetadataEntryFinalization.unregister(this);
|
|
3848
|
+
return ptr;
|
|
3849
|
+
}
|
|
3850
|
+
free() {
|
|
3851
|
+
const ptr = this.__destroy_into_raw();
|
|
3852
|
+
wasm.__wbg_wasmmetadataentry_free(ptr, 0);
|
|
3853
|
+
}
|
|
3854
|
+
/**
|
|
3855
|
+
* @returns {WasmMetadataEntry}
|
|
3856
|
+
*/
|
|
3857
|
+
static default() {
|
|
3858
|
+
const ret = wasm.wasmmetadataentry_default();
|
|
3859
|
+
return WasmMetadataEntry.__wrap(ret);
|
|
3860
|
+
}
|
|
3861
|
+
/**
|
|
3862
|
+
* @returns {string}
|
|
3863
|
+
*/
|
|
3864
|
+
get key() {
|
|
3865
|
+
let deferred1_0;
|
|
3866
|
+
let deferred1_1;
|
|
3867
|
+
try {
|
|
3868
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3869
|
+
wasm.wasmmetadataentry_key(retptr, this.__wbg_ptr);
|
|
3870
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3871
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3872
|
+
deferred1_0 = r0;
|
|
3873
|
+
deferred1_1 = r1;
|
|
3874
|
+
return getStringFromWasm0(r0, r1);
|
|
3875
|
+
} finally {
|
|
3876
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3877
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
/**
|
|
3881
|
+
* @param {string} key
|
|
3882
|
+
* @param {string} value
|
|
3883
|
+
*/
|
|
3884
|
+
constructor(key, value) {
|
|
3885
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3886
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3887
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3888
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3889
|
+
const ret = wasm.wasmmetadataentry_new(ptr0, len0, ptr1, len1);
|
|
3890
|
+
this.__wbg_ptr = ret;
|
|
3891
|
+
WasmMetadataEntryFinalization.register(this, this.__wbg_ptr, this);
|
|
3892
|
+
return this;
|
|
3893
|
+
}
|
|
3894
|
+
/**
|
|
3895
|
+
* @param {string} value
|
|
3896
|
+
*/
|
|
3897
|
+
set key(value) {
|
|
3898
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3899
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3900
|
+
wasm.wasmmetadataentry_set_key(this.__wbg_ptr, ptr0, len0);
|
|
3901
|
+
}
|
|
3902
|
+
/**
|
|
3903
|
+
* @param {string} value
|
|
3904
|
+
*/
|
|
3905
|
+
set value(value) {
|
|
3906
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3907
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3908
|
+
wasm.wasmmetadataentry_set_value(this.__wbg_ptr, ptr0, len0);
|
|
3909
|
+
}
|
|
3910
|
+
/**
|
|
3911
|
+
* @returns {string}
|
|
3912
|
+
*/
|
|
3913
|
+
get value() {
|
|
3914
|
+
let deferred1_0;
|
|
3915
|
+
let deferred1_1;
|
|
3916
|
+
try {
|
|
3917
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3918
|
+
wasm.wasmmetadataentry_value(retptr, this.__wbg_ptr);
|
|
3919
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3920
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3921
|
+
deferred1_0 = r0;
|
|
3922
|
+
deferred1_1 = r1;
|
|
3923
|
+
return getStringFromWasm0(r0, r1);
|
|
3924
|
+
} finally {
|
|
3925
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3926
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
if (Symbol.dispose) WasmMetadataEntry.prototype[Symbol.dispose] = WasmMetadataEntry.prototype.free;
|
|
3931
|
+
|
|
3783
3932
|
/**
|
|
3784
3933
|
* Line break syntax in Markdown output.
|
|
3785
3934
|
*
|
|
@@ -3878,11 +4027,23 @@ export class WasmNodeContent {
|
|
|
3878
4027
|
}
|
|
3879
4028
|
}
|
|
3880
4029
|
/**
|
|
3881
|
-
* @returns {
|
|
4030
|
+
* @returns {WasmMetadataEntry[] | undefined}
|
|
3882
4031
|
*/
|
|
3883
4032
|
get entries() {
|
|
3884
|
-
|
|
3885
|
-
|
|
4033
|
+
try {
|
|
4034
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4035
|
+
wasm.wasmnodecontent_entries(retptr, this.__wbg_ptr);
|
|
4036
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4037
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4038
|
+
let v1;
|
|
4039
|
+
if (r0 !== 0) {
|
|
4040
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
4041
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
4042
|
+
}
|
|
4043
|
+
return v1;
|
|
4044
|
+
} finally {
|
|
4045
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4046
|
+
}
|
|
3886
4047
|
}
|
|
3887
4048
|
/**
|
|
3888
4049
|
* @returns {string | undefined}
|
|
@@ -4045,10 +4206,12 @@ export class WasmNodeContent {
|
|
|
4045
4206
|
wasm.wasmnodecontent_set_description(this.__wbg_ptr, ptr0, len0);
|
|
4046
4207
|
}
|
|
4047
4208
|
/**
|
|
4048
|
-
* @param {
|
|
4209
|
+
* @param {WasmMetadataEntry[] | null} [value]
|
|
4049
4210
|
*/
|
|
4050
4211
|
set entries(value) {
|
|
4051
|
-
|
|
4212
|
+
var ptr0 = isLikeNone(value) ? 0 : passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
4213
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4214
|
+
wasm.wasmnodecontent_set_entries(this.__wbg_ptr, ptr0, len0);
|
|
4052
4215
|
}
|
|
4053
4216
|
/**
|
|
4054
4217
|
* @param {string | null} [value]
|
|
@@ -4213,7 +4376,21 @@ if (Symbol.dispose) WasmNodeContent.prototype[Symbol.dispose] = WasmNodeContent.
|
|
|
4213
4376
|
* Context information passed to all visitor methods.
|
|
4214
4377
|
*
|
|
4215
4378
|
* Provides comprehensive metadata about the current node being visited,
|
|
4216
|
-
* including its type,
|
|
4379
|
+
* including its type, tag name, position in the DOM tree, and parent context.
|
|
4380
|
+
*
|
|
4381
|
+
* ## Attributes
|
|
4382
|
+
*
|
|
4383
|
+
* Access attributes via `NodeContext.attributes`, which returns
|
|
4384
|
+
* `&BTreeMap<String, String>`. When the context was built with
|
|
4385
|
+
* `NodeContext.with_lazy_attributes` (the hot path inside the converter),
|
|
4386
|
+
* the map is only materialized on the first call — if the visitor never reads
|
|
4387
|
+
* attributes, the allocation is skipped.
|
|
4388
|
+
*
|
|
4389
|
+
* ## Lifetimes
|
|
4390
|
+
*
|
|
4391
|
+
* String fields use `Cow<'_, str>` so the converter can pass slices directly
|
|
4392
|
+
* out of the parsed DOM without allocating. Visitor implementations that need
|
|
4393
|
+
* to outlive the callback should call `NodeContext.into_owned`.
|
|
4217
4394
|
*/
|
|
4218
4395
|
export class WasmNodeContext {
|
|
4219
4396
|
static __wrap(ptr) {
|
|
@@ -4233,9 +4410,14 @@ export class WasmNodeContext {
|
|
|
4233
4410
|
wasm.__wbg_wasmnodecontext_free(ptr, 0);
|
|
4234
4411
|
}
|
|
4235
4412
|
/**
|
|
4413
|
+
* Return a reference to the attribute map.
|
|
4414
|
+
*
|
|
4415
|
+
* If the context was built with `NodeContext.with_lazy_attributes`, the
|
|
4416
|
+
* map is materialized on the first call and cached for subsequent calls.
|
|
4417
|
+
* If this method is never called, no allocation occurs for attributes.
|
|
4236
4418
|
* @returns {any}
|
|
4237
4419
|
*/
|
|
4238
|
-
|
|
4420
|
+
attributes() {
|
|
4239
4421
|
const ret = wasm.wasmnodecontext_attributes(this.__wbg_ptr);
|
|
4240
4422
|
return takeObject(ret);
|
|
4241
4423
|
}
|
|
@@ -4260,6 +4442,14 @@ export class WasmNodeContext {
|
|
|
4260
4442
|
const ret = wasm.wasmnodecontext_indexInParent(this.__wbg_ptr);
|
|
4261
4443
|
return ret >>> 0;
|
|
4262
4444
|
}
|
|
4445
|
+
/**
|
|
4446
|
+
* Promote any borrowed fields into owned storage so the context can outlive `'a`.
|
|
4447
|
+
* @returns {WasmNodeContext}
|
|
4448
|
+
*/
|
|
4449
|
+
intoOwned() {
|
|
4450
|
+
const ret = wasm.wasmnodecontext_intoOwned(this.__wbg_ptr);
|
|
4451
|
+
return WasmNodeContext.__wrap(ret);
|
|
4452
|
+
}
|
|
4263
4453
|
/**
|
|
4264
4454
|
* @returns {boolean}
|
|
4265
4455
|
*/
|
|
@@ -4270,18 +4460,17 @@ export class WasmNodeContext {
|
|
|
4270
4460
|
/**
|
|
4271
4461
|
* @param {WasmNodeType} nodeType
|
|
4272
4462
|
* @param {string} tagName
|
|
4273
|
-
* @param {any} attributes
|
|
4274
4463
|
* @param {number} depth
|
|
4275
4464
|
* @param {number} indexInParent
|
|
4276
4465
|
* @param {boolean} isInline
|
|
4277
4466
|
* @param {string | null} [parentTag]
|
|
4278
4467
|
*/
|
|
4279
|
-
constructor(nodeType, tagName,
|
|
4468
|
+
constructor(nodeType, tagName, depth, indexInParent, isInline, parentTag) {
|
|
4280
4469
|
const ptr0 = passStringToWasm0(tagName, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4281
4470
|
const len0 = WASM_VECTOR_LEN;
|
|
4282
4471
|
var ptr1 = isLikeNone(parentTag) ? 0 : passStringToWasm0(parentTag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4283
4472
|
var len1 = WASM_VECTOR_LEN;
|
|
4284
|
-
const ret = wasm.wasmnodecontext_new(nodeType, ptr0, len0,
|
|
4473
|
+
const ret = wasm.wasmnodecontext_new(nodeType, ptr0, len0, depth, indexInParent, isInline, ptr1, len1);
|
|
4285
4474
|
this.__wbg_ptr = ret;
|
|
4286
4475
|
WasmNodeContextFinalization.register(this, this.__wbg_ptr, this);
|
|
4287
4476
|
return this;
|
|
@@ -4324,12 +4513,6 @@ export class WasmNodeContext {
|
|
|
4324
4513
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4325
4514
|
}
|
|
4326
4515
|
}
|
|
4327
|
-
/**
|
|
4328
|
-
* @param {any} value
|
|
4329
|
-
*/
|
|
4330
|
-
set attributes(value) {
|
|
4331
|
-
wasm.wasmnodecontext_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
4332
|
-
}
|
|
4333
4516
|
/**
|
|
4334
4517
|
* @param {number} value
|
|
4335
4518
|
*/
|
|
@@ -4389,6 +4572,28 @@ export class WasmNodeContext {
|
|
|
4389
4572
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
4390
4573
|
}
|
|
4391
4574
|
}
|
|
4575
|
+
/**
|
|
4576
|
+
* Construct a `NodeContext` with an owned attribute map.
|
|
4577
|
+
*
|
|
4578
|
+
* Prefer `NodeContext.with_lazy_attributes` (pub(crate)) inside the
|
|
4579
|
+
* converter to avoid the eager `collect_tag_attributes` allocation.
|
|
4580
|
+
* @param {WasmNodeType} node_type
|
|
4581
|
+
* @param {string} tag_name
|
|
4582
|
+
* @param {any} attributes
|
|
4583
|
+
* @param {number} depth
|
|
4584
|
+
* @param {number} index_in_parent
|
|
4585
|
+
* @param {string | null | undefined} parent_tag
|
|
4586
|
+
* @param {boolean} is_inline
|
|
4587
|
+
* @returns {WasmNodeContext}
|
|
4588
|
+
*/
|
|
4589
|
+
static withOwnedAttributes(node_type, tag_name, attributes, depth, index_in_parent, parent_tag, is_inline) {
|
|
4590
|
+
const ptr0 = passStringToWasm0(tag_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4591
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4592
|
+
var ptr1 = isLikeNone(parent_tag) ? 0 : passStringToWasm0(parent_tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4593
|
+
var len1 = WASM_VECTOR_LEN;
|
|
4594
|
+
const ret = wasm.wasmnodecontext_withOwnedAttributes(node_type, ptr0, len0, addHeapObject(attributes), depth, index_in_parent, ptr1, len1, is_inline);
|
|
4595
|
+
return WasmNodeContext.__wrap(ret);
|
|
4596
|
+
}
|
|
4392
4597
|
}
|
|
4393
4598
|
if (Symbol.dispose) WasmNodeContext.prototype[Symbol.dispose] = WasmNodeContext.prototype.free;
|
|
4394
4599
|
|
|
@@ -4845,7 +5050,7 @@ export class WasmProcessingWarning {
|
|
|
4845
5050
|
if (Symbol.dispose) WasmProcessingWarning.prototype[Symbol.dispose] = WasmProcessingWarning.prototype.free;
|
|
4846
5051
|
|
|
4847
5052
|
/**
|
|
4848
|
-
* Structured data block (JSON-LD, Microdata, or RDFa).
|
|
5053
|
+
* Structured data block (JSON-LD, Microdata, or `RDFa`).
|
|
4849
5054
|
*
|
|
4850
5055
|
* Represents machine-readable structured data found in the document.
|
|
4851
5056
|
* JSON-LD blocks are collected as raw JSON strings for flexibility.
|
|
@@ -5443,20 +5648,46 @@ export function convert(html, options) {
|
|
|
5443
5648
|
function __wbg_get_imports() {
|
|
5444
5649
|
const import0 = {
|
|
5445
5650
|
__proto__: null,
|
|
5446
|
-
|
|
5651
|
+
__wbg_Error_9dc85fe1bc224456: function(arg0, arg1) {
|
|
5652
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
5653
|
+
return addHeapObject(ret);
|
|
5654
|
+
},
|
|
5655
|
+
__wbg___wbindgen_boolean_get_b131b2f36d6b2f55: function(arg0) {
|
|
5656
|
+
const v = getObject(arg0);
|
|
5657
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
5658
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
5659
|
+
},
|
|
5660
|
+
__wbg___wbindgen_debug_string_56c147eb1a51f0c4: function(arg0, arg1) {
|
|
5661
|
+
const ret = debugString(getObject(arg1));
|
|
5662
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
5663
|
+
const len1 = WASM_VECTOR_LEN;
|
|
5664
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5665
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5666
|
+
},
|
|
5667
|
+
__wbg___wbindgen_is_function_147961669f068cd4: function(arg0) {
|
|
5447
5668
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
5448
5669
|
return ret;
|
|
5449
5670
|
},
|
|
5450
|
-
|
|
5671
|
+
__wbg___wbindgen_is_object_3a2c414391dbf751: function(arg0) {
|
|
5451
5672
|
const val = getObject(arg0);
|
|
5452
5673
|
const ret = typeof(val) === 'object' && val !== null;
|
|
5453
5674
|
return ret;
|
|
5454
5675
|
},
|
|
5455
|
-
|
|
5676
|
+
__wbg___wbindgen_is_undefined_4410e3c20a99fa97: function(arg0) {
|
|
5456
5677
|
const ret = getObject(arg0) === undefined;
|
|
5457
5678
|
return ret;
|
|
5458
5679
|
},
|
|
5459
|
-
|
|
5680
|
+
__wbg___wbindgen_jsval_loose_eq_e07e3b1f5db6da6c: function(arg0, arg1) {
|
|
5681
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
5682
|
+
return ret;
|
|
5683
|
+
},
|
|
5684
|
+
__wbg___wbindgen_number_get_588ed6b97f0d7e14: function(arg0, arg1) {
|
|
5685
|
+
const obj = getObject(arg1);
|
|
5686
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
5687
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
5688
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
5689
|
+
},
|
|
5690
|
+
__wbg___wbindgen_string_get_fa2687d531ed17a5: function(arg0, arg1) {
|
|
5460
5691
|
const obj = getObject(arg1);
|
|
5461
5692
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
5462
5693
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -5464,47 +5695,126 @@ function __wbg_get_imports() {
|
|
|
5464
5695
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5465
5696
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5466
5697
|
},
|
|
5467
|
-
|
|
5698
|
+
__wbg___wbindgen_throw_bbadd78c1bac3a77: function(arg0, arg1) {
|
|
5468
5699
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5469
5700
|
},
|
|
5470
|
-
|
|
5701
|
+
__wbg_apply_5d99f956e2dda74d: function() { return handleError(function (arg0, arg1, arg2) {
|
|
5471
5702
|
const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
|
|
5472
5703
|
return addHeapObject(ret);
|
|
5473
5704
|
}, arguments); },
|
|
5474
|
-
|
|
5705
|
+
__wbg_call_91f00ddc43e01490: function() { return handleError(function (arg0, arg1) {
|
|
5706
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
5707
|
+
return addHeapObject(ret);
|
|
5708
|
+
}, arguments); },
|
|
5709
|
+
__wbg_done_6a8439e544ec6206: function(arg0) {
|
|
5710
|
+
const ret = getObject(arg0).done;
|
|
5711
|
+
return ret;
|
|
5712
|
+
},
|
|
5713
|
+
__wbg_entries_5a6a7e7e0df09fe5: function(arg0) {
|
|
5714
|
+
const ret = Object.entries(getObject(arg0));
|
|
5715
|
+
return addHeapObject(ret);
|
|
5716
|
+
},
|
|
5717
|
+
__wbg_get_44e98e27bda25b5b: function() { return handleError(function (arg0, arg1) {
|
|
5718
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
5719
|
+
return addHeapObject(ret);
|
|
5720
|
+
}, arguments); },
|
|
5721
|
+
__wbg_get_4b90d6d8c5deb5d5: function(arg0, arg1) {
|
|
5722
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
5723
|
+
return addHeapObject(ret);
|
|
5724
|
+
},
|
|
5725
|
+
__wbg_get_52a8a619f7b88df6: function() { return handleError(function (arg0, arg1) {
|
|
5475
5726
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
5476
5727
|
return addHeapObject(ret);
|
|
5477
5728
|
}, arguments); },
|
|
5478
|
-
|
|
5729
|
+
__wbg_get_unchecked_46e778e3cec74b5e: function(arg0, arg1) {
|
|
5730
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
5731
|
+
return addHeapObject(ret);
|
|
5732
|
+
},
|
|
5733
|
+
__wbg_has_14676d88c1340d2c: function() { return handleError(function (arg0, arg1) {
|
|
5479
5734
|
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
5480
5735
|
return ret;
|
|
5481
5736
|
}, arguments); },
|
|
5482
|
-
|
|
5483
|
-
|
|
5737
|
+
__wbg_instanceof_ArrayBuffer_a581da923203f29f: function(arg0) {
|
|
5738
|
+
let result;
|
|
5739
|
+
try {
|
|
5740
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
5741
|
+
} catch (_) {
|
|
5742
|
+
result = false;
|
|
5743
|
+
}
|
|
5744
|
+
const ret = result;
|
|
5745
|
+
return ret;
|
|
5746
|
+
},
|
|
5747
|
+
__wbg_instanceof_Uint8Array_b6fe1ac89eba107e: function(arg0) {
|
|
5748
|
+
let result;
|
|
5749
|
+
try {
|
|
5750
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
5751
|
+
} catch (_) {
|
|
5752
|
+
result = false;
|
|
5753
|
+
}
|
|
5754
|
+
const ret = result;
|
|
5755
|
+
return ret;
|
|
5756
|
+
},
|
|
5757
|
+
__wbg_iterator_9b36cebf3be7b7cd: function() {
|
|
5758
|
+
const ret = Symbol.iterator;
|
|
5484
5759
|
return addHeapObject(ret);
|
|
5485
5760
|
},
|
|
5486
|
-
|
|
5761
|
+
__wbg_length_68a9d5278d084f4f: function(arg0) {
|
|
5762
|
+
const ret = getObject(arg0).length;
|
|
5763
|
+
return ret;
|
|
5764
|
+
},
|
|
5765
|
+
__wbg_length_fb04d16d7bdf6d4c: function(arg0) {
|
|
5766
|
+
const ret = getObject(arg0).length;
|
|
5767
|
+
return ret;
|
|
5768
|
+
},
|
|
5769
|
+
__wbg_new_0b303268aa395a38: function() {
|
|
5487
5770
|
const ret = new Array();
|
|
5488
5771
|
return addHeapObject(ret);
|
|
5489
5772
|
},
|
|
5490
|
-
|
|
5773
|
+
__wbg_new_20b778a4c5c691c3: function() {
|
|
5774
|
+
const ret = new Object();
|
|
5775
|
+
return addHeapObject(ret);
|
|
5776
|
+
},
|
|
5777
|
+
__wbg_new_883c0db065f06efd: function() {
|
|
5778
|
+
const ret = new Map();
|
|
5779
|
+
return addHeapObject(ret);
|
|
5780
|
+
},
|
|
5781
|
+
__wbg_new_b06772b280cc6e52: function(arg0) {
|
|
5782
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
5783
|
+
return addHeapObject(ret);
|
|
5784
|
+
},
|
|
5785
|
+
__wbg_next_8cb028b6ba50743f: function() { return handleError(function (arg0) {
|
|
5786
|
+
const ret = getObject(arg0).next();
|
|
5787
|
+
return addHeapObject(ret);
|
|
5788
|
+
}, arguments); },
|
|
5789
|
+
__wbg_next_cfd0b146c9538df8: function(arg0) {
|
|
5790
|
+
const ret = getObject(arg0).next;
|
|
5791
|
+
return addHeapObject(ret);
|
|
5792
|
+
},
|
|
5793
|
+
__wbg_parse_246201845d0eb98c: function() { return handleError(function (arg0, arg1) {
|
|
5491
5794
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
5492
5795
|
return addHeapObject(ret);
|
|
5493
5796
|
}, arguments); },
|
|
5494
|
-
|
|
5797
|
+
__wbg_prototypesetcall_956c7493c68e29b4: function(arg0, arg1, arg2) {
|
|
5798
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
5799
|
+
},
|
|
5800
|
+
__wbg_push_ceb8ef046afb2041: function(arg0, arg1) {
|
|
5495
5801
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
5496
5802
|
return ret;
|
|
5497
5803
|
},
|
|
5498
5804
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
5499
5805
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
5500
5806
|
},
|
|
5501
|
-
|
|
5807
|
+
__wbg_set_a6ba3ac0e634b822: function() { return handleError(function (arg0, arg1, arg2) {
|
|
5502
5808
|
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
5503
5809
|
return ret;
|
|
5504
5810
|
}, arguments); },
|
|
5505
|
-
|
|
5811
|
+
__wbg_set_da33c120a6584674: function(arg0, arg1, arg2) {
|
|
5506
5812
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
5507
5813
|
},
|
|
5814
|
+
__wbg_value_3d3defe09fb1ffca: function(arg0) {
|
|
5815
|
+
const ret = getObject(arg0).value;
|
|
5816
|
+
return addHeapObject(ret);
|
|
5817
|
+
},
|
|
5508
5818
|
__wbg_wasmdocumentnode_new: function(arg0) {
|
|
5509
5819
|
const ret = WasmDocumentNode.__wrap(arg0);
|
|
5510
5820
|
return addHeapObject(ret);
|
|
@@ -5545,6 +5855,14 @@ function __wbg_get_imports() {
|
|
|
5545
5855
|
const ret = WasmLinkMetadata.__unwrap(getObject(arg0));
|
|
5546
5856
|
return ret;
|
|
5547
5857
|
},
|
|
5858
|
+
__wbg_wasmmetadataentry_new: function(arg0) {
|
|
5859
|
+
const ret = WasmMetadataEntry.__wrap(arg0);
|
|
5860
|
+
return addHeapObject(ret);
|
|
5861
|
+
},
|
|
5862
|
+
__wbg_wasmmetadataentry_unwrap: function(arg0) {
|
|
5863
|
+
const ret = WasmMetadataEntry.__unwrap(getObject(arg0));
|
|
5864
|
+
return ret;
|
|
5865
|
+
},
|
|
5548
5866
|
__wbg_wasmprocessingwarning_new: function(arg0) {
|
|
5549
5867
|
const ret = WasmProcessingWarning.__wrap(arg0);
|
|
5550
5868
|
return addHeapObject(ret);
|
|
@@ -5631,12 +5949,18 @@ const WasmHeaderMetadataFinalization = (typeof FinalizationRegistry === 'undefin
|
|
|
5631
5949
|
const WasmHtmlMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5632
5950
|
? { register: () => {}, unregister: () => {} }
|
|
5633
5951
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlmetadata_free(ptr, 1));
|
|
5952
|
+
const WasmImageDimensionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5953
|
+
? { register: () => {}, unregister: () => {} }
|
|
5954
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmimagedimensions_free(ptr, 1));
|
|
5634
5955
|
const WasmImageMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5635
5956
|
? { register: () => {}, unregister: () => {} }
|
|
5636
5957
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmimagemetadata_free(ptr, 1));
|
|
5637
5958
|
const WasmLinkMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5638
5959
|
? { register: () => {}, unregister: () => {} }
|
|
5639
5960
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmlinkmetadata_free(ptr, 1));
|
|
5961
|
+
const WasmMetadataEntryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5962
|
+
? { register: () => {}, unregister: () => {} }
|
|
5963
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataentry_free(ptr, 1));
|
|
5640
5964
|
const WasmNodeContentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5641
5965
|
? { register: () => {}, unregister: () => {} }
|
|
5642
5966
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnodecontent_free(ptr, 1));
|
|
@@ -5683,6 +6007,71 @@ function _assertClass(instance, klass) {
|
|
|
5683
6007
|
}
|
|
5684
6008
|
}
|
|
5685
6009
|
|
|
6010
|
+
function debugString(val) {
|
|
6011
|
+
// primitive types
|
|
6012
|
+
const type = typeof val;
|
|
6013
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
6014
|
+
return `${val}`;
|
|
6015
|
+
}
|
|
6016
|
+
if (type == 'string') {
|
|
6017
|
+
return `"${val}"`;
|
|
6018
|
+
}
|
|
6019
|
+
if (type == 'symbol') {
|
|
6020
|
+
const description = val.description;
|
|
6021
|
+
if (description == null) {
|
|
6022
|
+
return 'Symbol';
|
|
6023
|
+
} else {
|
|
6024
|
+
return `Symbol(${description})`;
|
|
6025
|
+
}
|
|
6026
|
+
}
|
|
6027
|
+
if (type == 'function') {
|
|
6028
|
+
const name = val.name;
|
|
6029
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
6030
|
+
return `Function(${name})`;
|
|
6031
|
+
} else {
|
|
6032
|
+
return 'Function';
|
|
6033
|
+
}
|
|
6034
|
+
}
|
|
6035
|
+
// objects
|
|
6036
|
+
if (Array.isArray(val)) {
|
|
6037
|
+
const length = val.length;
|
|
6038
|
+
let debug = '[';
|
|
6039
|
+
if (length > 0) {
|
|
6040
|
+
debug += debugString(val[0]);
|
|
6041
|
+
}
|
|
6042
|
+
for(let i = 1; i < length; i++) {
|
|
6043
|
+
debug += ', ' + debugString(val[i]);
|
|
6044
|
+
}
|
|
6045
|
+
debug += ']';
|
|
6046
|
+
return debug;
|
|
6047
|
+
}
|
|
6048
|
+
// Test for built-in
|
|
6049
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
6050
|
+
let className;
|
|
6051
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
6052
|
+
className = builtInMatches[1];
|
|
6053
|
+
} else {
|
|
6054
|
+
// Failed to match the standard '[object ClassName]'
|
|
6055
|
+
return toString.call(val);
|
|
6056
|
+
}
|
|
6057
|
+
if (className == 'Object') {
|
|
6058
|
+
// we're a user defined class or Object
|
|
6059
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
6060
|
+
// easier than looping through ownProperties of `val`.
|
|
6061
|
+
try {
|
|
6062
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
6063
|
+
} catch (_) {
|
|
6064
|
+
return 'Object';
|
|
6065
|
+
}
|
|
6066
|
+
}
|
|
6067
|
+
// errors
|
|
6068
|
+
if (val instanceof Error) {
|
|
6069
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
6070
|
+
}
|
|
6071
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
6072
|
+
return className;
|
|
6073
|
+
}
|
|
6074
|
+
|
|
5686
6075
|
function dropObject(idx) {
|
|
5687
6076
|
if (idx < 1028) return;
|
|
5688
6077
|
heap[idx] = heap_next;
|
|
@@ -5704,6 +6093,11 @@ function getArrayU32FromWasm0(ptr, len) {
|
|
|
5704
6093
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
5705
6094
|
}
|
|
5706
6095
|
|
|
6096
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
6097
|
+
ptr = ptr >>> 0;
|
|
6098
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
6099
|
+
}
|
|
6100
|
+
|
|
5707
6101
|
let cachedDataViewMemory0 = null;
|
|
5708
6102
|
function getDataViewMemory0() {
|
|
5709
6103
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|