@gmb/bitmark-parser 6.10.0 → 6.11.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/README.md +194 -20
- package/dist/browser/bitmark-parser.min.js +4 -4
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/cjs/index.cjs +726 -180
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +1031 -29
- package/dist/browser/esm/index.d.ts +1031 -29
- package/dist/browser/esm/index.js +723 -180
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js +599 -96
- package/dist/browser/esm/worker-entry.js.map +1 -1
- package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
- package/dist/index.cjs +52 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1031 -29
- package/dist/index.d.ts +1031 -29
- package/dist/index.js +49 -9
- package/dist/index.js.map +1 -1
- package/dist/legacy.cjs +4 -4
- package/dist/legacy.cjs.map +1 -1
- package/dist/legacy.js +4 -4
- package/dist/legacy.js.map +1 -1
- package/dist/worker-entry.cjs +7 -1
- package/dist/worker-entry.cjs.map +1 -1
- package/package.json +14 -8
- package/schema/bitmark.schema.json +2746 -573
- package/translations/translations.json +2940 -0
- package/wasm/bitmark_wasm.d.ts +30 -12
- package/wasm/bitmark_wasm.js +91 -47
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +2 -1
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm.d.ts +30 -12
- package/wasm-bitmark-json/bitmark_json_wasm.js +97 -53
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +2 -1
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +126 -0
- package/wasm-browser-full/bitmark_browser_full_wasm.js +567 -0
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +21 -0
- package/wasm-browser-full/package.json +20 -0
- package/dist/browser/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/esm/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/esm/bitmark_wasm_bg.wasm +0 -0
|
@@ -22,22 +22,25 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
22
22
|
// src/browser/index.ts
|
|
23
23
|
var index_exports = {};
|
|
24
24
|
__export(index_exports, {
|
|
25
|
+
ALL_LANGUAGES: () => ALL_LANGUAGES,
|
|
25
26
|
NotInitializedError: () => NotInitializedError,
|
|
27
|
+
RegisterError: () => RegisterError,
|
|
26
28
|
UnsupportedFeatureError: () => UnsupportedFeatureError,
|
|
27
29
|
bitmarkToObjects: () => bitmarkToObjects,
|
|
28
30
|
breakscapeText: () => breakscapeText,
|
|
29
|
-
canonicalize: () =>
|
|
30
|
-
convert: () =>
|
|
31
|
+
canonicalize: () => canonicalize4,
|
|
32
|
+
convert: () => convert4,
|
|
31
33
|
countBits: () => countBits,
|
|
32
|
-
info: () =>
|
|
34
|
+
info: () => info4,
|
|
33
35
|
init: () => init,
|
|
34
|
-
initSync: () =>
|
|
36
|
+
initSync: () => initSync4,
|
|
35
37
|
legacy: () => legacy_exports,
|
|
36
|
-
lex: () =>
|
|
38
|
+
lex: () => lex3,
|
|
37
39
|
objectsToBitmark: () => objectsToBitmark,
|
|
38
40
|
patchEntry: () => patchEntry,
|
|
41
|
+
register: () => register4,
|
|
39
42
|
splitBits: () => splitBits,
|
|
40
|
-
transform: () =>
|
|
43
|
+
transform: () => transform4,
|
|
41
44
|
transformParallel: () => transformParallel,
|
|
42
45
|
unbreakscapeText: () => unbreakscapeText,
|
|
43
46
|
variant: () => variant,
|
|
@@ -63,6 +66,7 @@ __export(bitmark_wasm_exports, {
|
|
|
63
66
|
is_bitmark: () => is_bitmark,
|
|
64
67
|
lex: () => lex,
|
|
65
68
|
prettify: () => prettify,
|
|
69
|
+
register: () => register,
|
|
66
70
|
split_bits: () => split_bits,
|
|
67
71
|
split_json_bits: () => split_json_bits,
|
|
68
72
|
transform: () => transform,
|
|
@@ -201,9 +205,9 @@ function unbreakscape_text(input, format, location) {
|
|
|
201
205
|
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
|
-
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
|
|
205
|
-
let
|
|
206
|
-
let
|
|
208
|
+
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
209
|
+
let deferred5_0;
|
|
210
|
+
let deferred5_1;
|
|
207
211
|
try {
|
|
208
212
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
209
213
|
const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -212,15 +216,41 @@ function info(info_type, format, bit, pretty, indent, include_deprecated, only_d
|
|
|
212
216
|
const len1 = WASM_VECTOR_LEN;
|
|
213
217
|
const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
214
218
|
const len2 = WASM_VECTOR_LEN;
|
|
215
|
-
|
|
219
|
+
const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
220
|
+
const len3 = WASM_VECTOR_LEN;
|
|
221
|
+
wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
216
222
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
217
223
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
deferred5_0 = r0;
|
|
225
|
+
deferred5_1 = r1;
|
|
220
226
|
return getStringFromWasm0(r0, r1);
|
|
221
227
|
} finally {
|
|
222
228
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
223
|
-
wasm.__wbindgen_export_2(
|
|
229
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function convert_text(input, direction, format, location) {
|
|
233
|
+
let deferred5_0;
|
|
234
|
+
let deferred5_1;
|
|
235
|
+
try {
|
|
236
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
237
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
238
|
+
const len0 = WASM_VECTOR_LEN;
|
|
239
|
+
const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
240
|
+
const len1 = WASM_VECTOR_LEN;
|
|
241
|
+
const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
242
|
+
const len2 = WASM_VECTOR_LEN;
|
|
243
|
+
const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
244
|
+
const len3 = WASM_VECTOR_LEN;
|
|
245
|
+
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
246
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
247
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
248
|
+
deferred5_0 = r0;
|
|
249
|
+
deferred5_1 = r1;
|
|
250
|
+
return getStringFromWasm0(r0, r1);
|
|
251
|
+
} finally {
|
|
252
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
253
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
224
254
|
}
|
|
225
255
|
}
|
|
226
256
|
function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
@@ -249,6 +279,26 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
|
|
|
249
279
|
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
250
280
|
}
|
|
251
281
|
}
|
|
282
|
+
function register(data_type, data) {
|
|
283
|
+
let deferred3_0;
|
|
284
|
+
let deferred3_1;
|
|
285
|
+
try {
|
|
286
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
+
const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
289
|
+
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
290
|
+
const len1 = WASM_VECTOR_LEN;
|
|
291
|
+
wasm.register(retptr, ptr0, len0, ptr1, len1);
|
|
292
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
293
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
294
|
+
deferred3_0 = r0;
|
|
295
|
+
deferred3_1 = r1;
|
|
296
|
+
return getStringFromWasm0(r0, r1);
|
|
297
|
+
} finally {
|
|
298
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
299
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
252
302
|
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
253
303
|
let deferred5_0;
|
|
254
304
|
let deferred5_1;
|
|
@@ -373,30 +423,6 @@ function prettify(json, indent) {
|
|
|
373
423
|
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
374
424
|
}
|
|
375
425
|
}
|
|
376
|
-
function convert_text(input, direction, format, location) {
|
|
377
|
-
let deferred5_0;
|
|
378
|
-
let deferred5_1;
|
|
379
|
-
try {
|
|
380
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
381
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
382
|
-
const len0 = WASM_VECTOR_LEN;
|
|
383
|
-
const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
384
|
-
const len1 = WASM_VECTOR_LEN;
|
|
385
|
-
const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
386
|
-
const len2 = WASM_VECTOR_LEN;
|
|
387
|
-
const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
388
|
-
const len3 = WASM_VECTOR_LEN;
|
|
389
|
-
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
390
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
391
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
392
|
-
deferred5_0 = r0;
|
|
393
|
-
deferred5_1 = r1;
|
|
394
|
-
return getStringFromWasm0(r0, r1);
|
|
395
|
-
} finally {
|
|
396
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
397
|
-
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
426
|
async function __wbg_load(module2, imports) {
|
|
401
427
|
if (typeof Response === "function" && module2 instanceof Response) {
|
|
402
428
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
@@ -474,19 +500,21 @@ async function __wbg_init(module_or_path) {
|
|
|
474
500
|
}
|
|
475
501
|
var bitmark_wasm_default = __wbg_init;
|
|
476
502
|
|
|
477
|
-
// wasm-web-
|
|
478
|
-
var
|
|
479
|
-
__export(
|
|
503
|
+
// wasm-web-browser-full/bitmark_browser_full_wasm.js
|
|
504
|
+
var bitmark_browser_full_wasm_exports = {};
|
|
505
|
+
__export(bitmark_browser_full_wasm_exports, {
|
|
480
506
|
breakscape_text: () => breakscape_text2,
|
|
481
507
|
canonicalize: () => canonicalize2,
|
|
482
508
|
convert: () => convert2,
|
|
483
509
|
convert_text: () => convert_text2,
|
|
484
510
|
count_bits: () => count_bits2,
|
|
485
|
-
default: () =>
|
|
511
|
+
default: () => bitmark_browser_full_wasm_default,
|
|
486
512
|
info: () => info2,
|
|
487
513
|
initSync: () => initSync2,
|
|
488
514
|
is_bitmark: () => is_bitmark2,
|
|
515
|
+
lex: () => lex2,
|
|
489
516
|
prettify: () => prettify2,
|
|
517
|
+
register: () => register2,
|
|
490
518
|
split_bits: () => split_bits2,
|
|
491
519
|
split_json_bits: () => split_json_bits2,
|
|
492
520
|
transform: () => transform2,
|
|
@@ -561,6 +589,26 @@ function getStringFromWasm02(ptr, len) {
|
|
|
561
589
|
ptr = ptr >>> 0;
|
|
562
590
|
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
563
591
|
}
|
|
592
|
+
function lex2(input, stage) {
|
|
593
|
+
let deferred3_0;
|
|
594
|
+
let deferred3_1;
|
|
595
|
+
try {
|
|
596
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
597
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
598
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
599
|
+
const ptr1 = passStringToWasm02(stage, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
600
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
601
|
+
wasm2.lex(retptr, ptr0, len0, ptr1, len1);
|
|
602
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
603
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
604
|
+
deferred3_0 = r0;
|
|
605
|
+
deferred3_1 = r1;
|
|
606
|
+
return getStringFromWasm02(r0, r1);
|
|
607
|
+
} finally {
|
|
608
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
609
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
564
612
|
function breakscape_text2(input, format, location) {
|
|
565
613
|
let deferred4_0;
|
|
566
614
|
let deferred4_1;
|
|
@@ -605,9 +653,9 @@ function unbreakscape_text2(input, format, location) {
|
|
|
605
653
|
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
606
654
|
}
|
|
607
655
|
}
|
|
608
|
-
function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
|
|
609
|
-
let
|
|
610
|
-
let
|
|
656
|
+
function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
657
|
+
let deferred5_0;
|
|
658
|
+
let deferred5_1;
|
|
611
659
|
try {
|
|
612
660
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
613
661
|
const ptr0 = passStringToWasm02(info_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -616,15 +664,87 @@ function info2(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
616
664
|
const len1 = WASM_VECTOR_LEN2;
|
|
617
665
|
const ptr2 = passStringToWasm02(bit, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
618
666
|
const len2 = WASM_VECTOR_LEN2;
|
|
619
|
-
|
|
667
|
+
const ptr3 = passStringToWasm02(language, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
668
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
669
|
+
wasm2.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
620
670
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
621
671
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
622
|
-
|
|
623
|
-
|
|
672
|
+
deferred5_0 = r0;
|
|
673
|
+
deferred5_1 = r1;
|
|
624
674
|
return getStringFromWasm02(r0, r1);
|
|
625
675
|
} finally {
|
|
626
676
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
627
|
-
wasm2.__wbindgen_export_2(
|
|
677
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
function convert_text2(input, direction, format, location) {
|
|
681
|
+
let deferred5_0;
|
|
682
|
+
let deferred5_1;
|
|
683
|
+
try {
|
|
684
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
685
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
686
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
687
|
+
const ptr1 = passStringToWasm02(direction, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
688
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
689
|
+
const ptr2 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
690
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
691
|
+
const ptr3 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
692
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
693
|
+
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
694
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
695
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
696
|
+
deferred5_0 = r0;
|
|
697
|
+
deferred5_1 = r1;
|
|
698
|
+
return getStringFromWasm02(r0, r1);
|
|
699
|
+
} finally {
|
|
700
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
701
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
705
|
+
let deferred6_0;
|
|
706
|
+
let deferred6_1;
|
|
707
|
+
try {
|
|
708
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
709
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
710
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
711
|
+
const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
712
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
713
|
+
const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
714
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
715
|
+
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
716
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
717
|
+
const ptr4 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
718
|
+
const len4 = WASM_VECTOR_LEN2;
|
|
719
|
+
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
720
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
721
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
722
|
+
deferred6_0 = r0;
|
|
723
|
+
deferred6_1 = r1;
|
|
724
|
+
return getStringFromWasm02(r0, r1);
|
|
725
|
+
} finally {
|
|
726
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
727
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
function register2(data_type, data) {
|
|
731
|
+
let deferred3_0;
|
|
732
|
+
let deferred3_1;
|
|
733
|
+
try {
|
|
734
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
735
|
+
const ptr0 = passStringToWasm02(data_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
736
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
737
|
+
const ptr1 = passStringToWasm02(data, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
738
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
739
|
+
wasm2.register(retptr, ptr0, len0, ptr1, len1);
|
|
740
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
741
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
742
|
+
deferred3_0 = r0;
|
|
743
|
+
deferred3_1 = r1;
|
|
744
|
+
return getStringFromWasm02(r0, r1);
|
|
745
|
+
} finally {
|
|
746
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
747
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
628
748
|
}
|
|
629
749
|
}
|
|
630
750
|
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
@@ -751,56 +871,6 @@ function prettify2(json, indent) {
|
|
|
751
871
|
wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
752
872
|
}
|
|
753
873
|
}
|
|
754
|
-
function convert_text2(input, direction, format, location) {
|
|
755
|
-
let deferred5_0;
|
|
756
|
-
let deferred5_1;
|
|
757
|
-
try {
|
|
758
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
759
|
-
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
760
|
-
const len0 = WASM_VECTOR_LEN2;
|
|
761
|
-
const ptr1 = passStringToWasm02(direction, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
762
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
763
|
-
const ptr2 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
764
|
-
const len2 = WASM_VECTOR_LEN2;
|
|
765
|
-
const ptr3 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
766
|
-
const len3 = WASM_VECTOR_LEN2;
|
|
767
|
-
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
768
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
769
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
770
|
-
deferred5_0 = r0;
|
|
771
|
-
deferred5_1 = r1;
|
|
772
|
-
return getStringFromWasm02(r0, r1);
|
|
773
|
-
} finally {
|
|
774
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
775
|
-
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
779
|
-
let deferred6_0;
|
|
780
|
-
let deferred6_1;
|
|
781
|
-
try {
|
|
782
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
783
|
-
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
784
|
-
const len0 = WASM_VECTOR_LEN2;
|
|
785
|
-
const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
786
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
787
|
-
const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
788
|
-
const len2 = WASM_VECTOR_LEN2;
|
|
789
|
-
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
790
|
-
const len3 = WASM_VECTOR_LEN2;
|
|
791
|
-
const ptr4 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
792
|
-
const len4 = WASM_VECTOR_LEN2;
|
|
793
|
-
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
794
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
795
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
796
|
-
deferred6_0 = r0;
|
|
797
|
-
deferred6_1 = r1;
|
|
798
|
-
return getStringFromWasm02(r0, r1);
|
|
799
|
-
} finally {
|
|
800
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
801
|
-
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
874
|
async function __wbg_load2(module2, imports) {
|
|
805
875
|
if (typeof Response === "function" && module2 instanceof Response) {
|
|
806
876
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
@@ -866,7 +936,7 @@ async function __wbg_init2(module_or_path) {
|
|
|
866
936
|
}
|
|
867
937
|
}
|
|
868
938
|
if (typeof module_or_path === "undefined") {
|
|
869
|
-
module_or_path = new URL("
|
|
939
|
+
module_or_path = new URL("bitmark_browser_full_wasm_bg.wasm", importMetaUrl);
|
|
870
940
|
}
|
|
871
941
|
const imports = __wbg_get_imports2();
|
|
872
942
|
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
@@ -876,24 +946,458 @@ async function __wbg_init2(module_or_path) {
|
|
|
876
946
|
const { instance, module: module2 } = await __wbg_load2(await module_or_path, imports);
|
|
877
947
|
return __wbg_finalize_init2(instance, module2);
|
|
878
948
|
}
|
|
879
|
-
var
|
|
949
|
+
var bitmark_browser_full_wasm_default = __wbg_init2;
|
|
950
|
+
|
|
951
|
+
// wasm-web-bitmark-json/bitmark_json_wasm.js
|
|
952
|
+
var bitmark_json_wasm_exports = {};
|
|
953
|
+
__export(bitmark_json_wasm_exports, {
|
|
954
|
+
breakscape_text: () => breakscape_text3,
|
|
955
|
+
canonicalize: () => canonicalize3,
|
|
956
|
+
convert: () => convert3,
|
|
957
|
+
convert_text: () => convert_text3,
|
|
958
|
+
count_bits: () => count_bits3,
|
|
959
|
+
default: () => bitmark_json_wasm_default,
|
|
960
|
+
info: () => info3,
|
|
961
|
+
initSync: () => initSync3,
|
|
962
|
+
is_bitmark: () => is_bitmark3,
|
|
963
|
+
prettify: () => prettify3,
|
|
964
|
+
register: () => register3,
|
|
965
|
+
split_bits: () => split_bits3,
|
|
966
|
+
split_json_bits: () => split_json_bits3,
|
|
967
|
+
transform: () => transform3,
|
|
968
|
+
unbreakscape_text: () => unbreakscape_text3
|
|
969
|
+
});
|
|
970
|
+
var wasm3;
|
|
971
|
+
var WASM_VECTOR_LEN3 = 0;
|
|
972
|
+
var cachedUint8ArrayMemory03 = null;
|
|
973
|
+
function getUint8ArrayMemory03() {
|
|
974
|
+
if (cachedUint8ArrayMemory03 === null || cachedUint8ArrayMemory03.byteLength === 0) {
|
|
975
|
+
cachedUint8ArrayMemory03 = new Uint8Array(wasm3.memory.buffer);
|
|
976
|
+
}
|
|
977
|
+
return cachedUint8ArrayMemory03;
|
|
978
|
+
}
|
|
979
|
+
var cachedTextEncoder3 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
980
|
+
throw Error("TextEncoder not available");
|
|
981
|
+
} };
|
|
982
|
+
var encodeString3 = typeof cachedTextEncoder3.encodeInto === "function" ? function(arg, view) {
|
|
983
|
+
return cachedTextEncoder3.encodeInto(arg, view);
|
|
984
|
+
} : function(arg, view) {
|
|
985
|
+
const buf = cachedTextEncoder3.encode(arg);
|
|
986
|
+
view.set(buf);
|
|
987
|
+
return {
|
|
988
|
+
read: arg.length,
|
|
989
|
+
written: buf.length
|
|
990
|
+
};
|
|
991
|
+
};
|
|
992
|
+
function passStringToWasm03(arg, malloc, realloc) {
|
|
993
|
+
if (realloc === void 0) {
|
|
994
|
+
const buf = cachedTextEncoder3.encode(arg);
|
|
995
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
996
|
+
getUint8ArrayMemory03().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
997
|
+
WASM_VECTOR_LEN3 = buf.length;
|
|
998
|
+
return ptr2;
|
|
999
|
+
}
|
|
1000
|
+
let len = arg.length;
|
|
1001
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1002
|
+
const mem = getUint8ArrayMemory03();
|
|
1003
|
+
let offset = 0;
|
|
1004
|
+
for (; offset < len; offset++) {
|
|
1005
|
+
const code = arg.charCodeAt(offset);
|
|
1006
|
+
if (code > 127) break;
|
|
1007
|
+
mem[ptr + offset] = code;
|
|
1008
|
+
}
|
|
1009
|
+
if (offset !== len) {
|
|
1010
|
+
if (offset !== 0) {
|
|
1011
|
+
arg = arg.slice(offset);
|
|
1012
|
+
}
|
|
1013
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1014
|
+
const view = getUint8ArrayMemory03().subarray(ptr + offset, ptr + len);
|
|
1015
|
+
const ret = encodeString3(arg, view);
|
|
1016
|
+
offset += ret.written;
|
|
1017
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1018
|
+
}
|
|
1019
|
+
WASM_VECTOR_LEN3 = offset;
|
|
1020
|
+
return ptr;
|
|
1021
|
+
}
|
|
1022
|
+
var cachedDataViewMemory03 = null;
|
|
1023
|
+
function getDataViewMemory03() {
|
|
1024
|
+
if (cachedDataViewMemory03 === null || cachedDataViewMemory03.buffer.detached === true || cachedDataViewMemory03.buffer.detached === void 0 && cachedDataViewMemory03.buffer !== wasm3.memory.buffer) {
|
|
1025
|
+
cachedDataViewMemory03 = new DataView(wasm3.memory.buffer);
|
|
1026
|
+
}
|
|
1027
|
+
return cachedDataViewMemory03;
|
|
1028
|
+
}
|
|
1029
|
+
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
1030
|
+
throw Error("TextDecoder not available");
|
|
1031
|
+
} };
|
|
1032
|
+
if (typeof TextDecoder !== "undefined") {
|
|
1033
|
+
cachedTextDecoder3.decode();
|
|
1034
|
+
}
|
|
1035
|
+
function getStringFromWasm03(ptr, len) {
|
|
1036
|
+
ptr = ptr >>> 0;
|
|
1037
|
+
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
1038
|
+
}
|
|
1039
|
+
function breakscape_text3(input, format, location) {
|
|
1040
|
+
let deferred4_0;
|
|
1041
|
+
let deferred4_1;
|
|
1042
|
+
try {
|
|
1043
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1044
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1045
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1046
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1047
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1048
|
+
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1049
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1050
|
+
wasm3.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1051
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1052
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1053
|
+
deferred4_0 = r0;
|
|
1054
|
+
deferred4_1 = r1;
|
|
1055
|
+
return getStringFromWasm03(r0, r1);
|
|
1056
|
+
} finally {
|
|
1057
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1058
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
function unbreakscape_text3(input, format, location) {
|
|
1062
|
+
let deferred4_0;
|
|
1063
|
+
let deferred4_1;
|
|
1064
|
+
try {
|
|
1065
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1066
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1067
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1068
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1069
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1070
|
+
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1071
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1072
|
+
wasm3.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1073
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1074
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1075
|
+
deferred4_0 = r0;
|
|
1076
|
+
deferred4_1 = r1;
|
|
1077
|
+
return getStringFromWasm03(r0, r1);
|
|
1078
|
+
} finally {
|
|
1079
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1080
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
function info3(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
1084
|
+
let deferred5_0;
|
|
1085
|
+
let deferred5_1;
|
|
1086
|
+
try {
|
|
1087
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1088
|
+
const ptr0 = passStringToWasm03(info_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1089
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1090
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1091
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1092
|
+
const ptr2 = passStringToWasm03(bit, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1093
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1094
|
+
const ptr3 = passStringToWasm03(language, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1095
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1096
|
+
wasm3.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
1097
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1098
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1099
|
+
deferred5_0 = r0;
|
|
1100
|
+
deferred5_1 = r1;
|
|
1101
|
+
return getStringFromWasm03(r0, r1);
|
|
1102
|
+
} finally {
|
|
1103
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1104
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
function register3(data_type, data) {
|
|
1108
|
+
let deferred3_0;
|
|
1109
|
+
let deferred3_1;
|
|
1110
|
+
try {
|
|
1111
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1112
|
+
const ptr0 = passStringToWasm03(data_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1113
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1114
|
+
const ptr1 = passStringToWasm03(data, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1115
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1116
|
+
wasm3.register(retptr, ptr0, len0, ptr1, len1);
|
|
1117
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1118
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1119
|
+
deferred3_0 = r0;
|
|
1120
|
+
deferred3_1 = r1;
|
|
1121
|
+
return getStringFromWasm03(r0, r1);
|
|
1122
|
+
} finally {
|
|
1123
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1124
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
function transform3(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
1128
|
+
let deferred6_0;
|
|
1129
|
+
let deferred6_1;
|
|
1130
|
+
try {
|
|
1131
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1132
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1133
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1134
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1135
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1136
|
+
const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1137
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1138
|
+
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1139
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1140
|
+
const ptr4 = passStringToWasm03(patch_json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1141
|
+
const len4 = WASM_VECTOR_LEN3;
|
|
1142
|
+
wasm3.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
1143
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1144
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1145
|
+
deferred6_0 = r0;
|
|
1146
|
+
deferred6_1 = r1;
|
|
1147
|
+
return getStringFromWasm03(r0, r1);
|
|
1148
|
+
} finally {
|
|
1149
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1150
|
+
wasm3.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
1154
|
+
let deferred5_0;
|
|
1155
|
+
let deferred5_1;
|
|
1156
|
+
try {
|
|
1157
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1158
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1159
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1160
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1161
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1162
|
+
const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1163
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1164
|
+
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1165
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1166
|
+
wasm3.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
|
|
1167
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1168
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1169
|
+
deferred5_0 = r0;
|
|
1170
|
+
deferred5_1 = r1;
|
|
1171
|
+
return getStringFromWasm03(r0, r1);
|
|
1172
|
+
} finally {
|
|
1173
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1174
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
1178
|
+
let deferred4_0;
|
|
1179
|
+
let deferred4_1;
|
|
1180
|
+
try {
|
|
1181
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1182
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1183
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1184
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1185
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1186
|
+
const ptr2 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1187
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1188
|
+
wasm3.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
1189
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1190
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1191
|
+
deferred4_0 = r0;
|
|
1192
|
+
deferred4_1 = r1;
|
|
1193
|
+
return getStringFromWasm03(r0, r1);
|
|
1194
|
+
} finally {
|
|
1195
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1196
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
function count_bits3(input) {
|
|
1200
|
+
let deferred2_0;
|
|
1201
|
+
let deferred2_1;
|
|
1202
|
+
try {
|
|
1203
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1204
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1205
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1206
|
+
wasm3.count_bits(retptr, ptr0, len0);
|
|
1207
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1208
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1209
|
+
deferred2_0 = r0;
|
|
1210
|
+
deferred2_1 = r1;
|
|
1211
|
+
return getStringFromWasm03(r0, r1);
|
|
1212
|
+
} finally {
|
|
1213
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1214
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
function split_bits3(input) {
|
|
1218
|
+
let deferred2_0;
|
|
1219
|
+
let deferred2_1;
|
|
1220
|
+
try {
|
|
1221
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1222
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1223
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1224
|
+
wasm3.split_bits(retptr, ptr0, len0);
|
|
1225
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1226
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1227
|
+
deferred2_0 = r0;
|
|
1228
|
+
deferred2_1 = r1;
|
|
1229
|
+
return getStringFromWasm03(r0, r1);
|
|
1230
|
+
} finally {
|
|
1231
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1232
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
function is_bitmark3(input) {
|
|
1236
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1237
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1238
|
+
const ret = wasm3.is_bitmark(ptr0, len0);
|
|
1239
|
+
return ret !== 0;
|
|
1240
|
+
}
|
|
1241
|
+
function split_json_bits3(input) {
|
|
1242
|
+
let deferred2_0;
|
|
1243
|
+
let deferred2_1;
|
|
1244
|
+
try {
|
|
1245
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1246
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1247
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1248
|
+
wasm3.split_json_bits(retptr, ptr0, len0);
|
|
1249
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1250
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1251
|
+
deferred2_0 = r0;
|
|
1252
|
+
deferred2_1 = r1;
|
|
1253
|
+
return getStringFromWasm03(r0, r1);
|
|
1254
|
+
} finally {
|
|
1255
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1256
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
function prettify3(json, indent) {
|
|
1260
|
+
let deferred2_0;
|
|
1261
|
+
let deferred2_1;
|
|
1262
|
+
try {
|
|
1263
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1264
|
+
const ptr0 = passStringToWasm03(json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1265
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1266
|
+
wasm3.prettify(retptr, ptr0, len0, indent);
|
|
1267
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1268
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1269
|
+
deferred2_0 = r0;
|
|
1270
|
+
deferred2_1 = r1;
|
|
1271
|
+
return getStringFromWasm03(r0, r1);
|
|
1272
|
+
} finally {
|
|
1273
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1274
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
function convert_text3(input, direction, format, location) {
|
|
1278
|
+
let deferred5_0;
|
|
1279
|
+
let deferred5_1;
|
|
1280
|
+
try {
|
|
1281
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1282
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1283
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1284
|
+
const ptr1 = passStringToWasm03(direction, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1285
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1286
|
+
const ptr2 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1287
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1288
|
+
const ptr3 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1289
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1290
|
+
wasm3.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1291
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1292
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1293
|
+
deferred5_0 = r0;
|
|
1294
|
+
deferred5_1 = r1;
|
|
1295
|
+
return getStringFromWasm03(r0, r1);
|
|
1296
|
+
} finally {
|
|
1297
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1298
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
async function __wbg_load3(module2, imports) {
|
|
1302
|
+
if (typeof Response === "function" && module2 instanceof Response) {
|
|
1303
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
1304
|
+
try {
|
|
1305
|
+
return await WebAssembly.instantiateStreaming(module2, imports);
|
|
1306
|
+
} catch (e) {
|
|
1307
|
+
if (module2.headers.get("Content-Type") != "application/wasm") {
|
|
1308
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1309
|
+
} else {
|
|
1310
|
+
throw e;
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
const bytes = await module2.arrayBuffer();
|
|
1315
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1316
|
+
} else {
|
|
1317
|
+
const instance = await WebAssembly.instantiate(module2, imports);
|
|
1318
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1319
|
+
return { instance, module: module2 };
|
|
1320
|
+
} else {
|
|
1321
|
+
return instance;
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
function __wbg_get_imports3() {
|
|
1326
|
+
const imports = {};
|
|
1327
|
+
imports.wbg = {};
|
|
1328
|
+
return imports;
|
|
1329
|
+
}
|
|
1330
|
+
function __wbg_init_memory3(imports, memory) {
|
|
1331
|
+
}
|
|
1332
|
+
function __wbg_finalize_init3(instance, module2) {
|
|
1333
|
+
wasm3 = instance.exports;
|
|
1334
|
+
__wbg_init3.__wbindgen_wasm_module = module2;
|
|
1335
|
+
cachedDataViewMemory03 = null;
|
|
1336
|
+
cachedUint8ArrayMemory03 = null;
|
|
1337
|
+
return wasm3;
|
|
1338
|
+
}
|
|
1339
|
+
function initSync3(module2) {
|
|
1340
|
+
if (wasm3 !== void 0) return wasm3;
|
|
1341
|
+
if (typeof module2 !== "undefined") {
|
|
1342
|
+
if (Object.getPrototypeOf(module2) === Object.prototype) {
|
|
1343
|
+
({ module: module2 } = module2);
|
|
1344
|
+
} else {
|
|
1345
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
const imports = __wbg_get_imports3();
|
|
1349
|
+
__wbg_init_memory3(imports);
|
|
1350
|
+
if (!(module2 instanceof WebAssembly.Module)) {
|
|
1351
|
+
module2 = new WebAssembly.Module(module2);
|
|
1352
|
+
}
|
|
1353
|
+
const instance = new WebAssembly.Instance(module2, imports);
|
|
1354
|
+
return __wbg_finalize_init3(instance, module2);
|
|
1355
|
+
}
|
|
1356
|
+
async function __wbg_init3(module_or_path) {
|
|
1357
|
+
if (wasm3 !== void 0) return wasm3;
|
|
1358
|
+
if (typeof module_or_path !== "undefined") {
|
|
1359
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1360
|
+
({ module_or_path } = module_or_path);
|
|
1361
|
+
} else {
|
|
1362
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
if (typeof module_or_path === "undefined") {
|
|
1366
|
+
module_or_path = new URL("bitmark_json_wasm_bg.wasm", importMetaUrl);
|
|
1367
|
+
}
|
|
1368
|
+
const imports = __wbg_get_imports3();
|
|
1369
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
1370
|
+
module_or_path = fetch(module_or_path);
|
|
1371
|
+
}
|
|
1372
|
+
__wbg_init_memory3(imports);
|
|
1373
|
+
const { instance, module: module2 } = await __wbg_load3(await module_or_path, imports);
|
|
1374
|
+
return __wbg_finalize_init3(instance, module2);
|
|
1375
|
+
}
|
|
1376
|
+
var bitmark_json_wasm_default = __wbg_init3;
|
|
880
1377
|
|
|
881
1378
|
// src/generated/package_info.ts
|
|
882
1379
|
var PACKAGE_INFO = {
|
|
883
1380
|
"name": "@gmb/bitmark-parser",
|
|
884
|
-
"version": "6.
|
|
1381
|
+
"version": "6.11.0",
|
|
885
1382
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
886
1383
|
"license": "ISC",
|
|
887
1384
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
888
1385
|
};
|
|
889
1386
|
|
|
890
1387
|
// src/core/facade.ts
|
|
1388
|
+
var BROWSER_DEFAULT_FEATURE = "browser-full";
|
|
891
1389
|
var NotInitializedError = class extends Error {
|
|
892
1390
|
constructor() {
|
|
893
1391
|
super("wasm not initialised: call init() (or init({ feature: \u2026 })) first");
|
|
894
1392
|
this.name = "NotInitializedError";
|
|
895
1393
|
}
|
|
896
1394
|
};
|
|
1395
|
+
var RegisterError = class extends Error {
|
|
1396
|
+
constructor(message) {
|
|
1397
|
+
super(message);
|
|
1398
|
+
this.name = "RegisterError";
|
|
1399
|
+
}
|
|
1400
|
+
};
|
|
897
1401
|
var UnsupportedFeatureError = class extends Error {
|
|
898
1402
|
constructor(what, active2) {
|
|
899
1403
|
super(
|
|
@@ -905,15 +1409,23 @@ var UnsupportedFeatureError = class extends Error {
|
|
|
905
1409
|
var active;
|
|
906
1410
|
var activeFeature;
|
|
907
1411
|
var lazyLoader;
|
|
1412
|
+
var registrations = /* @__PURE__ */ new Map();
|
|
908
1413
|
function getActive() {
|
|
909
1414
|
if (!active && lazyLoader) lazyLoader();
|
|
910
1415
|
if (!active) throw new NotInitializedError();
|
|
911
1416
|
return active;
|
|
912
1417
|
}
|
|
913
1418
|
function setActive(feature, module2) {
|
|
1419
|
+
for (const [type, data] of registrations) {
|
|
1420
|
+
const error = module2.register(type, data);
|
|
1421
|
+
if (error) throw new RegisterError(error.replace(/^error:\s*/, ""));
|
|
1422
|
+
}
|
|
914
1423
|
active = module2;
|
|
915
1424
|
activeFeature = feature;
|
|
916
1425
|
}
|
|
1426
|
+
function rememberRegistration(type, data) {
|
|
1427
|
+
registrations.set(type, data);
|
|
1428
|
+
}
|
|
917
1429
|
function variant() {
|
|
918
1430
|
return activeFeature;
|
|
919
1431
|
}
|
|
@@ -938,9 +1450,9 @@ function normalisePatch(patch) {
|
|
|
938
1450
|
}
|
|
939
1451
|
return patch;
|
|
940
1452
|
}
|
|
941
|
-
function buildUnits(
|
|
1453
|
+
function buildUnits(wasm4, input, inputIsBitmark) {
|
|
942
1454
|
if (inputIsBitmark) {
|
|
943
|
-
const out2 =
|
|
1455
|
+
const out2 = wasm4.split_bits(input);
|
|
944
1456
|
if (isError(out2)) throw new Error(out2);
|
|
945
1457
|
const slices = JSON.parse(out2);
|
|
946
1458
|
return slices.map((s) => ({
|
|
@@ -948,7 +1460,7 @@ function buildUnits(wasm3, input, inputIsBitmark) {
|
|
|
948
1460
|
source: s.source
|
|
949
1461
|
}));
|
|
950
1462
|
}
|
|
951
|
-
const out =
|
|
1463
|
+
const out = wasm4.split_json_bits(input);
|
|
952
1464
|
if (isError(out)) throw new Error(out);
|
|
953
1465
|
const envelopes = JSON.parse(out);
|
|
954
1466
|
return envelopes.map((env, index) => ({
|
|
@@ -957,17 +1469,17 @@ function buildUnits(wasm3, input, inputIsBitmark) {
|
|
|
957
1469
|
source: JSON.stringify([env])
|
|
958
1470
|
}));
|
|
959
1471
|
}
|
|
960
|
-
function planTransform(
|
|
1472
|
+
function planTransform(wasm4, input, options) {
|
|
961
1473
|
const mode = options.mode ?? "optimized";
|
|
962
1474
|
const output = options.outputFormat ?? "json";
|
|
963
1475
|
const spacesAroundValues = options.spacesAroundValues ?? 1;
|
|
964
1476
|
const indent = options.indent ?? 2;
|
|
965
1477
|
const pretty = options.pretty ?? false;
|
|
966
1478
|
const sel = options.inputFormat ?? "auto";
|
|
967
|
-
const inputIsBitmark = sel === "bitmark" || sel !== "json" &&
|
|
1479
|
+
const inputIsBitmark = sel === "bitmark" || sel !== "json" && wasm4.is_bitmark(input);
|
|
968
1480
|
const inputFormat = inputIsBitmark ? "bitmark" : "json";
|
|
969
1481
|
const staticPatch = normalisePatch(options.patch);
|
|
970
|
-
const units = buildUnits(
|
|
1482
|
+
const units = buildUnits(wasm4, input, inputIsBitmark);
|
|
971
1483
|
const total = units.length;
|
|
972
1484
|
const jobs = [];
|
|
973
1485
|
const views = [];
|
|
@@ -991,8 +1503,8 @@ function planTransform(wasm3, input, options) {
|
|
|
991
1503
|
}
|
|
992
1504
|
return { jobs, views, output, pretty, indent };
|
|
993
1505
|
}
|
|
994
|
-
function computeBit(
|
|
995
|
-
const out =
|
|
1506
|
+
function computeBit(wasm4, job) {
|
|
1507
|
+
const out = wasm4.transform(
|
|
996
1508
|
job.source,
|
|
997
1509
|
job.inputFormat,
|
|
998
1510
|
job.outputFormat,
|
|
@@ -1005,33 +1517,33 @@ function computeBit(wasm3, job) {
|
|
|
1005
1517
|
if (isError(out)) return out;
|
|
1006
1518
|
return job.outputFormat === "json" ? stripArray(out) : out;
|
|
1007
1519
|
}
|
|
1008
|
-
function recombine(
|
|
1520
|
+
function recombine(wasm4, elements, output, pretty, indent) {
|
|
1009
1521
|
if (output === "bitmark" || output === "text") return elements.join("\n");
|
|
1010
1522
|
const arr = `[${elements.join(",")}]`;
|
|
1011
|
-
return pretty ?
|
|
1523
|
+
return pretty ? wasm4.prettify(arr, indent) : arr;
|
|
1012
1524
|
}
|
|
1013
|
-
function runHookedTransform(
|
|
1525
|
+
function runHookedTransform(wasm4, input, options) {
|
|
1014
1526
|
let plan;
|
|
1015
1527
|
try {
|
|
1016
|
-
plan = planTransform(
|
|
1528
|
+
plan = planTransform(wasm4, input, options);
|
|
1017
1529
|
} catch (e) {
|
|
1018
1530
|
return errorString(e);
|
|
1019
1531
|
}
|
|
1020
1532
|
const rendered = [];
|
|
1021
1533
|
for (let i = 0; i < plan.jobs.length; i++) {
|
|
1022
|
-
const element = computeBit(
|
|
1534
|
+
const element = computeBit(wasm4, plan.jobs[i]);
|
|
1023
1535
|
if (isError(element)) return element;
|
|
1024
1536
|
options.postHook?.(plan.views[i], element);
|
|
1025
1537
|
rendered.push(element);
|
|
1026
1538
|
}
|
|
1027
|
-
return recombine(
|
|
1539
|
+
return recombine(wasm4, rendered, plan.output, plan.pretty, plan.indent);
|
|
1028
1540
|
}
|
|
1029
1541
|
|
|
1030
1542
|
// src/core/parallel.ts
|
|
1031
|
-
async function orchestrateParallel(
|
|
1543
|
+
async function orchestrateParallel(wasm4, input, options, runJobs) {
|
|
1032
1544
|
let plan;
|
|
1033
1545
|
try {
|
|
1034
|
-
plan = planTransform(
|
|
1546
|
+
plan = planTransform(wasm4, input, options);
|
|
1035
1547
|
} catch (e) {
|
|
1036
1548
|
return errorString(e);
|
|
1037
1549
|
}
|
|
@@ -1045,7 +1557,7 @@ async function orchestrateParallel(wasm3, input, options, runJobs) {
|
|
|
1045
1557
|
if (isError(elements[i])) return elements[i];
|
|
1046
1558
|
options.postHook?.(plan.views[i], elements[i]);
|
|
1047
1559
|
}
|
|
1048
|
-
return recombine(
|
|
1560
|
+
return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
|
|
1049
1561
|
}
|
|
1050
1562
|
|
|
1051
1563
|
// src/legacy/runtime.ts
|
|
@@ -1192,9 +1704,9 @@ function validateJsonOptions(o) {
|
|
|
1192
1704
|
if (o.textAsPlainText) unsupportedOption("jsonOptions.textAsPlainText", V3_ONLY);
|
|
1193
1705
|
if (o.debugGenerationInline) unsupportedOption("jsonOptions.debugGenerationInline");
|
|
1194
1706
|
}
|
|
1195
|
-
function prettyIndent(
|
|
1196
|
-
if (
|
|
1197
|
-
if (typeof
|
|
1707
|
+
function prettyIndent(prettify4) {
|
|
1708
|
+
if (prettify4 === true) return { pretty: true, indent: 2 };
|
|
1709
|
+
if (typeof prettify4 === "number" && prettify4 > 0) return { pretty: true, indent: prettify4 };
|
|
1198
1710
|
return { pretty: false, indent: 2 };
|
|
1199
1711
|
}
|
|
1200
1712
|
function spacesAround(v) {
|
|
@@ -1294,7 +1806,7 @@ var Builder = class {
|
|
|
1294
1806
|
* more than one resource, use the first one").
|
|
1295
1807
|
*/
|
|
1296
1808
|
buildBit(data, _options) {
|
|
1297
|
-
const
|
|
1809
|
+
const wasm4 = getLegacyWasm();
|
|
1298
1810
|
const src = { ...data };
|
|
1299
1811
|
const bitType = src.bitType;
|
|
1300
1812
|
const bitConfig = this.getBitConfig(bitType);
|
|
@@ -1355,7 +1867,7 @@ var Builder = class {
|
|
|
1355
1867
|
}
|
|
1356
1868
|
}
|
|
1357
1869
|
this.parseStringTexts(bit);
|
|
1358
|
-
const out =
|
|
1870
|
+
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
|
|
1359
1871
|
if (out.startsWith("error:")) {
|
|
1360
1872
|
throw new Error(out.slice("error:".length).trim());
|
|
1361
1873
|
}
|
|
@@ -1411,10 +1923,10 @@ var Builder = class {
|
|
|
1411
1923
|
* (bpg TextParser.toAst ignores format; only location matters).
|
|
1412
1924
|
*/
|
|
1413
1925
|
parseStringTexts(bit) {
|
|
1414
|
-
const
|
|
1926
|
+
const wasm4 = getLegacyWasm();
|
|
1415
1927
|
const toAst = (s, location) => {
|
|
1416
1928
|
if (s === "") return s;
|
|
1417
|
-
const out =
|
|
1929
|
+
const out = wasm4.convert_text(s, "textToAst", "bitmark++", location);
|
|
1418
1930
|
try {
|
|
1419
1931
|
return JSON.parse(out);
|
|
1420
1932
|
} catch {
|
|
@@ -1444,11 +1956,11 @@ var Builder = class {
|
|
|
1444
1956
|
* unknown-bit-type error (`Config.getBitConfig` parity).
|
|
1445
1957
|
*/
|
|
1446
1958
|
getBitConfig(bitType) {
|
|
1447
|
-
const
|
|
1959
|
+
const wasm4 = getLegacyWasm();
|
|
1448
1960
|
if (bitType !== void 0) {
|
|
1449
1961
|
try {
|
|
1450
|
-
const
|
|
1451
|
-
if (
|
|
1962
|
+
const info5 = JSON.parse(wasm4.info("bit", "json", bitType, false, 2, false, false, true, ""));
|
|
1963
|
+
if (info5.error === void 0) return { bodyFormat: info5.body?.format };
|
|
1452
1964
|
} catch {
|
|
1453
1965
|
}
|
|
1454
1966
|
}
|
|
@@ -1487,7 +1999,7 @@ var BitmarkParserGenerator = class {
|
|
|
1487
1999
|
validateBitmarkOptions(bitmarkOptions);
|
|
1488
2000
|
validateJsonOptions(jsonOptions);
|
|
1489
2001
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1490
|
-
const
|
|
2002
|
+
const wasm4 = getLegacyWasm();
|
|
1491
2003
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1492
2004
|
const outputFormat = opts.outputFormat ?? (isBitmark ? "json" : "bitmark");
|
|
1493
2005
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
@@ -1495,7 +2007,7 @@ var BitmarkParserGenerator = class {
|
|
|
1495
2007
|
const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
|
|
1496
2008
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1497
2009
|
const includeUnknown = !jsonOptions.excludeUnknownProperties;
|
|
1498
|
-
const out =
|
|
2010
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
|
|
1499
2011
|
this.throwOnError(out);
|
|
1500
2012
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1501
2013
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1523,13 +2035,13 @@ var BitmarkParserGenerator = class {
|
|
|
1523
2035
|
validateBitmarkOptions(bitmarkOptions);
|
|
1524
2036
|
validateJsonOptions(jsonOptions);
|
|
1525
2037
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1526
|
-
const
|
|
2038
|
+
const wasm4 = getLegacyWasm();
|
|
1527
2039
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1528
2040
|
const { pretty, indent } = prettyIndent(
|
|
1529
2041
|
isBitmark ? bitmarkOptions.prettifyJson : jsonOptions.prettify
|
|
1530
2042
|
);
|
|
1531
2043
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1532
|
-
const out =
|
|
2044
|
+
const out = wasm4.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
|
|
1533
2045
|
this.throwOnError(out);
|
|
1534
2046
|
if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
1535
2047
|
if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1541,12 +2053,12 @@ var BitmarkParserGenerator = class {
|
|
|
1541
2053
|
*/
|
|
1542
2054
|
info(options) {
|
|
1543
2055
|
const opts = Object.assign({}, options);
|
|
1544
|
-
const
|
|
2056
|
+
const wasm4 = getLegacyWasm();
|
|
1545
2057
|
const type = opts.type ?? "list";
|
|
1546
2058
|
const format = opts.outputFormat ?? "text";
|
|
1547
2059
|
const { pretty, indent } = prettyIndent(opts.prettify);
|
|
1548
2060
|
const coreFormat = format === "pojo" ? "json" : format;
|
|
1549
|
-
const out =
|
|
2061
|
+
const out = wasm4.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true, "");
|
|
1550
2062
|
this.throwOnError(out);
|
|
1551
2063
|
if (format === "pojo") return JSON.parse(out);
|
|
1552
2064
|
return out;
|
|
@@ -1574,12 +2086,12 @@ var BitmarkParserGenerator = class {
|
|
|
1574
2086
|
if (opts.keepUnknownTags) unsupportedOption("keepUnknownTags");
|
|
1575
2087
|
if (opts.noBreakscaping) unsupportedOption("noBreakscaping");
|
|
1576
2088
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1577
|
-
const
|
|
2089
|
+
const wasm4 = getLegacyWasm();
|
|
1578
2090
|
const inStr = typeof input === "string" ? this.maybeReadFile(input, void 0) : "";
|
|
1579
2091
|
const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
|
|
1580
2092
|
if (!isHtmlInput) {
|
|
1581
2093
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1582
|
-
const out2 =
|
|
2094
|
+
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
|
|
1583
2095
|
this.throwOnError(out2);
|
|
1584
2096
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1585
2097
|
}
|
|
@@ -1589,12 +2101,12 @@ var BitmarkParserGenerator = class {
|
|
|
1589
2101
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
1590
2102
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1591
2103
|
if (outputFormat === "html") {
|
|
1592
|
-
const out2 =
|
|
2104
|
+
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
|
|
1593
2105
|
this.throwOnError(out2);
|
|
1594
2106
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1595
2107
|
}
|
|
1596
2108
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
1597
|
-
const out =
|
|
2109
|
+
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
|
|
1598
2110
|
this.throwOnError(out);
|
|
1599
2111
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1600
2112
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1617,9 +2129,9 @@ var BitmarkParserGenerator = class {
|
|
|
1617
2129
|
*/
|
|
1618
2130
|
createAst(input, options) {
|
|
1619
2131
|
const opts = Object.assign({}, options);
|
|
1620
|
-
const
|
|
2132
|
+
const wasm4 = getLegacyWasm();
|
|
1621
2133
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1622
|
-
const out =
|
|
2134
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
|
|
1623
2135
|
this.throwOnError(out);
|
|
1624
2136
|
return makePseudoAst(JSON.parse(out));
|
|
1625
2137
|
}
|
|
@@ -1630,9 +2142,9 @@ var BitmarkParserGenerator = class {
|
|
|
1630
2142
|
if (!input) return input;
|
|
1631
2143
|
const opts = Object.assign({}, options);
|
|
1632
2144
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1633
|
-
const
|
|
2145
|
+
const wasm4 = getLegacyWasm();
|
|
1634
2146
|
const inStr = this.maybeReadFile(input, opts.inputFormat);
|
|
1635
|
-
const res =
|
|
2147
|
+
const res = wasm4.breakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
|
|
1636
2148
|
return this.deliver(res, opts.outputFile, opts.fileOptions);
|
|
1637
2149
|
}
|
|
1638
2150
|
/**
|
|
@@ -1642,9 +2154,9 @@ var BitmarkParserGenerator = class {
|
|
|
1642
2154
|
if (!input) return input;
|
|
1643
2155
|
const opts = Object.assign({}, options);
|
|
1644
2156
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1645
|
-
const
|
|
2157
|
+
const wasm4 = getLegacyWasm();
|
|
1646
2158
|
const inStr = this.maybeReadFile(input, opts.inputFormat);
|
|
1647
|
-
const res =
|
|
2159
|
+
const res = wasm4.unbreakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
|
|
1648
2160
|
return this.deliver(res, opts.outputFile, opts.fileOptions);
|
|
1649
2161
|
}
|
|
1650
2162
|
/**
|
|
@@ -1658,7 +2170,7 @@ var BitmarkParserGenerator = class {
|
|
|
1658
2170
|
const opts = Object.assign({}, options);
|
|
1659
2171
|
const jsonOptions = Object.assign({}, opts.jsonOptions);
|
|
1660
2172
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1661
|
-
const
|
|
2173
|
+
const wasm4 = getLegacyWasm();
|
|
1662
2174
|
const isBitmarkText = opts.textFormat === void 0 || mapTextFormat(opts.textFormat) === "bitmark++";
|
|
1663
2175
|
const textLocation = opts.textLocation ?? "body";
|
|
1664
2176
|
let inStr;
|
|
@@ -1671,14 +2183,14 @@ var BitmarkParserGenerator = class {
|
|
|
1671
2183
|
ast = Array.isArray(input) ? input : void 0;
|
|
1672
2184
|
}
|
|
1673
2185
|
if (ast !== void 0) {
|
|
1674
|
-
const out2 = isBitmarkText ?
|
|
2186
|
+
const out2 = isBitmarkText ? wasm4.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm4.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
|
|
1675
2187
|
this.throwOnError(out2);
|
|
1676
2188
|
return this.deliver(out2, opts.outputFile, opts.fileOptions);
|
|
1677
2189
|
}
|
|
1678
|
-
const out =
|
|
2190
|
+
const out = wasm4.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
|
|
1679
2191
|
this.throwOnError(out);
|
|
1680
2192
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
1681
|
-
const outStr = pretty ?
|
|
2193
|
+
const outStr = pretty ? wasm4.prettify(out, indent) : out;
|
|
1682
2194
|
if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);
|
|
1683
2195
|
if (pretty) return outStr;
|
|
1684
2196
|
return JSON.parse(out);
|
|
@@ -1687,8 +2199,8 @@ var BitmarkParserGenerator = class {
|
|
|
1687
2199
|
* Convert a text AST to plain text (bpg-compatible `textAstToPlainText`).
|
|
1688
2200
|
*/
|
|
1689
2201
|
textAstToPlainText(textAst, _options) {
|
|
1690
|
-
const
|
|
1691
|
-
const out =
|
|
2202
|
+
const wasm4 = getLegacyWasm();
|
|
2203
|
+
const out = wasm4.convert_text(
|
|
1692
2204
|
typeof textAst === "string" ? textAst : JSON.stringify(textAst),
|
|
1693
2205
|
"astToPlainText",
|
|
1694
2206
|
"bitmark++",
|
|
@@ -1702,17 +2214,17 @@ var BitmarkParserGenerator = class {
|
|
|
1702
2214
|
*/
|
|
1703
2215
|
extractPlainText(input, options) {
|
|
1704
2216
|
const inputFormat = options?.inputFormat;
|
|
1705
|
-
const
|
|
2217
|
+
const wasm4 = getLegacyWasm();
|
|
1706
2218
|
if (inputFormat === "plainText") {
|
|
1707
2219
|
return typeof input === "string" ? String(input) : "";
|
|
1708
2220
|
}
|
|
1709
2221
|
if (inputFormat === "bitmarkText") {
|
|
1710
|
-
const ast =
|
|
1711
|
-
const out2 =
|
|
2222
|
+
const ast = wasm4.convert_text(String(input), "textToAst", "bitmark++", "body");
|
|
2223
|
+
const out2 = wasm4.convert_text(ast, "astToPlainText", "bitmark++", "body");
|
|
1712
2224
|
this.throwOnError(out2);
|
|
1713
2225
|
return out2;
|
|
1714
2226
|
}
|
|
1715
|
-
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !
|
|
2227
|
+
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm4.is_bitmark(input)) {
|
|
1716
2228
|
const looksJson = (() => {
|
|
1717
2229
|
try {
|
|
1718
2230
|
JSON.parse(input);
|
|
@@ -1726,7 +2238,7 @@ var BitmarkParserGenerator = class {
|
|
|
1726
2238
|
}
|
|
1727
2239
|
}
|
|
1728
2240
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1729
|
-
const out =
|
|
2241
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
|
|
1730
2242
|
this.throwOnError(out);
|
|
1731
2243
|
return out;
|
|
1732
2244
|
}
|
|
@@ -1760,8 +2272,8 @@ var BitmarkParserGenerator = class {
|
|
|
1760
2272
|
};
|
|
1761
2273
|
}
|
|
1762
2274
|
const inStr = this.maybeReadFile(input, inputFormat);
|
|
1763
|
-
const
|
|
1764
|
-
if (
|
|
2275
|
+
const wasm4 = getLegacyWasm();
|
|
2276
|
+
if (wasm4.is_bitmark(inStr)) return { source: inStr, isBitmark: true };
|
|
1765
2277
|
try {
|
|
1766
2278
|
const parsed = JSON.parse(inStr);
|
|
1767
2279
|
const entries = this.jsonEntries(parsed);
|
|
@@ -2130,8 +2642,8 @@ function bitNameToKey(name) {
|
|
|
2130
2642
|
var bitTypeCache;
|
|
2131
2643
|
function loadBitTypes() {
|
|
2132
2644
|
if (!bitTypeCache) {
|
|
2133
|
-
const
|
|
2134
|
-
const all = JSON.parse(
|
|
2645
|
+
const wasm4 = getLegacyWasm();
|
|
2646
|
+
const all = JSON.parse(wasm4.info("all", "json", "", false, 2, true, false, false, ""));
|
|
2135
2647
|
const map = { _standard: "_standard" };
|
|
2136
2648
|
for (const { name } of all) {
|
|
2137
2649
|
map[bitNameToKey(name)] = name;
|
|
@@ -2202,12 +2714,13 @@ var StreamWriter = stubClass("StreamWriter", INTERNAL_REASON);
|
|
|
2202
2714
|
function patchEntry(path, op, value) {
|
|
2203
2715
|
return value === void 0 ? { path, op } : { path, op, value };
|
|
2204
2716
|
}
|
|
2717
|
+
var ALL_LANGUAGES = "all";
|
|
2205
2718
|
|
|
2206
2719
|
// src/core/api.ts
|
|
2207
|
-
function
|
|
2208
|
-
const
|
|
2209
|
-
if (typeof
|
|
2210
|
-
return
|
|
2720
|
+
function lex3(input, options = {}) {
|
|
2721
|
+
const wasm4 = getActive();
|
|
2722
|
+
if (typeof wasm4.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
|
|
2723
|
+
return wasm4.lex(input, options.stage ?? "lex");
|
|
2211
2724
|
}
|
|
2212
2725
|
function bitmarkToObjects(input, options = {}) {
|
|
2213
2726
|
const out = getActive().convert(
|
|
@@ -2242,7 +2755,7 @@ function objectsToBitmark(bits, options = {}) {
|
|
|
2242
2755
|
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2243
2756
|
return out;
|
|
2244
2757
|
}
|
|
2245
|
-
function
|
|
2758
|
+
function convert4(input, options = {}) {
|
|
2246
2759
|
return getActive().convert(
|
|
2247
2760
|
input,
|
|
2248
2761
|
options.inputFormat ?? "auto",
|
|
@@ -2255,7 +2768,7 @@ function convert3(input, options = {}) {
|
|
|
2255
2768
|
options.mappingReport ?? false
|
|
2256
2769
|
);
|
|
2257
2770
|
}
|
|
2258
|
-
function
|
|
2771
|
+
function canonicalize4(input, options = {}) {
|
|
2259
2772
|
return getActive().canonicalize(
|
|
2260
2773
|
input,
|
|
2261
2774
|
options.inputFormat ?? "auto",
|
|
@@ -2273,13 +2786,13 @@ function countBits(input) {
|
|
|
2273
2786
|
function splitBits(input) {
|
|
2274
2787
|
return JSON.parse(getActive().split_bits(input));
|
|
2275
2788
|
}
|
|
2276
|
-
function
|
|
2277
|
-
const
|
|
2789
|
+
function transform4(input, options = {}) {
|
|
2790
|
+
const wasm4 = getActive();
|
|
2278
2791
|
if (options.preHook || options.postHook) {
|
|
2279
|
-
return runHookedTransform(
|
|
2792
|
+
return runHookedTransform(wasm4, input, options);
|
|
2280
2793
|
}
|
|
2281
2794
|
const patchJson = options.patch === void 0 ? "" : typeof options.patch === "string" ? options.patch : JSON.stringify(options.patch);
|
|
2282
|
-
return
|
|
2795
|
+
return wasm4.transform(
|
|
2283
2796
|
input,
|
|
2284
2797
|
options.inputFormat ?? "auto",
|
|
2285
2798
|
options.outputFormat ?? "json",
|
|
@@ -2300,7 +2813,7 @@ function unbreakscapeText(input, options = {}) {
|
|
|
2300
2813
|
const location = options.location ?? "body";
|
|
2301
2814
|
return getActive().unbreakscape_text(input, format, location);
|
|
2302
2815
|
}
|
|
2303
|
-
function
|
|
2816
|
+
function info4(options = {}) {
|
|
2304
2817
|
const infoType = options.infoType ?? "list";
|
|
2305
2818
|
const format = options.format ?? "text";
|
|
2306
2819
|
const bit = options.bit ?? "";
|
|
@@ -2309,10 +2822,27 @@ function info3(options = {}) {
|
|
|
2309
2822
|
const includeDeprecated = options.includeDeprecated ?? false;
|
|
2310
2823
|
const onlyDeprecated = options.onlyDeprecated ?? false;
|
|
2311
2824
|
const full = options.full ?? false;
|
|
2312
|
-
|
|
2825
|
+
const language = typeof options.language === "string" ? options.language : options.language?.join(",") ?? "";
|
|
2826
|
+
return getActive().info(
|
|
2827
|
+
infoType,
|
|
2828
|
+
format,
|
|
2829
|
+
bit,
|
|
2830
|
+
pretty,
|
|
2831
|
+
indent,
|
|
2832
|
+
includeDeprecated,
|
|
2833
|
+
onlyDeprecated,
|
|
2834
|
+
full,
|
|
2835
|
+
language
|
|
2836
|
+
);
|
|
2837
|
+
}
|
|
2838
|
+
function register4(options) {
|
|
2839
|
+
const result = getActive().register(options.type, options.data);
|
|
2840
|
+
if (result) throw new RegisterError(result.replace(/^error:\s*/, ""));
|
|
2841
|
+
rememberRegistration(options.type, options.data);
|
|
2313
2842
|
}
|
|
2314
2843
|
|
|
2315
2844
|
// src/browser/index.ts
|
|
2845
|
+
var WASM_BASE = true ? "../wasm/" : "./";
|
|
2316
2846
|
var VARIANTS = {
|
|
2317
2847
|
full: {
|
|
2318
2848
|
init: bitmark_wasm_default,
|
|
@@ -2320,20 +2850,33 @@ var VARIANTS = {
|
|
|
2320
2850
|
ns: bitmark_wasm_exports,
|
|
2321
2851
|
wasmFile: "bitmark_wasm_bg.wasm"
|
|
2322
2852
|
},
|
|
2853
|
+
"browser-full": {
|
|
2854
|
+
init: bitmark_browser_full_wasm_default,
|
|
2855
|
+
initSync: initSync2,
|
|
2856
|
+
ns: bitmark_browser_full_wasm_exports,
|
|
2857
|
+
wasmFile: "bitmark_browser_full_wasm_bg.wasm"
|
|
2858
|
+
},
|
|
2323
2859
|
"bitmark-json": {
|
|
2324
2860
|
init: bitmark_json_wasm_default,
|
|
2325
|
-
initSync:
|
|
2861
|
+
initSync: initSync3,
|
|
2326
2862
|
ns: bitmark_json_wasm_exports,
|
|
2327
2863
|
wasmFile: "bitmark_json_wasm_bg.wasm"
|
|
2328
2864
|
}
|
|
2329
2865
|
};
|
|
2330
2866
|
setLegacyWasmProvider(() => getActive());
|
|
2867
|
+
function defaultFeatureFor(module_or_path) {
|
|
2868
|
+
return module_or_path === void 0 ? BROWSER_DEFAULT_FEATURE : "full";
|
|
2869
|
+
}
|
|
2331
2870
|
function normalizeInit(arg) {
|
|
2332
2871
|
if (arg !== null && typeof arg === "object" && !(arg instanceof URL) && ("feature" in arg || "module_or_path" in arg)) {
|
|
2333
2872
|
const o = arg;
|
|
2334
|
-
return {
|
|
2873
|
+
return {
|
|
2874
|
+
feature: o.feature ?? defaultFeatureFor(o.module_or_path),
|
|
2875
|
+
module_or_path: o.module_or_path
|
|
2876
|
+
};
|
|
2335
2877
|
}
|
|
2336
|
-
|
|
2878
|
+
const module_or_path = arg ?? void 0;
|
|
2879
|
+
return { feature: defaultFeatureFor(module_or_path), module_or_path };
|
|
2337
2880
|
}
|
|
2338
2881
|
var initSeq = 0;
|
|
2339
2882
|
var activeOut;
|
|
@@ -2346,7 +2889,7 @@ async function init(options) {
|
|
|
2346
2889
|
}
|
|
2347
2890
|
const mySeq = ++initSeq;
|
|
2348
2891
|
const v = VARIANTS[feature];
|
|
2349
|
-
const source = module_or_path ?? new URL(`${v.wasmFile}?v=${PACKAGE_INFO.version}`, importMetaUrl);
|
|
2892
|
+
const source = module_or_path ?? new URL(`${WASM_BASE}${v.wasmFile}?v=${PACKAGE_INFO.version}`, importMetaUrl);
|
|
2350
2893
|
const promise = (async () => {
|
|
2351
2894
|
try {
|
|
2352
2895
|
const out = await v.init(source);
|
|
@@ -2364,8 +2907,8 @@ async function init(options) {
|
|
|
2364
2907
|
inflight = { feature, seq: mySeq, promise };
|
|
2365
2908
|
return promise;
|
|
2366
2909
|
}
|
|
2367
|
-
function
|
|
2368
|
-
const feature = options.feature ??
|
|
2910
|
+
function initSync4(module2, options = {}) {
|
|
2911
|
+
const feature = options.feature ?? defaultFeatureFor(module2);
|
|
2369
2912
|
const v = VARIANTS[feature];
|
|
2370
2913
|
const out = v.initSync(module2);
|
|
2371
2914
|
setActive(feature, v.ns);
|
|
@@ -2376,10 +2919,10 @@ function version() {
|
|
|
2376
2919
|
return PACKAGE_INFO.version;
|
|
2377
2920
|
}
|
|
2378
2921
|
function transformParallel(input, options = {}) {
|
|
2379
|
-
const
|
|
2380
|
-
const feature = variant() ??
|
|
2922
|
+
const wasm4 = getActive();
|
|
2923
|
+
const feature = variant() ?? BROWSER_DEFAULT_FEATURE;
|
|
2381
2924
|
return orchestrateParallel(
|
|
2382
|
-
|
|
2925
|
+
wasm4,
|
|
2383
2926
|
input,
|
|
2384
2927
|
options,
|
|
2385
2928
|
(jobs, workers) => runJobsParallel(jobs, workers, feature)
|
|
@@ -2387,7 +2930,9 @@ function transformParallel(input, options = {}) {
|
|
|
2387
2930
|
}
|
|
2388
2931
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2389
2932
|
0 && (module.exports = {
|
|
2933
|
+
ALL_LANGUAGES,
|
|
2390
2934
|
NotInitializedError,
|
|
2935
|
+
RegisterError,
|
|
2391
2936
|
UnsupportedFeatureError,
|
|
2392
2937
|
bitmarkToObjects,
|
|
2393
2938
|
breakscapeText,
|
|
@@ -2401,6 +2946,7 @@ function transformParallel(input, options = {}) {
|
|
|
2401
2946
|
lex,
|
|
2402
2947
|
objectsToBitmark,
|
|
2403
2948
|
patchEntry,
|
|
2949
|
+
register,
|
|
2404
2950
|
splitBits,
|
|
2405
2951
|
transform,
|
|
2406
2952
|
transformParallel,
|