@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
|
@@ -20,6 +20,7 @@ __export(bitmark_wasm_exports, {
|
|
|
20
20
|
is_bitmark: () => is_bitmark,
|
|
21
21
|
lex: () => lex,
|
|
22
22
|
prettify: () => prettify,
|
|
23
|
+
register: () => register,
|
|
23
24
|
split_bits: () => split_bits,
|
|
24
25
|
split_json_bits: () => split_json_bits,
|
|
25
26
|
transform: () => transform,
|
|
@@ -158,9 +159,9 @@ function unbreakscape_text(input, format, location) {
|
|
|
158
159
|
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
|
-
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
|
|
162
|
-
let
|
|
163
|
-
let
|
|
162
|
+
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
163
|
+
let deferred5_0;
|
|
164
|
+
let deferred5_1;
|
|
164
165
|
try {
|
|
165
166
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
166
167
|
const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -169,15 +170,41 @@ function info(info_type, format, bit, pretty, indent, include_deprecated, only_d
|
|
|
169
170
|
const len1 = WASM_VECTOR_LEN;
|
|
170
171
|
const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
171
172
|
const len2 = WASM_VECTOR_LEN;
|
|
172
|
-
|
|
173
|
+
const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
174
|
+
const len3 = WASM_VECTOR_LEN;
|
|
175
|
+
wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
173
176
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
174
177
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
deferred5_0 = r0;
|
|
179
|
+
deferred5_1 = r1;
|
|
177
180
|
return getStringFromWasm0(r0, r1);
|
|
178
181
|
} finally {
|
|
179
182
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
180
|
-
wasm.__wbindgen_export_2(
|
|
183
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function convert_text(input, direction, format, location) {
|
|
187
|
+
let deferred5_0;
|
|
188
|
+
let deferred5_1;
|
|
189
|
+
try {
|
|
190
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
191
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
192
|
+
const len0 = WASM_VECTOR_LEN;
|
|
193
|
+
const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
194
|
+
const len1 = WASM_VECTOR_LEN;
|
|
195
|
+
const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
196
|
+
const len2 = WASM_VECTOR_LEN;
|
|
197
|
+
const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
198
|
+
const len3 = WASM_VECTOR_LEN;
|
|
199
|
+
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
200
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
201
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
202
|
+
deferred5_0 = r0;
|
|
203
|
+
deferred5_1 = r1;
|
|
204
|
+
return getStringFromWasm0(r0, r1);
|
|
205
|
+
} finally {
|
|
206
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
207
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
181
208
|
}
|
|
182
209
|
}
|
|
183
210
|
function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
@@ -206,6 +233,26 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
|
|
|
206
233
|
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
207
234
|
}
|
|
208
235
|
}
|
|
236
|
+
function register(data_type, data) {
|
|
237
|
+
let deferred3_0;
|
|
238
|
+
let deferred3_1;
|
|
239
|
+
try {
|
|
240
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
241
|
+
const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
242
|
+
const len0 = WASM_VECTOR_LEN;
|
|
243
|
+
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
244
|
+
const len1 = WASM_VECTOR_LEN;
|
|
245
|
+
wasm.register(retptr, ptr0, len0, ptr1, len1);
|
|
246
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
247
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
248
|
+
deferred3_0 = r0;
|
|
249
|
+
deferred3_1 = r1;
|
|
250
|
+
return getStringFromWasm0(r0, r1);
|
|
251
|
+
} finally {
|
|
252
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
253
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
209
256
|
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
210
257
|
let deferred5_0;
|
|
211
258
|
let deferred5_1;
|
|
@@ -330,30 +377,6 @@ function prettify(json, indent) {
|
|
|
330
377
|
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
331
378
|
}
|
|
332
379
|
}
|
|
333
|
-
function convert_text(input, direction, format, location) {
|
|
334
|
-
let deferred5_0;
|
|
335
|
-
let deferred5_1;
|
|
336
|
-
try {
|
|
337
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
338
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
339
|
-
const len0 = WASM_VECTOR_LEN;
|
|
340
|
-
const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
341
|
-
const len1 = WASM_VECTOR_LEN;
|
|
342
|
-
const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
343
|
-
const len2 = WASM_VECTOR_LEN;
|
|
344
|
-
const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
345
|
-
const len3 = WASM_VECTOR_LEN;
|
|
346
|
-
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
347
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
348
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
349
|
-
deferred5_0 = r0;
|
|
350
|
-
deferred5_1 = r1;
|
|
351
|
-
return getStringFromWasm0(r0, r1);
|
|
352
|
-
} finally {
|
|
353
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
354
|
-
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
380
|
async function __wbg_load(module, imports) {
|
|
358
381
|
if (typeof Response === "function" && module instanceof Response) {
|
|
359
382
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
@@ -431,19 +454,21 @@ async function __wbg_init(module_or_path) {
|
|
|
431
454
|
}
|
|
432
455
|
var bitmark_wasm_default = __wbg_init;
|
|
433
456
|
|
|
434
|
-
// wasm-web-
|
|
435
|
-
var
|
|
436
|
-
__export(
|
|
457
|
+
// wasm-web-browser-full/bitmark_browser_full_wasm.js
|
|
458
|
+
var bitmark_browser_full_wasm_exports = {};
|
|
459
|
+
__export(bitmark_browser_full_wasm_exports, {
|
|
437
460
|
breakscape_text: () => breakscape_text2,
|
|
438
461
|
canonicalize: () => canonicalize2,
|
|
439
462
|
convert: () => convert2,
|
|
440
463
|
convert_text: () => convert_text2,
|
|
441
464
|
count_bits: () => count_bits2,
|
|
442
|
-
default: () =>
|
|
465
|
+
default: () => bitmark_browser_full_wasm_default,
|
|
443
466
|
info: () => info2,
|
|
444
467
|
initSync: () => initSync2,
|
|
445
468
|
is_bitmark: () => is_bitmark2,
|
|
469
|
+
lex: () => lex2,
|
|
446
470
|
prettify: () => prettify2,
|
|
471
|
+
register: () => register2,
|
|
447
472
|
split_bits: () => split_bits2,
|
|
448
473
|
split_json_bits: () => split_json_bits2,
|
|
449
474
|
transform: () => transform2,
|
|
@@ -518,6 +543,26 @@ function getStringFromWasm02(ptr, len) {
|
|
|
518
543
|
ptr = ptr >>> 0;
|
|
519
544
|
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
520
545
|
}
|
|
546
|
+
function lex2(input, stage) {
|
|
547
|
+
let deferred3_0;
|
|
548
|
+
let deferred3_1;
|
|
549
|
+
try {
|
|
550
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
551
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
552
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
553
|
+
const ptr1 = passStringToWasm02(stage, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
554
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
555
|
+
wasm2.lex(retptr, ptr0, len0, ptr1, len1);
|
|
556
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
557
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
558
|
+
deferred3_0 = r0;
|
|
559
|
+
deferred3_1 = r1;
|
|
560
|
+
return getStringFromWasm02(r0, r1);
|
|
561
|
+
} finally {
|
|
562
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
563
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
521
566
|
function breakscape_text2(input, format, location) {
|
|
522
567
|
let deferred4_0;
|
|
523
568
|
let deferred4_1;
|
|
@@ -562,9 +607,9 @@ function unbreakscape_text2(input, format, location) {
|
|
|
562
607
|
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
563
608
|
}
|
|
564
609
|
}
|
|
565
|
-
function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
|
|
566
|
-
let
|
|
567
|
-
let
|
|
610
|
+
function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
611
|
+
let deferred5_0;
|
|
612
|
+
let deferred5_1;
|
|
568
613
|
try {
|
|
569
614
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
570
615
|
const ptr0 = passStringToWasm02(info_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -573,15 +618,87 @@ function info2(info_type, format, bit, pretty, indent, include_deprecated, only_
|
|
|
573
618
|
const len1 = WASM_VECTOR_LEN2;
|
|
574
619
|
const ptr2 = passStringToWasm02(bit, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
575
620
|
const len2 = WASM_VECTOR_LEN2;
|
|
576
|
-
|
|
621
|
+
const ptr3 = passStringToWasm02(language, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
622
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
623
|
+
wasm2.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
577
624
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
578
625
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
579
|
-
|
|
580
|
-
|
|
626
|
+
deferred5_0 = r0;
|
|
627
|
+
deferred5_1 = r1;
|
|
581
628
|
return getStringFromWasm02(r0, r1);
|
|
582
629
|
} finally {
|
|
583
630
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
584
|
-
wasm2.__wbindgen_export_2(
|
|
631
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
function convert_text2(input, direction, format, location) {
|
|
635
|
+
let deferred5_0;
|
|
636
|
+
let deferred5_1;
|
|
637
|
+
try {
|
|
638
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
639
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
640
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
641
|
+
const ptr1 = passStringToWasm02(direction, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
642
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
643
|
+
const ptr2 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
644
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
645
|
+
const ptr3 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
646
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
647
|
+
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
648
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
649
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
650
|
+
deferred5_0 = r0;
|
|
651
|
+
deferred5_1 = r1;
|
|
652
|
+
return getStringFromWasm02(r0, r1);
|
|
653
|
+
} finally {
|
|
654
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
655
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
659
|
+
let deferred6_0;
|
|
660
|
+
let deferred6_1;
|
|
661
|
+
try {
|
|
662
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
663
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
664
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
665
|
+
const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
666
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
667
|
+
const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
668
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
669
|
+
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
670
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
671
|
+
const ptr4 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
672
|
+
const len4 = WASM_VECTOR_LEN2;
|
|
673
|
+
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
674
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
675
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
676
|
+
deferred6_0 = r0;
|
|
677
|
+
deferred6_1 = r1;
|
|
678
|
+
return getStringFromWasm02(r0, r1);
|
|
679
|
+
} finally {
|
|
680
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
681
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
function register2(data_type, data) {
|
|
685
|
+
let deferred3_0;
|
|
686
|
+
let deferred3_1;
|
|
687
|
+
try {
|
|
688
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
689
|
+
const ptr0 = passStringToWasm02(data_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
690
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
691
|
+
const ptr1 = passStringToWasm02(data, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
692
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
693
|
+
wasm2.register(retptr, ptr0, len0, ptr1, len1);
|
|
694
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
695
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
696
|
+
deferred3_0 = r0;
|
|
697
|
+
deferred3_1 = r1;
|
|
698
|
+
return getStringFromWasm02(r0, r1);
|
|
699
|
+
} finally {
|
|
700
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
701
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
585
702
|
}
|
|
586
703
|
}
|
|
587
704
|
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
@@ -708,56 +825,6 @@ function prettify2(json, indent) {
|
|
|
708
825
|
wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
709
826
|
}
|
|
710
827
|
}
|
|
711
|
-
function convert_text2(input, direction, format, location) {
|
|
712
|
-
let deferred5_0;
|
|
713
|
-
let deferred5_1;
|
|
714
|
-
try {
|
|
715
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
716
|
-
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
717
|
-
const len0 = WASM_VECTOR_LEN2;
|
|
718
|
-
const ptr1 = passStringToWasm02(direction, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
719
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
720
|
-
const ptr2 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
721
|
-
const len2 = WASM_VECTOR_LEN2;
|
|
722
|
-
const ptr3 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
723
|
-
const len3 = WASM_VECTOR_LEN2;
|
|
724
|
-
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
725
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
726
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
727
|
-
deferred5_0 = r0;
|
|
728
|
-
deferred5_1 = r1;
|
|
729
|
-
return getStringFromWasm02(r0, r1);
|
|
730
|
-
} finally {
|
|
731
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
732
|
-
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
736
|
-
let deferred6_0;
|
|
737
|
-
let deferred6_1;
|
|
738
|
-
try {
|
|
739
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
740
|
-
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
741
|
-
const len0 = WASM_VECTOR_LEN2;
|
|
742
|
-
const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
743
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
744
|
-
const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
745
|
-
const len2 = WASM_VECTOR_LEN2;
|
|
746
|
-
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
747
|
-
const len3 = WASM_VECTOR_LEN2;
|
|
748
|
-
const ptr4 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
749
|
-
const len4 = WASM_VECTOR_LEN2;
|
|
750
|
-
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
751
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
752
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
753
|
-
deferred6_0 = r0;
|
|
754
|
-
deferred6_1 = r1;
|
|
755
|
-
return getStringFromWasm02(r0, r1);
|
|
756
|
-
} finally {
|
|
757
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
758
|
-
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
828
|
async function __wbg_load2(module, imports) {
|
|
762
829
|
if (typeof Response === "function" && module instanceof Response) {
|
|
763
830
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
@@ -823,7 +890,7 @@ async function __wbg_init2(module_or_path) {
|
|
|
823
890
|
}
|
|
824
891
|
}
|
|
825
892
|
if (typeof module_or_path === "undefined") {
|
|
826
|
-
module_or_path = new URL("
|
|
893
|
+
module_or_path = new URL("bitmark_browser_full_wasm_bg.wasm", import.meta.url);
|
|
827
894
|
}
|
|
828
895
|
const imports = __wbg_get_imports2();
|
|
829
896
|
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
@@ -833,24 +900,458 @@ async function __wbg_init2(module_or_path) {
|
|
|
833
900
|
const { instance, module } = await __wbg_load2(await module_or_path, imports);
|
|
834
901
|
return __wbg_finalize_init2(instance, module);
|
|
835
902
|
}
|
|
836
|
-
var
|
|
903
|
+
var bitmark_browser_full_wasm_default = __wbg_init2;
|
|
904
|
+
|
|
905
|
+
// wasm-web-bitmark-json/bitmark_json_wasm.js
|
|
906
|
+
var bitmark_json_wasm_exports = {};
|
|
907
|
+
__export(bitmark_json_wasm_exports, {
|
|
908
|
+
breakscape_text: () => breakscape_text3,
|
|
909
|
+
canonicalize: () => canonicalize3,
|
|
910
|
+
convert: () => convert3,
|
|
911
|
+
convert_text: () => convert_text3,
|
|
912
|
+
count_bits: () => count_bits3,
|
|
913
|
+
default: () => bitmark_json_wasm_default,
|
|
914
|
+
info: () => info3,
|
|
915
|
+
initSync: () => initSync3,
|
|
916
|
+
is_bitmark: () => is_bitmark3,
|
|
917
|
+
prettify: () => prettify3,
|
|
918
|
+
register: () => register3,
|
|
919
|
+
split_bits: () => split_bits3,
|
|
920
|
+
split_json_bits: () => split_json_bits3,
|
|
921
|
+
transform: () => transform3,
|
|
922
|
+
unbreakscape_text: () => unbreakscape_text3
|
|
923
|
+
});
|
|
924
|
+
var wasm3;
|
|
925
|
+
var WASM_VECTOR_LEN3 = 0;
|
|
926
|
+
var cachedUint8ArrayMemory03 = null;
|
|
927
|
+
function getUint8ArrayMemory03() {
|
|
928
|
+
if (cachedUint8ArrayMemory03 === null || cachedUint8ArrayMemory03.byteLength === 0) {
|
|
929
|
+
cachedUint8ArrayMemory03 = new Uint8Array(wasm3.memory.buffer);
|
|
930
|
+
}
|
|
931
|
+
return cachedUint8ArrayMemory03;
|
|
932
|
+
}
|
|
933
|
+
var cachedTextEncoder3 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
934
|
+
throw Error("TextEncoder not available");
|
|
935
|
+
} };
|
|
936
|
+
var encodeString3 = typeof cachedTextEncoder3.encodeInto === "function" ? function(arg, view) {
|
|
937
|
+
return cachedTextEncoder3.encodeInto(arg, view);
|
|
938
|
+
} : function(arg, view) {
|
|
939
|
+
const buf = cachedTextEncoder3.encode(arg);
|
|
940
|
+
view.set(buf);
|
|
941
|
+
return {
|
|
942
|
+
read: arg.length,
|
|
943
|
+
written: buf.length
|
|
944
|
+
};
|
|
945
|
+
};
|
|
946
|
+
function passStringToWasm03(arg, malloc, realloc) {
|
|
947
|
+
if (realloc === void 0) {
|
|
948
|
+
const buf = cachedTextEncoder3.encode(arg);
|
|
949
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
950
|
+
getUint8ArrayMemory03().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
951
|
+
WASM_VECTOR_LEN3 = buf.length;
|
|
952
|
+
return ptr2;
|
|
953
|
+
}
|
|
954
|
+
let len = arg.length;
|
|
955
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
956
|
+
const mem = getUint8ArrayMemory03();
|
|
957
|
+
let offset = 0;
|
|
958
|
+
for (; offset < len; offset++) {
|
|
959
|
+
const code = arg.charCodeAt(offset);
|
|
960
|
+
if (code > 127) break;
|
|
961
|
+
mem[ptr + offset] = code;
|
|
962
|
+
}
|
|
963
|
+
if (offset !== len) {
|
|
964
|
+
if (offset !== 0) {
|
|
965
|
+
arg = arg.slice(offset);
|
|
966
|
+
}
|
|
967
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
968
|
+
const view = getUint8ArrayMemory03().subarray(ptr + offset, ptr + len);
|
|
969
|
+
const ret = encodeString3(arg, view);
|
|
970
|
+
offset += ret.written;
|
|
971
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
972
|
+
}
|
|
973
|
+
WASM_VECTOR_LEN3 = offset;
|
|
974
|
+
return ptr;
|
|
975
|
+
}
|
|
976
|
+
var cachedDataViewMemory03 = null;
|
|
977
|
+
function getDataViewMemory03() {
|
|
978
|
+
if (cachedDataViewMemory03 === null || cachedDataViewMemory03.buffer.detached === true || cachedDataViewMemory03.buffer.detached === void 0 && cachedDataViewMemory03.buffer !== wasm3.memory.buffer) {
|
|
979
|
+
cachedDataViewMemory03 = new DataView(wasm3.memory.buffer);
|
|
980
|
+
}
|
|
981
|
+
return cachedDataViewMemory03;
|
|
982
|
+
}
|
|
983
|
+
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
984
|
+
throw Error("TextDecoder not available");
|
|
985
|
+
} };
|
|
986
|
+
if (typeof TextDecoder !== "undefined") {
|
|
987
|
+
cachedTextDecoder3.decode();
|
|
988
|
+
}
|
|
989
|
+
function getStringFromWasm03(ptr, len) {
|
|
990
|
+
ptr = ptr >>> 0;
|
|
991
|
+
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
992
|
+
}
|
|
993
|
+
function breakscape_text3(input, format, location) {
|
|
994
|
+
let deferred4_0;
|
|
995
|
+
let deferred4_1;
|
|
996
|
+
try {
|
|
997
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
998
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
999
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1000
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1001
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1002
|
+
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1003
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1004
|
+
wasm3.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1005
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1006
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1007
|
+
deferred4_0 = r0;
|
|
1008
|
+
deferred4_1 = r1;
|
|
1009
|
+
return getStringFromWasm03(r0, r1);
|
|
1010
|
+
} finally {
|
|
1011
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1012
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
function unbreakscape_text3(input, format, location) {
|
|
1016
|
+
let deferred4_0;
|
|
1017
|
+
let deferred4_1;
|
|
1018
|
+
try {
|
|
1019
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1020
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1021
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1022
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1023
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1024
|
+
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1025
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1026
|
+
wasm3.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1027
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1028
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1029
|
+
deferred4_0 = r0;
|
|
1030
|
+
deferred4_1 = r1;
|
|
1031
|
+
return getStringFromWasm03(r0, r1);
|
|
1032
|
+
} finally {
|
|
1033
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1034
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
function info3(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
1038
|
+
let deferred5_0;
|
|
1039
|
+
let deferred5_1;
|
|
1040
|
+
try {
|
|
1041
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1042
|
+
const ptr0 = passStringToWasm03(info_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1043
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1044
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1045
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1046
|
+
const ptr2 = passStringToWasm03(bit, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1047
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1048
|
+
const ptr3 = passStringToWasm03(language, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1049
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1050
|
+
wasm3.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
1051
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1052
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1053
|
+
deferred5_0 = r0;
|
|
1054
|
+
deferred5_1 = r1;
|
|
1055
|
+
return getStringFromWasm03(r0, r1);
|
|
1056
|
+
} finally {
|
|
1057
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1058
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
function register3(data_type, data) {
|
|
1062
|
+
let deferred3_0;
|
|
1063
|
+
let deferred3_1;
|
|
1064
|
+
try {
|
|
1065
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1066
|
+
const ptr0 = passStringToWasm03(data_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1067
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1068
|
+
const ptr1 = passStringToWasm03(data, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1069
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1070
|
+
wasm3.register(retptr, ptr0, len0, ptr1, len1);
|
|
1071
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1072
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1073
|
+
deferred3_0 = r0;
|
|
1074
|
+
deferred3_1 = r1;
|
|
1075
|
+
return getStringFromWasm03(r0, r1);
|
|
1076
|
+
} finally {
|
|
1077
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1078
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
function transform3(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
1082
|
+
let deferred6_0;
|
|
1083
|
+
let deferred6_1;
|
|
1084
|
+
try {
|
|
1085
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1086
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1087
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1088
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1089
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1090
|
+
const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1091
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1092
|
+
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1093
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1094
|
+
const ptr4 = passStringToWasm03(patch_json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1095
|
+
const len4 = WASM_VECTOR_LEN3;
|
|
1096
|
+
wasm3.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
1097
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1098
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1099
|
+
deferred6_0 = r0;
|
|
1100
|
+
deferred6_1 = r1;
|
|
1101
|
+
return getStringFromWasm03(r0, r1);
|
|
1102
|
+
} finally {
|
|
1103
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1104
|
+
wasm3.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
1108
|
+
let deferred5_0;
|
|
1109
|
+
let deferred5_1;
|
|
1110
|
+
try {
|
|
1111
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1112
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1113
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1114
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1115
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1116
|
+
const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1117
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1118
|
+
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1119
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1120
|
+
wasm3.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
|
|
1121
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1122
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1123
|
+
deferred5_0 = r0;
|
|
1124
|
+
deferred5_1 = r1;
|
|
1125
|
+
return getStringFromWasm03(r0, r1);
|
|
1126
|
+
} finally {
|
|
1127
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1128
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
1132
|
+
let deferred4_0;
|
|
1133
|
+
let deferred4_1;
|
|
1134
|
+
try {
|
|
1135
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1136
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1137
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1138
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1139
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1140
|
+
const ptr2 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1141
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1142
|
+
wasm3.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
1143
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1144
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1145
|
+
deferred4_0 = r0;
|
|
1146
|
+
deferred4_1 = r1;
|
|
1147
|
+
return getStringFromWasm03(r0, r1);
|
|
1148
|
+
} finally {
|
|
1149
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1150
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
function count_bits3(input) {
|
|
1154
|
+
let deferred2_0;
|
|
1155
|
+
let deferred2_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
|
+
wasm3.count_bits(retptr, ptr0, len0);
|
|
1161
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1162
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1163
|
+
deferred2_0 = r0;
|
|
1164
|
+
deferred2_1 = r1;
|
|
1165
|
+
return getStringFromWasm03(r0, r1);
|
|
1166
|
+
} finally {
|
|
1167
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1168
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
function split_bits3(input) {
|
|
1172
|
+
let deferred2_0;
|
|
1173
|
+
let deferred2_1;
|
|
1174
|
+
try {
|
|
1175
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1176
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1177
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1178
|
+
wasm3.split_bits(retptr, ptr0, len0);
|
|
1179
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1180
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1181
|
+
deferred2_0 = r0;
|
|
1182
|
+
deferred2_1 = r1;
|
|
1183
|
+
return getStringFromWasm03(r0, r1);
|
|
1184
|
+
} finally {
|
|
1185
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1186
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
function is_bitmark3(input) {
|
|
1190
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1191
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1192
|
+
const ret = wasm3.is_bitmark(ptr0, len0);
|
|
1193
|
+
return ret !== 0;
|
|
1194
|
+
}
|
|
1195
|
+
function split_json_bits3(input) {
|
|
1196
|
+
let deferred2_0;
|
|
1197
|
+
let deferred2_1;
|
|
1198
|
+
try {
|
|
1199
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1200
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1201
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1202
|
+
wasm3.split_json_bits(retptr, ptr0, len0);
|
|
1203
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1204
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1205
|
+
deferred2_0 = r0;
|
|
1206
|
+
deferred2_1 = r1;
|
|
1207
|
+
return getStringFromWasm03(r0, r1);
|
|
1208
|
+
} finally {
|
|
1209
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1210
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
function prettify3(json, indent) {
|
|
1214
|
+
let deferred2_0;
|
|
1215
|
+
let deferred2_1;
|
|
1216
|
+
try {
|
|
1217
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1218
|
+
const ptr0 = passStringToWasm03(json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1219
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1220
|
+
wasm3.prettify(retptr, ptr0, len0, indent);
|
|
1221
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1222
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1223
|
+
deferred2_0 = r0;
|
|
1224
|
+
deferred2_1 = r1;
|
|
1225
|
+
return getStringFromWasm03(r0, r1);
|
|
1226
|
+
} finally {
|
|
1227
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1228
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
function convert_text3(input, direction, format, location) {
|
|
1232
|
+
let deferred5_0;
|
|
1233
|
+
let deferred5_1;
|
|
1234
|
+
try {
|
|
1235
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1236
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1237
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1238
|
+
const ptr1 = passStringToWasm03(direction, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1239
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1240
|
+
const ptr2 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1241
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1242
|
+
const ptr3 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1243
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1244
|
+
wasm3.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1245
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1246
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1247
|
+
deferred5_0 = r0;
|
|
1248
|
+
deferred5_1 = r1;
|
|
1249
|
+
return getStringFromWasm03(r0, r1);
|
|
1250
|
+
} finally {
|
|
1251
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1252
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
async function __wbg_load3(module, imports) {
|
|
1256
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
1257
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
1258
|
+
try {
|
|
1259
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1260
|
+
} catch (e) {
|
|
1261
|
+
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
1262
|
+
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);
|
|
1263
|
+
} else {
|
|
1264
|
+
throw e;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
const bytes = await module.arrayBuffer();
|
|
1269
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1270
|
+
} else {
|
|
1271
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1272
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1273
|
+
return { instance, module };
|
|
1274
|
+
} else {
|
|
1275
|
+
return instance;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
function __wbg_get_imports3() {
|
|
1280
|
+
const imports = {};
|
|
1281
|
+
imports.wbg = {};
|
|
1282
|
+
return imports;
|
|
1283
|
+
}
|
|
1284
|
+
function __wbg_init_memory3(imports, memory) {
|
|
1285
|
+
}
|
|
1286
|
+
function __wbg_finalize_init3(instance, module) {
|
|
1287
|
+
wasm3 = instance.exports;
|
|
1288
|
+
__wbg_init3.__wbindgen_wasm_module = module;
|
|
1289
|
+
cachedDataViewMemory03 = null;
|
|
1290
|
+
cachedUint8ArrayMemory03 = null;
|
|
1291
|
+
return wasm3;
|
|
1292
|
+
}
|
|
1293
|
+
function initSync3(module) {
|
|
1294
|
+
if (wasm3 !== void 0) return wasm3;
|
|
1295
|
+
if (typeof module !== "undefined") {
|
|
1296
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1297
|
+
({ module } = module);
|
|
1298
|
+
} else {
|
|
1299
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
const imports = __wbg_get_imports3();
|
|
1303
|
+
__wbg_init_memory3(imports);
|
|
1304
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1305
|
+
module = new WebAssembly.Module(module);
|
|
1306
|
+
}
|
|
1307
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1308
|
+
return __wbg_finalize_init3(instance, module);
|
|
1309
|
+
}
|
|
1310
|
+
async function __wbg_init3(module_or_path) {
|
|
1311
|
+
if (wasm3 !== void 0) return wasm3;
|
|
1312
|
+
if (typeof module_or_path !== "undefined") {
|
|
1313
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1314
|
+
({ module_or_path } = module_or_path);
|
|
1315
|
+
} else {
|
|
1316
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
if (typeof module_or_path === "undefined") {
|
|
1320
|
+
module_or_path = new URL("bitmark_json_wasm_bg.wasm", import.meta.url);
|
|
1321
|
+
}
|
|
1322
|
+
const imports = __wbg_get_imports3();
|
|
1323
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
1324
|
+
module_or_path = fetch(module_or_path);
|
|
1325
|
+
}
|
|
1326
|
+
__wbg_init_memory3(imports);
|
|
1327
|
+
const { instance, module } = await __wbg_load3(await module_or_path, imports);
|
|
1328
|
+
return __wbg_finalize_init3(instance, module);
|
|
1329
|
+
}
|
|
1330
|
+
var bitmark_json_wasm_default = __wbg_init3;
|
|
837
1331
|
|
|
838
1332
|
// src/generated/package_info.ts
|
|
839
1333
|
var PACKAGE_INFO = {
|
|
840
1334
|
"name": "@gmb/bitmark-parser",
|
|
841
|
-
"version": "6.
|
|
1335
|
+
"version": "6.11.0",
|
|
842
1336
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
843
1337
|
"license": "ISC",
|
|
844
1338
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
845
1339
|
};
|
|
846
1340
|
|
|
847
1341
|
// src/core/facade.ts
|
|
1342
|
+
var BROWSER_DEFAULT_FEATURE = "browser-full";
|
|
848
1343
|
var NotInitializedError = class extends Error {
|
|
849
1344
|
constructor() {
|
|
850
1345
|
super("wasm not initialised: call init() (or init({ feature: \u2026 })) first");
|
|
851
1346
|
this.name = "NotInitializedError";
|
|
852
1347
|
}
|
|
853
1348
|
};
|
|
1349
|
+
var RegisterError = class extends Error {
|
|
1350
|
+
constructor(message) {
|
|
1351
|
+
super(message);
|
|
1352
|
+
this.name = "RegisterError";
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
854
1355
|
var UnsupportedFeatureError = class extends Error {
|
|
855
1356
|
constructor(what, active2) {
|
|
856
1357
|
super(
|
|
@@ -862,15 +1363,23 @@ var UnsupportedFeatureError = class extends Error {
|
|
|
862
1363
|
var active;
|
|
863
1364
|
var activeFeature;
|
|
864
1365
|
var lazyLoader;
|
|
1366
|
+
var registrations = /* @__PURE__ */ new Map();
|
|
865
1367
|
function getActive() {
|
|
866
1368
|
if (!active && lazyLoader) lazyLoader();
|
|
867
1369
|
if (!active) throw new NotInitializedError();
|
|
868
1370
|
return active;
|
|
869
1371
|
}
|
|
870
1372
|
function setActive(feature, module) {
|
|
1373
|
+
for (const [type, data] of registrations) {
|
|
1374
|
+
const error = module.register(type, data);
|
|
1375
|
+
if (error) throw new RegisterError(error.replace(/^error:\s*/, ""));
|
|
1376
|
+
}
|
|
871
1377
|
active = module;
|
|
872
1378
|
activeFeature = feature;
|
|
873
1379
|
}
|
|
1380
|
+
function rememberRegistration(type, data) {
|
|
1381
|
+
registrations.set(type, data);
|
|
1382
|
+
}
|
|
874
1383
|
function variant() {
|
|
875
1384
|
return activeFeature;
|
|
876
1385
|
}
|
|
@@ -895,9 +1404,9 @@ function normalisePatch(patch) {
|
|
|
895
1404
|
}
|
|
896
1405
|
return patch;
|
|
897
1406
|
}
|
|
898
|
-
function buildUnits(
|
|
1407
|
+
function buildUnits(wasm4, input, inputIsBitmark) {
|
|
899
1408
|
if (inputIsBitmark) {
|
|
900
|
-
const out2 =
|
|
1409
|
+
const out2 = wasm4.split_bits(input);
|
|
901
1410
|
if (isError(out2)) throw new Error(out2);
|
|
902
1411
|
const slices = JSON.parse(out2);
|
|
903
1412
|
return slices.map((s) => ({
|
|
@@ -905,7 +1414,7 @@ function buildUnits(wasm3, input, inputIsBitmark) {
|
|
|
905
1414
|
source: s.source
|
|
906
1415
|
}));
|
|
907
1416
|
}
|
|
908
|
-
const out =
|
|
1417
|
+
const out = wasm4.split_json_bits(input);
|
|
909
1418
|
if (isError(out)) throw new Error(out);
|
|
910
1419
|
const envelopes = JSON.parse(out);
|
|
911
1420
|
return envelopes.map((env, index) => ({
|
|
@@ -914,17 +1423,17 @@ function buildUnits(wasm3, input, inputIsBitmark) {
|
|
|
914
1423
|
source: JSON.stringify([env])
|
|
915
1424
|
}));
|
|
916
1425
|
}
|
|
917
|
-
function planTransform(
|
|
1426
|
+
function planTransform(wasm4, input, options) {
|
|
918
1427
|
const mode = options.mode ?? "optimized";
|
|
919
1428
|
const output = options.outputFormat ?? "json";
|
|
920
1429
|
const spacesAroundValues = options.spacesAroundValues ?? 1;
|
|
921
1430
|
const indent = options.indent ?? 2;
|
|
922
1431
|
const pretty = options.pretty ?? false;
|
|
923
1432
|
const sel = options.inputFormat ?? "auto";
|
|
924
|
-
const inputIsBitmark = sel === "bitmark" || sel !== "json" &&
|
|
1433
|
+
const inputIsBitmark = sel === "bitmark" || sel !== "json" && wasm4.is_bitmark(input);
|
|
925
1434
|
const inputFormat = inputIsBitmark ? "bitmark" : "json";
|
|
926
1435
|
const staticPatch = normalisePatch(options.patch);
|
|
927
|
-
const units = buildUnits(
|
|
1436
|
+
const units = buildUnits(wasm4, input, inputIsBitmark);
|
|
928
1437
|
const total = units.length;
|
|
929
1438
|
const jobs = [];
|
|
930
1439
|
const views = [];
|
|
@@ -948,8 +1457,8 @@ function planTransform(wasm3, input, options) {
|
|
|
948
1457
|
}
|
|
949
1458
|
return { jobs, views, output, pretty, indent };
|
|
950
1459
|
}
|
|
951
|
-
function computeBit(
|
|
952
|
-
const out =
|
|
1460
|
+
function computeBit(wasm4, job) {
|
|
1461
|
+
const out = wasm4.transform(
|
|
953
1462
|
job.source,
|
|
954
1463
|
job.inputFormat,
|
|
955
1464
|
job.outputFormat,
|
|
@@ -962,33 +1471,33 @@ function computeBit(wasm3, job) {
|
|
|
962
1471
|
if (isError(out)) return out;
|
|
963
1472
|
return job.outputFormat === "json" ? stripArray(out) : out;
|
|
964
1473
|
}
|
|
965
|
-
function recombine(
|
|
1474
|
+
function recombine(wasm4, elements, output, pretty, indent) {
|
|
966
1475
|
if (output === "bitmark" || output === "text") return elements.join("\n");
|
|
967
1476
|
const arr = `[${elements.join(",")}]`;
|
|
968
|
-
return pretty ?
|
|
1477
|
+
return pretty ? wasm4.prettify(arr, indent) : arr;
|
|
969
1478
|
}
|
|
970
|
-
function runHookedTransform(
|
|
1479
|
+
function runHookedTransform(wasm4, input, options) {
|
|
971
1480
|
let plan;
|
|
972
1481
|
try {
|
|
973
|
-
plan = planTransform(
|
|
1482
|
+
plan = planTransform(wasm4, input, options);
|
|
974
1483
|
} catch (e) {
|
|
975
1484
|
return errorString(e);
|
|
976
1485
|
}
|
|
977
1486
|
const rendered = [];
|
|
978
1487
|
for (let i = 0; i < plan.jobs.length; i++) {
|
|
979
|
-
const element = computeBit(
|
|
1488
|
+
const element = computeBit(wasm4, plan.jobs[i]);
|
|
980
1489
|
if (isError(element)) return element;
|
|
981
1490
|
options.postHook?.(plan.views[i], element);
|
|
982
1491
|
rendered.push(element);
|
|
983
1492
|
}
|
|
984
|
-
return recombine(
|
|
1493
|
+
return recombine(wasm4, rendered, plan.output, plan.pretty, plan.indent);
|
|
985
1494
|
}
|
|
986
1495
|
|
|
987
1496
|
// src/core/parallel.ts
|
|
988
|
-
async function orchestrateParallel(
|
|
1497
|
+
async function orchestrateParallel(wasm4, input, options, runJobs) {
|
|
989
1498
|
let plan;
|
|
990
1499
|
try {
|
|
991
|
-
plan = planTransform(
|
|
1500
|
+
plan = planTransform(wasm4, input, options);
|
|
992
1501
|
} catch (e) {
|
|
993
1502
|
return errorString(e);
|
|
994
1503
|
}
|
|
@@ -1002,7 +1511,7 @@ async function orchestrateParallel(wasm3, input, options, runJobs) {
|
|
|
1002
1511
|
if (isError(elements[i])) return elements[i];
|
|
1003
1512
|
options.postHook?.(plan.views[i], elements[i]);
|
|
1004
1513
|
}
|
|
1005
|
-
return recombine(
|
|
1514
|
+
return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
|
|
1006
1515
|
}
|
|
1007
1516
|
|
|
1008
1517
|
// src/legacy/runtime.ts
|
|
@@ -1149,9 +1658,9 @@ function validateJsonOptions(o) {
|
|
|
1149
1658
|
if (o.textAsPlainText) unsupportedOption("jsonOptions.textAsPlainText", V3_ONLY);
|
|
1150
1659
|
if (o.debugGenerationInline) unsupportedOption("jsonOptions.debugGenerationInline");
|
|
1151
1660
|
}
|
|
1152
|
-
function prettyIndent(
|
|
1153
|
-
if (
|
|
1154
|
-
if (typeof
|
|
1661
|
+
function prettyIndent(prettify4) {
|
|
1662
|
+
if (prettify4 === true) return { pretty: true, indent: 2 };
|
|
1663
|
+
if (typeof prettify4 === "number" && prettify4 > 0) return { pretty: true, indent: prettify4 };
|
|
1155
1664
|
return { pretty: false, indent: 2 };
|
|
1156
1665
|
}
|
|
1157
1666
|
function spacesAround(v) {
|
|
@@ -1251,7 +1760,7 @@ var Builder = class {
|
|
|
1251
1760
|
* more than one resource, use the first one").
|
|
1252
1761
|
*/
|
|
1253
1762
|
buildBit(data, _options) {
|
|
1254
|
-
const
|
|
1763
|
+
const wasm4 = getLegacyWasm();
|
|
1255
1764
|
const src = { ...data };
|
|
1256
1765
|
const bitType = src.bitType;
|
|
1257
1766
|
const bitConfig = this.getBitConfig(bitType);
|
|
@@ -1312,7 +1821,7 @@ var Builder = class {
|
|
|
1312
1821
|
}
|
|
1313
1822
|
}
|
|
1314
1823
|
this.parseStringTexts(bit);
|
|
1315
|
-
const out =
|
|
1824
|
+
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
|
|
1316
1825
|
if (out.startsWith("error:")) {
|
|
1317
1826
|
throw new Error(out.slice("error:".length).trim());
|
|
1318
1827
|
}
|
|
@@ -1368,10 +1877,10 @@ var Builder = class {
|
|
|
1368
1877
|
* (bpg TextParser.toAst ignores format; only location matters).
|
|
1369
1878
|
*/
|
|
1370
1879
|
parseStringTexts(bit) {
|
|
1371
|
-
const
|
|
1880
|
+
const wasm4 = getLegacyWasm();
|
|
1372
1881
|
const toAst = (s, location) => {
|
|
1373
1882
|
if (s === "") return s;
|
|
1374
|
-
const out =
|
|
1883
|
+
const out = wasm4.convert_text(s, "textToAst", "bitmark++", location);
|
|
1375
1884
|
try {
|
|
1376
1885
|
return JSON.parse(out);
|
|
1377
1886
|
} catch {
|
|
@@ -1401,11 +1910,11 @@ var Builder = class {
|
|
|
1401
1910
|
* unknown-bit-type error (`Config.getBitConfig` parity).
|
|
1402
1911
|
*/
|
|
1403
1912
|
getBitConfig(bitType) {
|
|
1404
|
-
const
|
|
1913
|
+
const wasm4 = getLegacyWasm();
|
|
1405
1914
|
if (bitType !== void 0) {
|
|
1406
1915
|
try {
|
|
1407
|
-
const
|
|
1408
|
-
if (
|
|
1916
|
+
const info5 = JSON.parse(wasm4.info("bit", "json", bitType, false, 2, false, false, true, ""));
|
|
1917
|
+
if (info5.error === void 0) return { bodyFormat: info5.body?.format };
|
|
1409
1918
|
} catch {
|
|
1410
1919
|
}
|
|
1411
1920
|
}
|
|
@@ -1444,7 +1953,7 @@ var BitmarkParserGenerator = class {
|
|
|
1444
1953
|
validateBitmarkOptions(bitmarkOptions);
|
|
1445
1954
|
validateJsonOptions(jsonOptions);
|
|
1446
1955
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1447
|
-
const
|
|
1956
|
+
const wasm4 = getLegacyWasm();
|
|
1448
1957
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1449
1958
|
const outputFormat = opts.outputFormat ?? (isBitmark ? "json" : "bitmark");
|
|
1450
1959
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
@@ -1452,7 +1961,7 @@ var BitmarkParserGenerator = class {
|
|
|
1452
1961
|
const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
|
|
1453
1962
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1454
1963
|
const includeUnknown = !jsonOptions.excludeUnknownProperties;
|
|
1455
|
-
const out =
|
|
1964
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
|
|
1456
1965
|
this.throwOnError(out);
|
|
1457
1966
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1458
1967
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1480,13 +1989,13 @@ var BitmarkParserGenerator = class {
|
|
|
1480
1989
|
validateBitmarkOptions(bitmarkOptions);
|
|
1481
1990
|
validateJsonOptions(jsonOptions);
|
|
1482
1991
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1483
|
-
const
|
|
1992
|
+
const wasm4 = getLegacyWasm();
|
|
1484
1993
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1485
1994
|
const { pretty, indent } = prettyIndent(
|
|
1486
1995
|
isBitmark ? bitmarkOptions.prettifyJson : jsonOptions.prettify
|
|
1487
1996
|
);
|
|
1488
1997
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1489
|
-
const out =
|
|
1998
|
+
const out = wasm4.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
|
|
1490
1999
|
this.throwOnError(out);
|
|
1491
2000
|
if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
1492
2001
|
if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1498,12 +2007,12 @@ var BitmarkParserGenerator = class {
|
|
|
1498
2007
|
*/
|
|
1499
2008
|
info(options) {
|
|
1500
2009
|
const opts = Object.assign({}, options);
|
|
1501
|
-
const
|
|
2010
|
+
const wasm4 = getLegacyWasm();
|
|
1502
2011
|
const type = opts.type ?? "list";
|
|
1503
2012
|
const format = opts.outputFormat ?? "text";
|
|
1504
2013
|
const { pretty, indent } = prettyIndent(opts.prettify);
|
|
1505
2014
|
const coreFormat = format === "pojo" ? "json" : format;
|
|
1506
|
-
const out =
|
|
2015
|
+
const out = wasm4.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true, "");
|
|
1507
2016
|
this.throwOnError(out);
|
|
1508
2017
|
if (format === "pojo") return JSON.parse(out);
|
|
1509
2018
|
return out;
|
|
@@ -1531,12 +2040,12 @@ var BitmarkParserGenerator = class {
|
|
|
1531
2040
|
if (opts.keepUnknownTags) unsupportedOption("keepUnknownTags");
|
|
1532
2041
|
if (opts.noBreakscaping) unsupportedOption("noBreakscaping");
|
|
1533
2042
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1534
|
-
const
|
|
2043
|
+
const wasm4 = getLegacyWasm();
|
|
1535
2044
|
const inStr = typeof input === "string" ? this.maybeReadFile(input, void 0) : "";
|
|
1536
2045
|
const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
|
|
1537
2046
|
if (!isHtmlInput) {
|
|
1538
2047
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1539
|
-
const out2 =
|
|
2048
|
+
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
|
|
1540
2049
|
this.throwOnError(out2);
|
|
1541
2050
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1542
2051
|
}
|
|
@@ -1546,12 +2055,12 @@ var BitmarkParserGenerator = class {
|
|
|
1546
2055
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
1547
2056
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1548
2057
|
if (outputFormat === "html") {
|
|
1549
|
-
const out2 =
|
|
2058
|
+
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
|
|
1550
2059
|
this.throwOnError(out2);
|
|
1551
2060
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1552
2061
|
}
|
|
1553
2062
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
1554
|
-
const out =
|
|
2063
|
+
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
|
|
1555
2064
|
this.throwOnError(out);
|
|
1556
2065
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1557
2066
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1574,9 +2083,9 @@ var BitmarkParserGenerator = class {
|
|
|
1574
2083
|
*/
|
|
1575
2084
|
createAst(input, options) {
|
|
1576
2085
|
const opts = Object.assign({}, options);
|
|
1577
|
-
const
|
|
2086
|
+
const wasm4 = getLegacyWasm();
|
|
1578
2087
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1579
|
-
const out =
|
|
2088
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
|
|
1580
2089
|
this.throwOnError(out);
|
|
1581
2090
|
return makePseudoAst(JSON.parse(out));
|
|
1582
2091
|
}
|
|
@@ -1587,9 +2096,9 @@ var BitmarkParserGenerator = class {
|
|
|
1587
2096
|
if (!input) return input;
|
|
1588
2097
|
const opts = Object.assign({}, options);
|
|
1589
2098
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1590
|
-
const
|
|
2099
|
+
const wasm4 = getLegacyWasm();
|
|
1591
2100
|
const inStr = this.maybeReadFile(input, opts.inputFormat);
|
|
1592
|
-
const res =
|
|
2101
|
+
const res = wasm4.breakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
|
|
1593
2102
|
return this.deliver(res, opts.outputFile, opts.fileOptions);
|
|
1594
2103
|
}
|
|
1595
2104
|
/**
|
|
@@ -1599,9 +2108,9 @@ var BitmarkParserGenerator = class {
|
|
|
1599
2108
|
if (!input) return input;
|
|
1600
2109
|
const opts = Object.assign({}, options);
|
|
1601
2110
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1602
|
-
const
|
|
2111
|
+
const wasm4 = getLegacyWasm();
|
|
1603
2112
|
const inStr = this.maybeReadFile(input, opts.inputFormat);
|
|
1604
|
-
const res =
|
|
2113
|
+
const res = wasm4.unbreakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
|
|
1605
2114
|
return this.deliver(res, opts.outputFile, opts.fileOptions);
|
|
1606
2115
|
}
|
|
1607
2116
|
/**
|
|
@@ -1615,7 +2124,7 @@ var BitmarkParserGenerator = class {
|
|
|
1615
2124
|
const opts = Object.assign({}, options);
|
|
1616
2125
|
const jsonOptions = Object.assign({}, opts.jsonOptions);
|
|
1617
2126
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1618
|
-
const
|
|
2127
|
+
const wasm4 = getLegacyWasm();
|
|
1619
2128
|
const isBitmarkText = opts.textFormat === void 0 || mapTextFormat(opts.textFormat) === "bitmark++";
|
|
1620
2129
|
const textLocation = opts.textLocation ?? "body";
|
|
1621
2130
|
let inStr;
|
|
@@ -1628,14 +2137,14 @@ var BitmarkParserGenerator = class {
|
|
|
1628
2137
|
ast = Array.isArray(input) ? input : void 0;
|
|
1629
2138
|
}
|
|
1630
2139
|
if (ast !== void 0) {
|
|
1631
|
-
const out2 = isBitmarkText ?
|
|
2140
|
+
const out2 = isBitmarkText ? wasm4.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm4.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
|
|
1632
2141
|
this.throwOnError(out2);
|
|
1633
2142
|
return this.deliver(out2, opts.outputFile, opts.fileOptions);
|
|
1634
2143
|
}
|
|
1635
|
-
const out =
|
|
2144
|
+
const out = wasm4.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
|
|
1636
2145
|
this.throwOnError(out);
|
|
1637
2146
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
1638
|
-
const outStr = pretty ?
|
|
2147
|
+
const outStr = pretty ? wasm4.prettify(out, indent) : out;
|
|
1639
2148
|
if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);
|
|
1640
2149
|
if (pretty) return outStr;
|
|
1641
2150
|
return JSON.parse(out);
|
|
@@ -1644,8 +2153,8 @@ var BitmarkParserGenerator = class {
|
|
|
1644
2153
|
* Convert a text AST to plain text (bpg-compatible `textAstToPlainText`).
|
|
1645
2154
|
*/
|
|
1646
2155
|
textAstToPlainText(textAst, _options) {
|
|
1647
|
-
const
|
|
1648
|
-
const out =
|
|
2156
|
+
const wasm4 = getLegacyWasm();
|
|
2157
|
+
const out = wasm4.convert_text(
|
|
1649
2158
|
typeof textAst === "string" ? textAst : JSON.stringify(textAst),
|
|
1650
2159
|
"astToPlainText",
|
|
1651
2160
|
"bitmark++",
|
|
@@ -1659,17 +2168,17 @@ var BitmarkParserGenerator = class {
|
|
|
1659
2168
|
*/
|
|
1660
2169
|
extractPlainText(input, options) {
|
|
1661
2170
|
const inputFormat = options?.inputFormat;
|
|
1662
|
-
const
|
|
2171
|
+
const wasm4 = getLegacyWasm();
|
|
1663
2172
|
if (inputFormat === "plainText") {
|
|
1664
2173
|
return typeof input === "string" ? String(input) : "";
|
|
1665
2174
|
}
|
|
1666
2175
|
if (inputFormat === "bitmarkText") {
|
|
1667
|
-
const ast =
|
|
1668
|
-
const out2 =
|
|
2176
|
+
const ast = wasm4.convert_text(String(input), "textToAst", "bitmark++", "body");
|
|
2177
|
+
const out2 = wasm4.convert_text(ast, "astToPlainText", "bitmark++", "body");
|
|
1669
2178
|
this.throwOnError(out2);
|
|
1670
2179
|
return out2;
|
|
1671
2180
|
}
|
|
1672
|
-
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !
|
|
2181
|
+
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm4.is_bitmark(input)) {
|
|
1673
2182
|
const looksJson = (() => {
|
|
1674
2183
|
try {
|
|
1675
2184
|
JSON.parse(input);
|
|
@@ -1683,7 +2192,7 @@ var BitmarkParserGenerator = class {
|
|
|
1683
2192
|
}
|
|
1684
2193
|
}
|
|
1685
2194
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1686
|
-
const out =
|
|
2195
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
|
|
1687
2196
|
this.throwOnError(out);
|
|
1688
2197
|
return out;
|
|
1689
2198
|
}
|
|
@@ -1717,8 +2226,8 @@ var BitmarkParserGenerator = class {
|
|
|
1717
2226
|
};
|
|
1718
2227
|
}
|
|
1719
2228
|
const inStr = this.maybeReadFile(input, inputFormat);
|
|
1720
|
-
const
|
|
1721
|
-
if (
|
|
2229
|
+
const wasm4 = getLegacyWasm();
|
|
2230
|
+
if (wasm4.is_bitmark(inStr)) return { source: inStr, isBitmark: true };
|
|
1722
2231
|
try {
|
|
1723
2232
|
const parsed = JSON.parse(inStr);
|
|
1724
2233
|
const entries = this.jsonEntries(parsed);
|
|
@@ -2087,8 +2596,8 @@ function bitNameToKey(name) {
|
|
|
2087
2596
|
var bitTypeCache;
|
|
2088
2597
|
function loadBitTypes() {
|
|
2089
2598
|
if (!bitTypeCache) {
|
|
2090
|
-
const
|
|
2091
|
-
const all = JSON.parse(
|
|
2599
|
+
const wasm4 = getLegacyWasm();
|
|
2600
|
+
const all = JSON.parse(wasm4.info("all", "json", "", false, 2, true, false, false, ""));
|
|
2092
2601
|
const map = { _standard: "_standard" };
|
|
2093
2602
|
for (const { name } of all) {
|
|
2094
2603
|
map[bitNameToKey(name)] = name;
|
|
@@ -2159,12 +2668,13 @@ var StreamWriter = stubClass("StreamWriter", INTERNAL_REASON);
|
|
|
2159
2668
|
function patchEntry(path, op, value) {
|
|
2160
2669
|
return value === void 0 ? { path, op } : { path, op, value };
|
|
2161
2670
|
}
|
|
2671
|
+
var ALL_LANGUAGES = "all";
|
|
2162
2672
|
|
|
2163
2673
|
// src/core/api.ts
|
|
2164
|
-
function
|
|
2165
|
-
const
|
|
2166
|
-
if (typeof
|
|
2167
|
-
return
|
|
2674
|
+
function lex3(input, options = {}) {
|
|
2675
|
+
const wasm4 = getActive();
|
|
2676
|
+
if (typeof wasm4.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
|
|
2677
|
+
return wasm4.lex(input, options.stage ?? "lex");
|
|
2168
2678
|
}
|
|
2169
2679
|
function bitmarkToObjects(input, options = {}) {
|
|
2170
2680
|
const out = getActive().convert(
|
|
@@ -2199,7 +2709,7 @@ function objectsToBitmark(bits, options = {}) {
|
|
|
2199
2709
|
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2200
2710
|
return out;
|
|
2201
2711
|
}
|
|
2202
|
-
function
|
|
2712
|
+
function convert4(input, options = {}) {
|
|
2203
2713
|
return getActive().convert(
|
|
2204
2714
|
input,
|
|
2205
2715
|
options.inputFormat ?? "auto",
|
|
@@ -2212,7 +2722,7 @@ function convert3(input, options = {}) {
|
|
|
2212
2722
|
options.mappingReport ?? false
|
|
2213
2723
|
);
|
|
2214
2724
|
}
|
|
2215
|
-
function
|
|
2725
|
+
function canonicalize4(input, options = {}) {
|
|
2216
2726
|
return getActive().canonicalize(
|
|
2217
2727
|
input,
|
|
2218
2728
|
options.inputFormat ?? "auto",
|
|
@@ -2230,13 +2740,13 @@ function countBits(input) {
|
|
|
2230
2740
|
function splitBits(input) {
|
|
2231
2741
|
return JSON.parse(getActive().split_bits(input));
|
|
2232
2742
|
}
|
|
2233
|
-
function
|
|
2234
|
-
const
|
|
2743
|
+
function transform4(input, options = {}) {
|
|
2744
|
+
const wasm4 = getActive();
|
|
2235
2745
|
if (options.preHook || options.postHook) {
|
|
2236
|
-
return runHookedTransform(
|
|
2746
|
+
return runHookedTransform(wasm4, input, options);
|
|
2237
2747
|
}
|
|
2238
2748
|
const patchJson = options.patch === void 0 ? "" : typeof options.patch === "string" ? options.patch : JSON.stringify(options.patch);
|
|
2239
|
-
return
|
|
2749
|
+
return wasm4.transform(
|
|
2240
2750
|
input,
|
|
2241
2751
|
options.inputFormat ?? "auto",
|
|
2242
2752
|
options.outputFormat ?? "json",
|
|
@@ -2257,7 +2767,7 @@ function unbreakscapeText(input, options = {}) {
|
|
|
2257
2767
|
const location = options.location ?? "body";
|
|
2258
2768
|
return getActive().unbreakscape_text(input, format, location);
|
|
2259
2769
|
}
|
|
2260
|
-
function
|
|
2770
|
+
function info4(options = {}) {
|
|
2261
2771
|
const infoType = options.infoType ?? "list";
|
|
2262
2772
|
const format = options.format ?? "text";
|
|
2263
2773
|
const bit = options.bit ?? "";
|
|
@@ -2266,10 +2776,27 @@ function info3(options = {}) {
|
|
|
2266
2776
|
const includeDeprecated = options.includeDeprecated ?? false;
|
|
2267
2777
|
const onlyDeprecated = options.onlyDeprecated ?? false;
|
|
2268
2778
|
const full = options.full ?? false;
|
|
2269
|
-
|
|
2779
|
+
const language = typeof options.language === "string" ? options.language : options.language?.join(",") ?? "";
|
|
2780
|
+
return getActive().info(
|
|
2781
|
+
infoType,
|
|
2782
|
+
format,
|
|
2783
|
+
bit,
|
|
2784
|
+
pretty,
|
|
2785
|
+
indent,
|
|
2786
|
+
includeDeprecated,
|
|
2787
|
+
onlyDeprecated,
|
|
2788
|
+
full,
|
|
2789
|
+
language
|
|
2790
|
+
);
|
|
2791
|
+
}
|
|
2792
|
+
function register4(options) {
|
|
2793
|
+
const result = getActive().register(options.type, options.data);
|
|
2794
|
+
if (result) throw new RegisterError(result.replace(/^error:\s*/, ""));
|
|
2795
|
+
rememberRegistration(options.type, options.data);
|
|
2270
2796
|
}
|
|
2271
2797
|
|
|
2272
2798
|
// src/browser/index.ts
|
|
2799
|
+
var WASM_BASE = true ? "../wasm/" : "./";
|
|
2273
2800
|
var VARIANTS = {
|
|
2274
2801
|
full: {
|
|
2275
2802
|
init: bitmark_wasm_default,
|
|
@@ -2277,20 +2804,33 @@ var VARIANTS = {
|
|
|
2277
2804
|
ns: bitmark_wasm_exports,
|
|
2278
2805
|
wasmFile: "bitmark_wasm_bg.wasm"
|
|
2279
2806
|
},
|
|
2807
|
+
"browser-full": {
|
|
2808
|
+
init: bitmark_browser_full_wasm_default,
|
|
2809
|
+
initSync: initSync2,
|
|
2810
|
+
ns: bitmark_browser_full_wasm_exports,
|
|
2811
|
+
wasmFile: "bitmark_browser_full_wasm_bg.wasm"
|
|
2812
|
+
},
|
|
2280
2813
|
"bitmark-json": {
|
|
2281
2814
|
init: bitmark_json_wasm_default,
|
|
2282
|
-
initSync:
|
|
2815
|
+
initSync: initSync3,
|
|
2283
2816
|
ns: bitmark_json_wasm_exports,
|
|
2284
2817
|
wasmFile: "bitmark_json_wasm_bg.wasm"
|
|
2285
2818
|
}
|
|
2286
2819
|
};
|
|
2287
2820
|
setLegacyWasmProvider(() => getActive());
|
|
2821
|
+
function defaultFeatureFor(module_or_path) {
|
|
2822
|
+
return module_or_path === void 0 ? BROWSER_DEFAULT_FEATURE : "full";
|
|
2823
|
+
}
|
|
2288
2824
|
function normalizeInit(arg) {
|
|
2289
2825
|
if (arg !== null && typeof arg === "object" && !(arg instanceof URL) && ("feature" in arg || "module_or_path" in arg)) {
|
|
2290
2826
|
const o = arg;
|
|
2291
|
-
return {
|
|
2827
|
+
return {
|
|
2828
|
+
feature: o.feature ?? defaultFeatureFor(o.module_or_path),
|
|
2829
|
+
module_or_path: o.module_or_path
|
|
2830
|
+
};
|
|
2292
2831
|
}
|
|
2293
|
-
|
|
2832
|
+
const module_or_path = arg ?? void 0;
|
|
2833
|
+
return { feature: defaultFeatureFor(module_or_path), module_or_path };
|
|
2294
2834
|
}
|
|
2295
2835
|
var initSeq = 0;
|
|
2296
2836
|
var activeOut;
|
|
@@ -2303,7 +2843,7 @@ async function init(options) {
|
|
|
2303
2843
|
}
|
|
2304
2844
|
const mySeq = ++initSeq;
|
|
2305
2845
|
const v = VARIANTS[feature];
|
|
2306
|
-
const source = module_or_path ?? new URL(`${v.wasmFile}?v=${PACKAGE_INFO.version}`, import.meta.url);
|
|
2846
|
+
const source = module_or_path ?? new URL(`${WASM_BASE}${v.wasmFile}?v=${PACKAGE_INFO.version}`, import.meta.url);
|
|
2307
2847
|
const promise = (async () => {
|
|
2308
2848
|
try {
|
|
2309
2849
|
const out = await v.init(source);
|
|
@@ -2321,8 +2861,8 @@ async function init(options) {
|
|
|
2321
2861
|
inflight = { feature, seq: mySeq, promise };
|
|
2322
2862
|
return promise;
|
|
2323
2863
|
}
|
|
2324
|
-
function
|
|
2325
|
-
const feature = options.feature ??
|
|
2864
|
+
function initSync4(module, options = {}) {
|
|
2865
|
+
const feature = options.feature ?? defaultFeatureFor(module);
|
|
2326
2866
|
const v = VARIANTS[feature];
|
|
2327
2867
|
const out = v.initSync(module);
|
|
2328
2868
|
setActive(feature, v.ns);
|
|
@@ -2333,32 +2873,35 @@ function version() {
|
|
|
2333
2873
|
return PACKAGE_INFO.version;
|
|
2334
2874
|
}
|
|
2335
2875
|
function transformParallel(input, options = {}) {
|
|
2336
|
-
const
|
|
2337
|
-
const feature = variant() ??
|
|
2876
|
+
const wasm4 = getActive();
|
|
2877
|
+
const feature = variant() ?? BROWSER_DEFAULT_FEATURE;
|
|
2338
2878
|
return orchestrateParallel(
|
|
2339
|
-
|
|
2879
|
+
wasm4,
|
|
2340
2880
|
input,
|
|
2341
2881
|
options,
|
|
2342
2882
|
(jobs, workers) => runJobsParallel(jobs, workers, feature)
|
|
2343
2883
|
);
|
|
2344
2884
|
}
|
|
2345
2885
|
export {
|
|
2886
|
+
ALL_LANGUAGES,
|
|
2346
2887
|
NotInitializedError,
|
|
2888
|
+
RegisterError,
|
|
2347
2889
|
UnsupportedFeatureError,
|
|
2348
2890
|
bitmarkToObjects,
|
|
2349
2891
|
breakscapeText,
|
|
2350
|
-
|
|
2351
|
-
|
|
2892
|
+
canonicalize4 as canonicalize,
|
|
2893
|
+
convert4 as convert,
|
|
2352
2894
|
countBits,
|
|
2353
|
-
|
|
2895
|
+
info4 as info,
|
|
2354
2896
|
init,
|
|
2355
|
-
|
|
2897
|
+
initSync4 as initSync,
|
|
2356
2898
|
legacy_exports as legacy,
|
|
2357
|
-
|
|
2899
|
+
lex3 as lex,
|
|
2358
2900
|
objectsToBitmark,
|
|
2359
2901
|
patchEntry,
|
|
2902
|
+
register4 as register,
|
|
2360
2903
|
splitBits,
|
|
2361
|
-
|
|
2904
|
+
transform4 as transform,
|
|
2362
2905
|
transformParallel,
|
|
2363
2906
|
unbreakscapeText,
|
|
2364
2907
|
variant,
|