@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
|
@@ -2096,22 +2096,6 @@ class WasmConversionResult {
|
|
|
2096
2096
|
const ret = wasm.wasmconversionresult_document(this.__wbg_ptr);
|
|
2097
2097
|
return ret === 0 ? undefined : WasmDocumentStructure.__wrap(ret);
|
|
2098
2098
|
}
|
|
2099
|
-
/**
|
|
2100
|
-
* @returns {string[]}
|
|
2101
|
-
*/
|
|
2102
|
-
get images() {
|
|
2103
|
-
try {
|
|
2104
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2105
|
-
wasm.wasmconversionresult_images(retptr, this.__wbg_ptr);
|
|
2106
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2107
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2108
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2109
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2110
|
-
return v1;
|
|
2111
|
-
} finally {
|
|
2112
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
2099
|
/**
|
|
2116
2100
|
* @returns {WasmHtmlMetadata}
|
|
2117
2101
|
*/
|
|
@@ -2161,14 +2145,6 @@ class WasmConversionResult {
|
|
|
2161
2145
|
}
|
|
2162
2146
|
wasm.wasmconversionresult_set_document(this.__wbg_ptr, ptr0);
|
|
2163
2147
|
}
|
|
2164
|
-
/**
|
|
2165
|
-
* @param {string[]} value
|
|
2166
|
-
*/
|
|
2167
|
-
set images(value) {
|
|
2168
|
-
const ptr0 = passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
2169
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2170
|
-
wasm.wasmconversionresult_set_images(this.__wbg_ptr, ptr0, len0);
|
|
2171
|
-
}
|
|
2172
2148
|
/**
|
|
2173
2149
|
* @param {WasmHtmlMetadata} value
|
|
2174
2150
|
*/
|
|
@@ -3328,6 +3304,78 @@ class WasmHtmlMetadata {
|
|
|
3328
3304
|
if (Symbol.dispose) WasmHtmlMetadata.prototype[Symbol.dispose] = WasmHtmlMetadata.prototype.free;
|
|
3329
3305
|
exports.WasmHtmlMetadata = WasmHtmlMetadata;
|
|
3330
3306
|
|
|
3307
|
+
/**
|
|
3308
|
+
* Image dimensions in pixels.
|
|
3309
|
+
*
|
|
3310
|
+
* Binding-safe replacement for `(u32, u32)` tuples, which degrade to
|
|
3311
|
+
* `Vec<Vec<String>>` when sanitized for cross-language binding generation.
|
|
3312
|
+
* Used by both `ImageMetadata` and
|
|
3313
|
+
* `InlineImage`.
|
|
3314
|
+
*/
|
|
3315
|
+
class WasmImageDimensions {
|
|
3316
|
+
static __wrap(ptr) {
|
|
3317
|
+
const obj = Object.create(WasmImageDimensions.prototype);
|
|
3318
|
+
obj.__wbg_ptr = ptr;
|
|
3319
|
+
WasmImageDimensionsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3320
|
+
return obj;
|
|
3321
|
+
}
|
|
3322
|
+
__destroy_into_raw() {
|
|
3323
|
+
const ptr = this.__wbg_ptr;
|
|
3324
|
+
this.__wbg_ptr = 0;
|
|
3325
|
+
WasmImageDimensionsFinalization.unregister(this);
|
|
3326
|
+
return ptr;
|
|
3327
|
+
}
|
|
3328
|
+
free() {
|
|
3329
|
+
const ptr = this.__destroy_into_raw();
|
|
3330
|
+
wasm.__wbg_wasmimagedimensions_free(ptr, 0);
|
|
3331
|
+
}
|
|
3332
|
+
/**
|
|
3333
|
+
* @returns {WasmImageDimensions}
|
|
3334
|
+
*/
|
|
3335
|
+
static default() {
|
|
3336
|
+
const ret = wasm.wasmimagedimensions_default();
|
|
3337
|
+
return WasmImageDimensions.__wrap(ret);
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* @returns {number}
|
|
3341
|
+
*/
|
|
3342
|
+
get height() {
|
|
3343
|
+
const ret = wasm.wasmimagedimensions_height(this.__wbg_ptr);
|
|
3344
|
+
return ret >>> 0;
|
|
3345
|
+
}
|
|
3346
|
+
/**
|
|
3347
|
+
* @param {number} width
|
|
3348
|
+
* @param {number} height
|
|
3349
|
+
*/
|
|
3350
|
+
constructor(width, height) {
|
|
3351
|
+
const ret = wasm.wasmimagedimensions_new(width, height);
|
|
3352
|
+
this.__wbg_ptr = ret;
|
|
3353
|
+
WasmImageDimensionsFinalization.register(this, this.__wbg_ptr, this);
|
|
3354
|
+
return this;
|
|
3355
|
+
}
|
|
3356
|
+
/**
|
|
3357
|
+
* @param {number} value
|
|
3358
|
+
*/
|
|
3359
|
+
set height(value) {
|
|
3360
|
+
wasm.wasmimagedimensions_set_height(this.__wbg_ptr, value);
|
|
3361
|
+
}
|
|
3362
|
+
/**
|
|
3363
|
+
* @param {number} value
|
|
3364
|
+
*/
|
|
3365
|
+
set width(value) {
|
|
3366
|
+
wasm.wasmimagedimensions_set_width(this.__wbg_ptr, value);
|
|
3367
|
+
}
|
|
3368
|
+
/**
|
|
3369
|
+
* @returns {number}
|
|
3370
|
+
*/
|
|
3371
|
+
get width() {
|
|
3372
|
+
const ret = wasm.wasmimagedimensions_width(this.__wbg_ptr);
|
|
3373
|
+
return ret >>> 0;
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
if (Symbol.dispose) WasmImageDimensions.prototype[Symbol.dispose] = WasmImageDimensions.prototype.free;
|
|
3377
|
+
exports.WasmImageDimensions = WasmImageDimensions;
|
|
3378
|
+
|
|
3331
3379
|
/**
|
|
3332
3380
|
* Image metadata with source and dimensions.
|
|
3333
3381
|
*
|
|
@@ -3393,23 +3441,11 @@ class WasmImageMetadata {
|
|
|
3393
3441
|
return WasmImageMetadata.__wrap(ret);
|
|
3394
3442
|
}
|
|
3395
3443
|
/**
|
|
3396
|
-
* @returns {
|
|
3444
|
+
* @returns {WasmImageDimensions | undefined}
|
|
3397
3445
|
*/
|
|
3398
3446
|
get dimensions() {
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
wasm.wasmimagemetadata_dimensions(retptr, this.__wbg_ptr);
|
|
3402
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3403
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3404
|
-
let v1;
|
|
3405
|
-
if (r0 !== 0) {
|
|
3406
|
-
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
3407
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
3408
|
-
}
|
|
3409
|
-
return v1;
|
|
3410
|
-
} finally {
|
|
3411
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3412
|
-
}
|
|
3447
|
+
const ret = wasm.wasmimagemetadata_dimensions(this.__wbg_ptr);
|
|
3448
|
+
return ret === 0 ? undefined : WasmImageDimensions.__wrap(ret);
|
|
3413
3449
|
}
|
|
3414
3450
|
/**
|
|
3415
3451
|
* @returns {string}
|
|
@@ -3436,7 +3472,7 @@ class WasmImageMetadata {
|
|
|
3436
3472
|
* @param {any} attributes
|
|
3437
3473
|
* @param {string | null} [alt]
|
|
3438
3474
|
* @param {string | null} [title]
|
|
3439
|
-
* @param {
|
|
3475
|
+
* @param {WasmImageDimensions | null} [dimensions]
|
|
3440
3476
|
*/
|
|
3441
3477
|
constructor(src, imageType, attributes, alt, title, dimensions) {
|
|
3442
3478
|
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -3445,9 +3481,12 @@ class WasmImageMetadata {
|
|
|
3445
3481
|
var len1 = WASM_VECTOR_LEN;
|
|
3446
3482
|
var ptr2 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3447
3483
|
var len2 = WASM_VECTOR_LEN;
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3484
|
+
let ptr3 = 0;
|
|
3485
|
+
if (!isLikeNone(dimensions)) {
|
|
3486
|
+
_assertClass(dimensions, WasmImageDimensions);
|
|
3487
|
+
ptr3 = dimensions.__destroy_into_raw();
|
|
3488
|
+
}
|
|
3489
|
+
const ret = wasm.wasmimagemetadata_new(ptr0, len0, imageType, addHeapObject(attributes), ptr1, len1, ptr2, len2, ptr3);
|
|
3451
3490
|
this.__wbg_ptr = ret;
|
|
3452
3491
|
WasmImageMetadataFinalization.register(this, this.__wbg_ptr, this);
|
|
3453
3492
|
return this;
|
|
@@ -3467,12 +3506,15 @@ class WasmImageMetadata {
|
|
|
3467
3506
|
wasm.wasmimagemetadata_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
3468
3507
|
}
|
|
3469
3508
|
/**
|
|
3470
|
-
* @param {
|
|
3509
|
+
* @param {WasmImageDimensions | null} [value]
|
|
3471
3510
|
*/
|
|
3472
3511
|
set dimensions(value) {
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3512
|
+
let ptr0 = 0;
|
|
3513
|
+
if (!isLikeNone(value)) {
|
|
3514
|
+
_assertClass(value, WasmImageDimensions);
|
|
3515
|
+
ptr0 = value.__destroy_into_raw();
|
|
3516
|
+
}
|
|
3517
|
+
wasm.wasmimagemetadata_set_dimensions(this.__wbg_ptr, ptr0);
|
|
3476
3518
|
}
|
|
3477
3519
|
/**
|
|
3478
3520
|
* @param {WasmImageType} value
|
|
@@ -3799,6 +3841,115 @@ const WasmListIndentType = Object.freeze({
|
|
|
3799
3841
|
});
|
|
3800
3842
|
exports.WasmListIndentType = WasmListIndentType;
|
|
3801
3843
|
|
|
3844
|
+
/**
|
|
3845
|
+
* A single key-value metadata entry from `<head>` meta tags.
|
|
3846
|
+
*
|
|
3847
|
+
* Binding-safe replacement for `(String, String)` tuples used in
|
|
3848
|
+
* `NodeContent.MetadataBlock`. Tuple pairs cannot be represented
|
|
3849
|
+
* across language boundaries without lossy degradation.
|
|
3850
|
+
*/
|
|
3851
|
+
class WasmMetadataEntry {
|
|
3852
|
+
static __wrap(ptr) {
|
|
3853
|
+
const obj = Object.create(WasmMetadataEntry.prototype);
|
|
3854
|
+
obj.__wbg_ptr = ptr;
|
|
3855
|
+
WasmMetadataEntryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3856
|
+
return obj;
|
|
3857
|
+
}
|
|
3858
|
+
static __unwrap(jsValue) {
|
|
3859
|
+
if (!(jsValue instanceof WasmMetadataEntry)) {
|
|
3860
|
+
return 0;
|
|
3861
|
+
}
|
|
3862
|
+
return jsValue.__destroy_into_raw();
|
|
3863
|
+
}
|
|
3864
|
+
__destroy_into_raw() {
|
|
3865
|
+
const ptr = this.__wbg_ptr;
|
|
3866
|
+
this.__wbg_ptr = 0;
|
|
3867
|
+
WasmMetadataEntryFinalization.unregister(this);
|
|
3868
|
+
return ptr;
|
|
3869
|
+
}
|
|
3870
|
+
free() {
|
|
3871
|
+
const ptr = this.__destroy_into_raw();
|
|
3872
|
+
wasm.__wbg_wasmmetadataentry_free(ptr, 0);
|
|
3873
|
+
}
|
|
3874
|
+
/**
|
|
3875
|
+
* @returns {WasmMetadataEntry}
|
|
3876
|
+
*/
|
|
3877
|
+
static default() {
|
|
3878
|
+
const ret = wasm.wasmmetadataentry_default();
|
|
3879
|
+
return WasmMetadataEntry.__wrap(ret);
|
|
3880
|
+
}
|
|
3881
|
+
/**
|
|
3882
|
+
* @returns {string}
|
|
3883
|
+
*/
|
|
3884
|
+
get key() {
|
|
3885
|
+
let deferred1_0;
|
|
3886
|
+
let deferred1_1;
|
|
3887
|
+
try {
|
|
3888
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3889
|
+
wasm.wasmmetadataentry_key(retptr, this.__wbg_ptr);
|
|
3890
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3891
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3892
|
+
deferred1_0 = r0;
|
|
3893
|
+
deferred1_1 = r1;
|
|
3894
|
+
return getStringFromWasm0(r0, r1);
|
|
3895
|
+
} finally {
|
|
3896
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3897
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
/**
|
|
3901
|
+
* @param {string} key
|
|
3902
|
+
* @param {string} value
|
|
3903
|
+
*/
|
|
3904
|
+
constructor(key, value) {
|
|
3905
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3906
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3907
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3908
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3909
|
+
const ret = wasm.wasmmetadataentry_new(ptr0, len0, ptr1, len1);
|
|
3910
|
+
this.__wbg_ptr = ret;
|
|
3911
|
+
WasmMetadataEntryFinalization.register(this, this.__wbg_ptr, this);
|
|
3912
|
+
return this;
|
|
3913
|
+
}
|
|
3914
|
+
/**
|
|
3915
|
+
* @param {string} value
|
|
3916
|
+
*/
|
|
3917
|
+
set key(value) {
|
|
3918
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3919
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3920
|
+
wasm.wasmmetadataentry_set_key(this.__wbg_ptr, ptr0, len0);
|
|
3921
|
+
}
|
|
3922
|
+
/**
|
|
3923
|
+
* @param {string} value
|
|
3924
|
+
*/
|
|
3925
|
+
set value(value) {
|
|
3926
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3927
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3928
|
+
wasm.wasmmetadataentry_set_value(this.__wbg_ptr, ptr0, len0);
|
|
3929
|
+
}
|
|
3930
|
+
/**
|
|
3931
|
+
* @returns {string}
|
|
3932
|
+
*/
|
|
3933
|
+
get value() {
|
|
3934
|
+
let deferred1_0;
|
|
3935
|
+
let deferred1_1;
|
|
3936
|
+
try {
|
|
3937
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3938
|
+
wasm.wasmmetadataentry_value(retptr, this.__wbg_ptr);
|
|
3939
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3940
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3941
|
+
deferred1_0 = r0;
|
|
3942
|
+
deferred1_1 = r1;
|
|
3943
|
+
return getStringFromWasm0(r0, r1);
|
|
3944
|
+
} finally {
|
|
3945
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3946
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
if (Symbol.dispose) WasmMetadataEntry.prototype[Symbol.dispose] = WasmMetadataEntry.prototype.free;
|
|
3951
|
+
exports.WasmMetadataEntry = WasmMetadataEntry;
|
|
3952
|
+
|
|
3802
3953
|
/**
|
|
3803
3954
|
* Line break syntax in Markdown output.
|
|
3804
3955
|
*
|
|
@@ -3898,11 +4049,23 @@ class WasmNodeContent {
|
|
|
3898
4049
|
}
|
|
3899
4050
|
}
|
|
3900
4051
|
/**
|
|
3901
|
-
* @returns {
|
|
4052
|
+
* @returns {WasmMetadataEntry[] | undefined}
|
|
3902
4053
|
*/
|
|
3903
4054
|
get entries() {
|
|
3904
|
-
|
|
3905
|
-
|
|
4055
|
+
try {
|
|
4056
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4057
|
+
wasm.wasmnodecontent_entries(retptr, this.__wbg_ptr);
|
|
4058
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4059
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4060
|
+
let v1;
|
|
4061
|
+
if (r0 !== 0) {
|
|
4062
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
4063
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
4064
|
+
}
|
|
4065
|
+
return v1;
|
|
4066
|
+
} finally {
|
|
4067
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4068
|
+
}
|
|
3906
4069
|
}
|
|
3907
4070
|
/**
|
|
3908
4071
|
* @returns {string | undefined}
|
|
@@ -4065,10 +4228,12 @@ class WasmNodeContent {
|
|
|
4065
4228
|
wasm.wasmnodecontent_set_description(this.__wbg_ptr, ptr0, len0);
|
|
4066
4229
|
}
|
|
4067
4230
|
/**
|
|
4068
|
-
* @param {
|
|
4231
|
+
* @param {WasmMetadataEntry[] | null} [value]
|
|
4069
4232
|
*/
|
|
4070
4233
|
set entries(value) {
|
|
4071
|
-
|
|
4234
|
+
var ptr0 = isLikeNone(value) ? 0 : passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
4235
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4236
|
+
wasm.wasmnodecontent_set_entries(this.__wbg_ptr, ptr0, len0);
|
|
4072
4237
|
}
|
|
4073
4238
|
/**
|
|
4074
4239
|
* @param {string | null} [value]
|
|
@@ -4234,7 +4399,21 @@ exports.WasmNodeContent = WasmNodeContent;
|
|
|
4234
4399
|
* Context information passed to all visitor methods.
|
|
4235
4400
|
*
|
|
4236
4401
|
* Provides comprehensive metadata about the current node being visited,
|
|
4237
|
-
* including its type,
|
|
4402
|
+
* including its type, tag name, position in the DOM tree, and parent context.
|
|
4403
|
+
*
|
|
4404
|
+
* ## Attributes
|
|
4405
|
+
*
|
|
4406
|
+
* Access attributes via `NodeContext.attributes`, which returns
|
|
4407
|
+
* `&BTreeMap<String, String>`. When the context was built with
|
|
4408
|
+
* `NodeContext.with_lazy_attributes` (the hot path inside the converter),
|
|
4409
|
+
* the map is only materialized on the first call — if the visitor never reads
|
|
4410
|
+
* attributes, the allocation is skipped.
|
|
4411
|
+
*
|
|
4412
|
+
* ## Lifetimes
|
|
4413
|
+
*
|
|
4414
|
+
* String fields use `Cow<'_, str>` so the converter can pass slices directly
|
|
4415
|
+
* out of the parsed DOM without allocating. Visitor implementations that need
|
|
4416
|
+
* to outlive the callback should call `NodeContext.into_owned`.
|
|
4238
4417
|
*/
|
|
4239
4418
|
class WasmNodeContext {
|
|
4240
4419
|
static __wrap(ptr) {
|
|
@@ -4254,9 +4433,14 @@ class WasmNodeContext {
|
|
|
4254
4433
|
wasm.__wbg_wasmnodecontext_free(ptr, 0);
|
|
4255
4434
|
}
|
|
4256
4435
|
/**
|
|
4436
|
+
* Return a reference to the attribute map.
|
|
4437
|
+
*
|
|
4438
|
+
* If the context was built with `NodeContext.with_lazy_attributes`, the
|
|
4439
|
+
* map is materialized on the first call and cached for subsequent calls.
|
|
4440
|
+
* If this method is never called, no allocation occurs for attributes.
|
|
4257
4441
|
* @returns {any}
|
|
4258
4442
|
*/
|
|
4259
|
-
|
|
4443
|
+
attributes() {
|
|
4260
4444
|
const ret = wasm.wasmnodecontext_attributes(this.__wbg_ptr);
|
|
4261
4445
|
return takeObject(ret);
|
|
4262
4446
|
}
|
|
@@ -4281,6 +4465,14 @@ class WasmNodeContext {
|
|
|
4281
4465
|
const ret = wasm.wasmnodecontext_indexInParent(this.__wbg_ptr);
|
|
4282
4466
|
return ret >>> 0;
|
|
4283
4467
|
}
|
|
4468
|
+
/**
|
|
4469
|
+
* Promote any borrowed fields into owned storage so the context can outlive `'a`.
|
|
4470
|
+
* @returns {WasmNodeContext}
|
|
4471
|
+
*/
|
|
4472
|
+
intoOwned() {
|
|
4473
|
+
const ret = wasm.wasmnodecontext_intoOwned(this.__wbg_ptr);
|
|
4474
|
+
return WasmNodeContext.__wrap(ret);
|
|
4475
|
+
}
|
|
4284
4476
|
/**
|
|
4285
4477
|
* @returns {boolean}
|
|
4286
4478
|
*/
|
|
@@ -4291,18 +4483,17 @@ class WasmNodeContext {
|
|
|
4291
4483
|
/**
|
|
4292
4484
|
* @param {WasmNodeType} nodeType
|
|
4293
4485
|
* @param {string} tagName
|
|
4294
|
-
* @param {any} attributes
|
|
4295
4486
|
* @param {number} depth
|
|
4296
4487
|
* @param {number} indexInParent
|
|
4297
4488
|
* @param {boolean} isInline
|
|
4298
4489
|
* @param {string | null} [parentTag]
|
|
4299
4490
|
*/
|
|
4300
|
-
constructor(nodeType, tagName,
|
|
4491
|
+
constructor(nodeType, tagName, depth, indexInParent, isInline, parentTag) {
|
|
4301
4492
|
const ptr0 = passStringToWasm0(tagName, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4302
4493
|
const len0 = WASM_VECTOR_LEN;
|
|
4303
4494
|
var ptr1 = isLikeNone(parentTag) ? 0 : passStringToWasm0(parentTag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4304
4495
|
var len1 = WASM_VECTOR_LEN;
|
|
4305
|
-
const ret = wasm.wasmnodecontext_new(nodeType, ptr0, len0,
|
|
4496
|
+
const ret = wasm.wasmnodecontext_new(nodeType, ptr0, len0, depth, indexInParent, isInline, ptr1, len1);
|
|
4306
4497
|
this.__wbg_ptr = ret;
|
|
4307
4498
|
WasmNodeContextFinalization.register(this, this.__wbg_ptr, this);
|
|
4308
4499
|
return this;
|
|
@@ -4345,12 +4536,6 @@ class WasmNodeContext {
|
|
|
4345
4536
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4346
4537
|
}
|
|
4347
4538
|
}
|
|
4348
|
-
/**
|
|
4349
|
-
* @param {any} value
|
|
4350
|
-
*/
|
|
4351
|
-
set attributes(value) {
|
|
4352
|
-
wasm.wasmnodecontext_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
4353
|
-
}
|
|
4354
4539
|
/**
|
|
4355
4540
|
* @param {number} value
|
|
4356
4541
|
*/
|
|
@@ -4410,6 +4595,28 @@ class WasmNodeContext {
|
|
|
4410
4595
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
4411
4596
|
}
|
|
4412
4597
|
}
|
|
4598
|
+
/**
|
|
4599
|
+
* Construct a `NodeContext` with an owned attribute map.
|
|
4600
|
+
*
|
|
4601
|
+
* Prefer `NodeContext.with_lazy_attributes` (pub(crate)) inside the
|
|
4602
|
+
* converter to avoid the eager `collect_tag_attributes` allocation.
|
|
4603
|
+
* @param {WasmNodeType} node_type
|
|
4604
|
+
* @param {string} tag_name
|
|
4605
|
+
* @param {any} attributes
|
|
4606
|
+
* @param {number} depth
|
|
4607
|
+
* @param {number} index_in_parent
|
|
4608
|
+
* @param {string | null | undefined} parent_tag
|
|
4609
|
+
* @param {boolean} is_inline
|
|
4610
|
+
* @returns {WasmNodeContext}
|
|
4611
|
+
*/
|
|
4612
|
+
static withOwnedAttributes(node_type, tag_name, attributes, depth, index_in_parent, parent_tag, is_inline) {
|
|
4613
|
+
const ptr0 = passStringToWasm0(tag_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4614
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4615
|
+
var ptr1 = isLikeNone(parent_tag) ? 0 : passStringToWasm0(parent_tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4616
|
+
var len1 = WASM_VECTOR_LEN;
|
|
4617
|
+
const ret = wasm.wasmnodecontext_withOwnedAttributes(node_type, ptr0, len0, addHeapObject(attributes), depth, index_in_parent, ptr1, len1, is_inline);
|
|
4618
|
+
return WasmNodeContext.__wrap(ret);
|
|
4619
|
+
}
|
|
4413
4620
|
}
|
|
4414
4621
|
if (Symbol.dispose) WasmNodeContext.prototype[Symbol.dispose] = WasmNodeContext.prototype.free;
|
|
4415
4622
|
exports.WasmNodeContext = WasmNodeContext;
|
|
@@ -4873,7 +5080,7 @@ if (Symbol.dispose) WasmProcessingWarning.prototype[Symbol.dispose] = WasmProces
|
|
|
4873
5080
|
exports.WasmProcessingWarning = WasmProcessingWarning;
|
|
4874
5081
|
|
|
4875
5082
|
/**
|
|
4876
|
-
* Structured data block (JSON-LD, Microdata, or RDFa).
|
|
5083
|
+
* Structured data block (JSON-LD, Microdata, or `RDFa`).
|
|
4877
5084
|
*
|
|
4878
5085
|
* Represents machine-readable structured data found in the document.
|
|
4879
5086
|
* JSON-LD blocks are collected as raw JSON strings for flexibility.
|
|
@@ -5484,20 +5691,46 @@ exports.convert = convert;
|
|
|
5484
5691
|
function __wbg_get_imports() {
|
|
5485
5692
|
const import0 = {
|
|
5486
5693
|
__proto__: null,
|
|
5487
|
-
|
|
5694
|
+
__wbg_Error_9dc85fe1bc224456: function(arg0, arg1) {
|
|
5695
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
5696
|
+
return addHeapObject(ret);
|
|
5697
|
+
},
|
|
5698
|
+
__wbg___wbindgen_boolean_get_b131b2f36d6b2f55: function(arg0) {
|
|
5699
|
+
const v = getObject(arg0);
|
|
5700
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
5701
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
5702
|
+
},
|
|
5703
|
+
__wbg___wbindgen_debug_string_56c147eb1a51f0c4: function(arg0, arg1) {
|
|
5704
|
+
const ret = debugString(getObject(arg1));
|
|
5705
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
5706
|
+
const len1 = WASM_VECTOR_LEN;
|
|
5707
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5708
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5709
|
+
},
|
|
5710
|
+
__wbg___wbindgen_is_function_147961669f068cd4: function(arg0) {
|
|
5488
5711
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
5489
5712
|
return ret;
|
|
5490
5713
|
},
|
|
5491
|
-
|
|
5714
|
+
__wbg___wbindgen_is_object_3a2c414391dbf751: function(arg0) {
|
|
5492
5715
|
const val = getObject(arg0);
|
|
5493
5716
|
const ret = typeof(val) === 'object' && val !== null;
|
|
5494
5717
|
return ret;
|
|
5495
5718
|
},
|
|
5496
|
-
|
|
5719
|
+
__wbg___wbindgen_is_undefined_4410e3c20a99fa97: function(arg0) {
|
|
5497
5720
|
const ret = getObject(arg0) === undefined;
|
|
5498
5721
|
return ret;
|
|
5499
5722
|
},
|
|
5500
|
-
|
|
5723
|
+
__wbg___wbindgen_jsval_loose_eq_e07e3b1f5db6da6c: function(arg0, arg1) {
|
|
5724
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
5725
|
+
return ret;
|
|
5726
|
+
},
|
|
5727
|
+
__wbg___wbindgen_number_get_588ed6b97f0d7e14: function(arg0, arg1) {
|
|
5728
|
+
const obj = getObject(arg1);
|
|
5729
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
5730
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
5731
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
5732
|
+
},
|
|
5733
|
+
__wbg___wbindgen_string_get_fa2687d531ed17a5: function(arg0, arg1) {
|
|
5501
5734
|
const obj = getObject(arg1);
|
|
5502
5735
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
5503
5736
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -5505,47 +5738,126 @@ function __wbg_get_imports() {
|
|
|
5505
5738
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5506
5739
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5507
5740
|
},
|
|
5508
|
-
|
|
5741
|
+
__wbg___wbindgen_throw_bbadd78c1bac3a77: function(arg0, arg1) {
|
|
5509
5742
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5510
5743
|
},
|
|
5511
|
-
|
|
5744
|
+
__wbg_apply_5d99f956e2dda74d: function() { return handleError(function (arg0, arg1, arg2) {
|
|
5512
5745
|
const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
|
|
5513
5746
|
return addHeapObject(ret);
|
|
5514
5747
|
}, arguments); },
|
|
5515
|
-
|
|
5748
|
+
__wbg_call_91f00ddc43e01490: function() { return handleError(function (arg0, arg1) {
|
|
5749
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
5750
|
+
return addHeapObject(ret);
|
|
5751
|
+
}, arguments); },
|
|
5752
|
+
__wbg_done_6a8439e544ec6206: function(arg0) {
|
|
5753
|
+
const ret = getObject(arg0).done;
|
|
5754
|
+
return ret;
|
|
5755
|
+
},
|
|
5756
|
+
__wbg_entries_5a6a7e7e0df09fe5: function(arg0) {
|
|
5757
|
+
const ret = Object.entries(getObject(arg0));
|
|
5758
|
+
return addHeapObject(ret);
|
|
5759
|
+
},
|
|
5760
|
+
__wbg_get_44e98e27bda25b5b: function() { return handleError(function (arg0, arg1) {
|
|
5516
5761
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
5517
5762
|
return addHeapObject(ret);
|
|
5518
5763
|
}, arguments); },
|
|
5519
|
-
|
|
5764
|
+
__wbg_get_4b90d6d8c5deb5d5: function(arg0, arg1) {
|
|
5765
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
5766
|
+
return addHeapObject(ret);
|
|
5767
|
+
},
|
|
5768
|
+
__wbg_get_52a8a619f7b88df6: function() { return handleError(function (arg0, arg1) {
|
|
5769
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
5770
|
+
return addHeapObject(ret);
|
|
5771
|
+
}, arguments); },
|
|
5772
|
+
__wbg_get_unchecked_46e778e3cec74b5e: function(arg0, arg1) {
|
|
5773
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
5774
|
+
return addHeapObject(ret);
|
|
5775
|
+
},
|
|
5776
|
+
__wbg_has_14676d88c1340d2c: function() { return handleError(function (arg0, arg1) {
|
|
5520
5777
|
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
5521
5778
|
return ret;
|
|
5522
5779
|
}, arguments); },
|
|
5523
|
-
|
|
5524
|
-
|
|
5780
|
+
__wbg_instanceof_ArrayBuffer_a581da923203f29f: function(arg0) {
|
|
5781
|
+
let result;
|
|
5782
|
+
try {
|
|
5783
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
5784
|
+
} catch (_) {
|
|
5785
|
+
result = false;
|
|
5786
|
+
}
|
|
5787
|
+
const ret = result;
|
|
5788
|
+
return ret;
|
|
5789
|
+
},
|
|
5790
|
+
__wbg_instanceof_Uint8Array_b6fe1ac89eba107e: function(arg0) {
|
|
5791
|
+
let result;
|
|
5792
|
+
try {
|
|
5793
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
5794
|
+
} catch (_) {
|
|
5795
|
+
result = false;
|
|
5796
|
+
}
|
|
5797
|
+
const ret = result;
|
|
5798
|
+
return ret;
|
|
5799
|
+
},
|
|
5800
|
+
__wbg_iterator_9b36cebf3be7b7cd: function() {
|
|
5801
|
+
const ret = Symbol.iterator;
|
|
5525
5802
|
return addHeapObject(ret);
|
|
5526
5803
|
},
|
|
5527
|
-
|
|
5804
|
+
__wbg_length_68a9d5278d084f4f: function(arg0) {
|
|
5805
|
+
const ret = getObject(arg0).length;
|
|
5806
|
+
return ret;
|
|
5807
|
+
},
|
|
5808
|
+
__wbg_length_fb04d16d7bdf6d4c: function(arg0) {
|
|
5809
|
+
const ret = getObject(arg0).length;
|
|
5810
|
+
return ret;
|
|
5811
|
+
},
|
|
5812
|
+
__wbg_new_0b303268aa395a38: function() {
|
|
5528
5813
|
const ret = new Array();
|
|
5529
5814
|
return addHeapObject(ret);
|
|
5530
5815
|
},
|
|
5531
|
-
|
|
5816
|
+
__wbg_new_20b778a4c5c691c3: function() {
|
|
5817
|
+
const ret = new Object();
|
|
5818
|
+
return addHeapObject(ret);
|
|
5819
|
+
},
|
|
5820
|
+
__wbg_new_883c0db065f06efd: function() {
|
|
5821
|
+
const ret = new Map();
|
|
5822
|
+
return addHeapObject(ret);
|
|
5823
|
+
},
|
|
5824
|
+
__wbg_new_b06772b280cc6e52: function(arg0) {
|
|
5825
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
5826
|
+
return addHeapObject(ret);
|
|
5827
|
+
},
|
|
5828
|
+
__wbg_next_8cb028b6ba50743f: function() { return handleError(function (arg0) {
|
|
5829
|
+
const ret = getObject(arg0).next();
|
|
5830
|
+
return addHeapObject(ret);
|
|
5831
|
+
}, arguments); },
|
|
5832
|
+
__wbg_next_cfd0b146c9538df8: function(arg0) {
|
|
5833
|
+
const ret = getObject(arg0).next;
|
|
5834
|
+
return addHeapObject(ret);
|
|
5835
|
+
},
|
|
5836
|
+
__wbg_parse_246201845d0eb98c: function() { return handleError(function (arg0, arg1) {
|
|
5532
5837
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
5533
5838
|
return addHeapObject(ret);
|
|
5534
5839
|
}, arguments); },
|
|
5535
|
-
|
|
5840
|
+
__wbg_prototypesetcall_956c7493c68e29b4: function(arg0, arg1, arg2) {
|
|
5841
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
5842
|
+
},
|
|
5843
|
+
__wbg_push_ceb8ef046afb2041: function(arg0, arg1) {
|
|
5536
5844
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
5537
5845
|
return ret;
|
|
5538
5846
|
},
|
|
5539
5847
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
5540
5848
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
5541
5849
|
},
|
|
5542
|
-
|
|
5850
|
+
__wbg_set_a6ba3ac0e634b822: function() { return handleError(function (arg0, arg1, arg2) {
|
|
5543
5851
|
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
5544
5852
|
return ret;
|
|
5545
5853
|
}, arguments); },
|
|
5546
|
-
|
|
5854
|
+
__wbg_set_da33c120a6584674: function(arg0, arg1, arg2) {
|
|
5547
5855
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
5548
5856
|
},
|
|
5857
|
+
__wbg_value_3d3defe09fb1ffca: function(arg0) {
|
|
5858
|
+
const ret = getObject(arg0).value;
|
|
5859
|
+
return addHeapObject(ret);
|
|
5860
|
+
},
|
|
5549
5861
|
__wbg_wasmdocumentnode_new: function(arg0) {
|
|
5550
5862
|
const ret = WasmDocumentNode.__wrap(arg0);
|
|
5551
5863
|
return addHeapObject(ret);
|
|
@@ -5586,6 +5898,14 @@ function __wbg_get_imports() {
|
|
|
5586
5898
|
const ret = WasmLinkMetadata.__unwrap(getObject(arg0));
|
|
5587
5899
|
return ret;
|
|
5588
5900
|
},
|
|
5901
|
+
__wbg_wasmmetadataentry_new: function(arg0) {
|
|
5902
|
+
const ret = WasmMetadataEntry.__wrap(arg0);
|
|
5903
|
+
return addHeapObject(ret);
|
|
5904
|
+
},
|
|
5905
|
+
__wbg_wasmmetadataentry_unwrap: function(arg0) {
|
|
5906
|
+
const ret = WasmMetadataEntry.__unwrap(getObject(arg0));
|
|
5907
|
+
return ret;
|
|
5908
|
+
},
|
|
5589
5909
|
__wbg_wasmprocessingwarning_new: function(arg0) {
|
|
5590
5910
|
const ret = WasmProcessingWarning.__wrap(arg0);
|
|
5591
5911
|
return addHeapObject(ret);
|
|
@@ -5672,12 +5992,18 @@ const WasmHeaderMetadataFinalization = (typeof FinalizationRegistry === 'undefin
|
|
|
5672
5992
|
const WasmHtmlMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5673
5993
|
? { register: () => {}, unregister: () => {} }
|
|
5674
5994
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlmetadata_free(ptr, 1));
|
|
5995
|
+
const WasmImageDimensionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5996
|
+
? { register: () => {}, unregister: () => {} }
|
|
5997
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmimagedimensions_free(ptr, 1));
|
|
5675
5998
|
const WasmImageMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5676
5999
|
? { register: () => {}, unregister: () => {} }
|
|
5677
6000
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmimagemetadata_free(ptr, 1));
|
|
5678
6001
|
const WasmLinkMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5679
6002
|
? { register: () => {}, unregister: () => {} }
|
|
5680
6003
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmlinkmetadata_free(ptr, 1));
|
|
6004
|
+
const WasmMetadataEntryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6005
|
+
? { register: () => {}, unregister: () => {} }
|
|
6006
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataentry_free(ptr, 1));
|
|
5681
6007
|
const WasmNodeContentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5682
6008
|
? { register: () => {}, unregister: () => {} }
|
|
5683
6009
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnodecontent_free(ptr, 1));
|
|
@@ -5724,6 +6050,71 @@ function _assertClass(instance, klass) {
|
|
|
5724
6050
|
}
|
|
5725
6051
|
}
|
|
5726
6052
|
|
|
6053
|
+
function debugString(val) {
|
|
6054
|
+
// primitive types
|
|
6055
|
+
const type = typeof val;
|
|
6056
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
6057
|
+
return `${val}`;
|
|
6058
|
+
}
|
|
6059
|
+
if (type == 'string') {
|
|
6060
|
+
return `"${val}"`;
|
|
6061
|
+
}
|
|
6062
|
+
if (type == 'symbol') {
|
|
6063
|
+
const description = val.description;
|
|
6064
|
+
if (description == null) {
|
|
6065
|
+
return 'Symbol';
|
|
6066
|
+
} else {
|
|
6067
|
+
return `Symbol(${description})`;
|
|
6068
|
+
}
|
|
6069
|
+
}
|
|
6070
|
+
if (type == 'function') {
|
|
6071
|
+
const name = val.name;
|
|
6072
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
6073
|
+
return `Function(${name})`;
|
|
6074
|
+
} else {
|
|
6075
|
+
return 'Function';
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
// objects
|
|
6079
|
+
if (Array.isArray(val)) {
|
|
6080
|
+
const length = val.length;
|
|
6081
|
+
let debug = '[';
|
|
6082
|
+
if (length > 0) {
|
|
6083
|
+
debug += debugString(val[0]);
|
|
6084
|
+
}
|
|
6085
|
+
for(let i = 1; i < length; i++) {
|
|
6086
|
+
debug += ', ' + debugString(val[i]);
|
|
6087
|
+
}
|
|
6088
|
+
debug += ']';
|
|
6089
|
+
return debug;
|
|
6090
|
+
}
|
|
6091
|
+
// Test for built-in
|
|
6092
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
6093
|
+
let className;
|
|
6094
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
6095
|
+
className = builtInMatches[1];
|
|
6096
|
+
} else {
|
|
6097
|
+
// Failed to match the standard '[object ClassName]'
|
|
6098
|
+
return toString.call(val);
|
|
6099
|
+
}
|
|
6100
|
+
if (className == 'Object') {
|
|
6101
|
+
// we're a user defined class or Object
|
|
6102
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
6103
|
+
// easier than looping through ownProperties of `val`.
|
|
6104
|
+
try {
|
|
6105
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
6106
|
+
} catch (_) {
|
|
6107
|
+
return 'Object';
|
|
6108
|
+
}
|
|
6109
|
+
}
|
|
6110
|
+
// errors
|
|
6111
|
+
if (val instanceof Error) {
|
|
6112
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
6113
|
+
}
|
|
6114
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
6115
|
+
return className;
|
|
6116
|
+
}
|
|
6117
|
+
|
|
5727
6118
|
function dropObject(idx) {
|
|
5728
6119
|
if (idx < 1028) return;
|
|
5729
6120
|
heap[idx] = heap_next;
|
|
@@ -5745,6 +6136,11 @@ function getArrayU32FromWasm0(ptr, len) {
|
|
|
5745
6136
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
5746
6137
|
}
|
|
5747
6138
|
|
|
6139
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
6140
|
+
ptr = ptr >>> 0;
|
|
6141
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
6142
|
+
}
|
|
6143
|
+
|
|
5748
6144
|
let cachedDataViewMemory0 = null;
|
|
5749
6145
|
function getDataViewMemory0() {
|
|
5750
6146
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|