@gmb/bitmark-parser 6.10.1 → 6.11.1
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 +288 -22
- 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 +1053 -345
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +1175 -34
- package/dist/browser/esm/index.d.ts +1175 -34
- package/dist/browser/esm/index.js +1048 -345
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js +712 -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 +124 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1175 -34
- package/dist/index.d.ts +1175 -34
- package/dist/index.js +119 -32
- 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 +53 -12
- package/wasm/bitmark_wasm.js +171 -47
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +4 -1
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm.d.ts +39 -12
- package/wasm-bitmark-json/bitmark_json_wasm.js +129 -53
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +3 -1
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +149 -0
- package/wasm-browser-full/bitmark_browser_full_wasm.js +647 -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 +23 -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
|
@@ -15,11 +15,14 @@ __export(bitmark_wasm_exports, {
|
|
|
15
15
|
convert_text: () => convert_text,
|
|
16
16
|
count_bits: () => count_bits,
|
|
17
17
|
default: () => bitmark_wasm_default,
|
|
18
|
+
diff: () => diff,
|
|
18
19
|
info: () => info,
|
|
19
20
|
initSync: () => initSync,
|
|
20
21
|
is_bitmark: () => is_bitmark,
|
|
21
22
|
lex: () => lex,
|
|
22
23
|
prettify: () => prettify,
|
|
24
|
+
register: () => register,
|
|
25
|
+
resolve_patch_document: () => resolve_patch_document,
|
|
23
26
|
split_bits: () => split_bits,
|
|
24
27
|
split_json_bits: () => split_json_bits,
|
|
25
28
|
transform: () => transform,
|
|
@@ -158,9 +161,9 @@ function unbreakscape_text(input, format, location) {
|
|
|
158
161
|
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
159
162
|
}
|
|
160
163
|
}
|
|
161
|
-
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
|
|
162
|
-
let
|
|
163
|
-
let
|
|
164
|
+
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
165
|
+
let deferred5_0;
|
|
166
|
+
let deferred5_1;
|
|
164
167
|
try {
|
|
165
168
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
166
169
|
const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -169,15 +172,41 @@ function info(info_type, format, bit, pretty, indent, include_deprecated, only_d
|
|
|
169
172
|
const len1 = WASM_VECTOR_LEN;
|
|
170
173
|
const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
171
174
|
const len2 = WASM_VECTOR_LEN;
|
|
172
|
-
|
|
175
|
+
const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
176
|
+
const len3 = WASM_VECTOR_LEN;
|
|
177
|
+
wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
173
178
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
174
179
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
175
|
-
|
|
176
|
-
|
|
180
|
+
deferred5_0 = r0;
|
|
181
|
+
deferred5_1 = r1;
|
|
177
182
|
return getStringFromWasm0(r0, r1);
|
|
178
183
|
} finally {
|
|
179
184
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
180
|
-
wasm.__wbindgen_export_2(
|
|
185
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function convert_text(input, direction, format, location) {
|
|
189
|
+
let deferred5_0;
|
|
190
|
+
let deferred5_1;
|
|
191
|
+
try {
|
|
192
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
193
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
194
|
+
const len0 = WASM_VECTOR_LEN;
|
|
195
|
+
const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
196
|
+
const len1 = WASM_VECTOR_LEN;
|
|
197
|
+
const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
198
|
+
const len2 = WASM_VECTOR_LEN;
|
|
199
|
+
const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
200
|
+
const len3 = WASM_VECTOR_LEN;
|
|
201
|
+
wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
202
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
203
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
204
|
+
deferred5_0 = r0;
|
|
205
|
+
deferred5_1 = r1;
|
|
206
|
+
return getStringFromWasm0(r0, r1);
|
|
207
|
+
} finally {
|
|
208
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
209
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
181
210
|
}
|
|
182
211
|
}
|
|
183
212
|
function transform(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
@@ -206,6 +235,70 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
|
|
|
206
235
|
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
207
236
|
}
|
|
208
237
|
}
|
|
238
|
+
function resolve_patch_document(input, patch_json) {
|
|
239
|
+
let deferred3_0;
|
|
240
|
+
let deferred3_1;
|
|
241
|
+
try {
|
|
242
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
243
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
244
|
+
const len0 = WASM_VECTOR_LEN;
|
|
245
|
+
const ptr1 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
246
|
+
const len1 = WASM_VECTOR_LEN;
|
|
247
|
+
wasm.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
248
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
249
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
250
|
+
deferred3_0 = r0;
|
|
251
|
+
deferred3_1 = r1;
|
|
252
|
+
return getStringFromWasm0(r0, r1);
|
|
253
|
+
} finally {
|
|
254
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
255
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function diff(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
259
|
+
let deferred5_0;
|
|
260
|
+
let deferred5_1;
|
|
261
|
+
try {
|
|
262
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
263
|
+
const ptr0 = passStringToWasm0(a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
264
|
+
const len0 = WASM_VECTOR_LEN;
|
|
265
|
+
const ptr1 = passStringToWasm0(b, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
266
|
+
const len1 = WASM_VECTOR_LEN;
|
|
267
|
+
const ptr2 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
268
|
+
const len2 = WASM_VECTOR_LEN;
|
|
269
|
+
const ptr3 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
270
|
+
const len3 = WASM_VECTOR_LEN;
|
|
271
|
+
wasm.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
272
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
273
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
274
|
+
deferred5_0 = r0;
|
|
275
|
+
deferred5_1 = r1;
|
|
276
|
+
return getStringFromWasm0(r0, r1);
|
|
277
|
+
} finally {
|
|
278
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
279
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
280
|
+
}
|
|
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
|
+
}
|
|
209
302
|
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
210
303
|
let deferred5_0;
|
|
211
304
|
let deferred5_1;
|
|
@@ -330,30 +423,6 @@ function prettify(json, indent) {
|
|
|
330
423
|
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
331
424
|
}
|
|
332
425
|
}
|
|
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
426
|
async function __wbg_load(module, imports) {
|
|
358
427
|
if (typeof Response === "function" && module instanceof Response) {
|
|
359
428
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
@@ -431,19 +500,23 @@ async function __wbg_init(module_or_path) {
|
|
|
431
500
|
}
|
|
432
501
|
var bitmark_wasm_default = __wbg_init;
|
|
433
502
|
|
|
434
|
-
// wasm-web-
|
|
435
|
-
var
|
|
436
|
-
__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, {
|
|
437
506
|
breakscape_text: () => breakscape_text2,
|
|
438
507
|
canonicalize: () => canonicalize2,
|
|
439
508
|
convert: () => convert2,
|
|
440
509
|
convert_text: () => convert_text2,
|
|
441
510
|
count_bits: () => count_bits2,
|
|
442
|
-
default: () =>
|
|
511
|
+
default: () => bitmark_browser_full_wasm_default,
|
|
512
|
+
diff: () => diff2,
|
|
443
513
|
info: () => info2,
|
|
444
514
|
initSync: () => initSync2,
|
|
445
515
|
is_bitmark: () => is_bitmark2,
|
|
516
|
+
lex: () => lex2,
|
|
446
517
|
prettify: () => prettify2,
|
|
518
|
+
register: () => register2,
|
|
519
|
+
resolve_patch_document: () => resolve_patch_document2,
|
|
447
520
|
split_bits: () => split_bits2,
|
|
448
521
|
split_json_bits: () => split_json_bits2,
|
|
449
522
|
transform: () => transform2,
|
|
@@ -464,24 +537,516 @@ var cachedTextEncoder2 = typeof TextEncoder !== "undefined" ? new TextEncoder("u
|
|
|
464
537
|
var encodeString2 = typeof cachedTextEncoder2.encodeInto === "function" ? function(arg, view) {
|
|
465
538
|
return cachedTextEncoder2.encodeInto(arg, view);
|
|
466
539
|
} : function(arg, view) {
|
|
467
|
-
const buf = cachedTextEncoder2.encode(arg);
|
|
540
|
+
const buf = cachedTextEncoder2.encode(arg);
|
|
541
|
+
view.set(buf);
|
|
542
|
+
return {
|
|
543
|
+
read: arg.length,
|
|
544
|
+
written: buf.length
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
function passStringToWasm02(arg, malloc, realloc) {
|
|
548
|
+
if (realloc === void 0) {
|
|
549
|
+
const buf = cachedTextEncoder2.encode(arg);
|
|
550
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
551
|
+
getUint8ArrayMemory02().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
552
|
+
WASM_VECTOR_LEN2 = buf.length;
|
|
553
|
+
return ptr2;
|
|
554
|
+
}
|
|
555
|
+
let len = arg.length;
|
|
556
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
557
|
+
const mem = getUint8ArrayMemory02();
|
|
558
|
+
let offset = 0;
|
|
559
|
+
for (; offset < len; offset++) {
|
|
560
|
+
const code = arg.charCodeAt(offset);
|
|
561
|
+
if (code > 127) break;
|
|
562
|
+
mem[ptr + offset] = code;
|
|
563
|
+
}
|
|
564
|
+
if (offset !== len) {
|
|
565
|
+
if (offset !== 0) {
|
|
566
|
+
arg = arg.slice(offset);
|
|
567
|
+
}
|
|
568
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
569
|
+
const view = getUint8ArrayMemory02().subarray(ptr + offset, ptr + len);
|
|
570
|
+
const ret = encodeString2(arg, view);
|
|
571
|
+
offset += ret.written;
|
|
572
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
573
|
+
}
|
|
574
|
+
WASM_VECTOR_LEN2 = offset;
|
|
575
|
+
return ptr;
|
|
576
|
+
}
|
|
577
|
+
var cachedDataViewMemory02 = null;
|
|
578
|
+
function getDataViewMemory02() {
|
|
579
|
+
if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
|
|
580
|
+
cachedDataViewMemory02 = new DataView(wasm2.memory.buffer);
|
|
581
|
+
}
|
|
582
|
+
return cachedDataViewMemory02;
|
|
583
|
+
}
|
|
584
|
+
var cachedTextDecoder2 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
585
|
+
throw Error("TextDecoder not available");
|
|
586
|
+
} };
|
|
587
|
+
if (typeof TextDecoder !== "undefined") {
|
|
588
|
+
cachedTextDecoder2.decode();
|
|
589
|
+
}
|
|
590
|
+
function getStringFromWasm02(ptr, len) {
|
|
591
|
+
ptr = ptr >>> 0;
|
|
592
|
+
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
593
|
+
}
|
|
594
|
+
function lex2(input, stage) {
|
|
595
|
+
let deferred3_0;
|
|
596
|
+
let deferred3_1;
|
|
597
|
+
try {
|
|
598
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
599
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
600
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
601
|
+
const ptr1 = passStringToWasm02(stage, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
602
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
603
|
+
wasm2.lex(retptr, ptr0, len0, ptr1, len1);
|
|
604
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
605
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
606
|
+
deferred3_0 = r0;
|
|
607
|
+
deferred3_1 = r1;
|
|
608
|
+
return getStringFromWasm02(r0, r1);
|
|
609
|
+
} finally {
|
|
610
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
611
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function breakscape_text2(input, format, location) {
|
|
615
|
+
let deferred4_0;
|
|
616
|
+
let deferred4_1;
|
|
617
|
+
try {
|
|
618
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
619
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
620
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
621
|
+
const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
622
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
623
|
+
const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
624
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
625
|
+
wasm2.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
626
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
627
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
628
|
+
deferred4_0 = r0;
|
|
629
|
+
deferred4_1 = r1;
|
|
630
|
+
return getStringFromWasm02(r0, r1);
|
|
631
|
+
} finally {
|
|
632
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
633
|
+
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function unbreakscape_text2(input, format, location) {
|
|
637
|
+
let deferred4_0;
|
|
638
|
+
let deferred4_1;
|
|
639
|
+
try {
|
|
640
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
641
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
642
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
643
|
+
const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
644
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
645
|
+
const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
646
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
647
|
+
wasm2.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
648
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
649
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
650
|
+
deferred4_0 = r0;
|
|
651
|
+
deferred4_1 = r1;
|
|
652
|
+
return getStringFromWasm02(r0, r1);
|
|
653
|
+
} finally {
|
|
654
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
655
|
+
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
659
|
+
let deferred5_0;
|
|
660
|
+
let deferred5_1;
|
|
661
|
+
try {
|
|
662
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
663
|
+
const ptr0 = passStringToWasm02(info_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
664
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
665
|
+
const ptr1 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
666
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
667
|
+
const ptr2 = passStringToWasm02(bit, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
668
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
669
|
+
const ptr3 = passStringToWasm02(language, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
670
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
671
|
+
wasm2.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
672
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
673
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
674
|
+
deferred5_0 = r0;
|
|
675
|
+
deferred5_1 = r1;
|
|
676
|
+
return getStringFromWasm02(r0, r1);
|
|
677
|
+
} finally {
|
|
678
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
679
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
function convert_text2(input, direction, format, location) {
|
|
683
|
+
let deferred5_0;
|
|
684
|
+
let deferred5_1;
|
|
685
|
+
try {
|
|
686
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
687
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
688
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
689
|
+
const ptr1 = passStringToWasm02(direction, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
690
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
691
|
+
const ptr2 = passStringToWasm02(format, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
692
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
693
|
+
const ptr3 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
694
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
695
|
+
wasm2.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
696
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
697
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
698
|
+
deferred5_0 = r0;
|
|
699
|
+
deferred5_1 = r1;
|
|
700
|
+
return getStringFromWasm02(r0, r1);
|
|
701
|
+
} finally {
|
|
702
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
703
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
function transform2(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
707
|
+
let deferred6_0;
|
|
708
|
+
let deferred6_1;
|
|
709
|
+
try {
|
|
710
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
711
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
712
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
713
|
+
const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
714
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
715
|
+
const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
716
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
717
|
+
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
718
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
719
|
+
const ptr4 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
720
|
+
const len4 = WASM_VECTOR_LEN2;
|
|
721
|
+
wasm2.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
722
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
723
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
724
|
+
deferred6_0 = r0;
|
|
725
|
+
deferred6_1 = r1;
|
|
726
|
+
return getStringFromWasm02(r0, r1);
|
|
727
|
+
} finally {
|
|
728
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
729
|
+
wasm2.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
function resolve_patch_document2(input, patch_json) {
|
|
733
|
+
let deferred3_0;
|
|
734
|
+
let deferred3_1;
|
|
735
|
+
try {
|
|
736
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
737
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
738
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
739
|
+
const ptr1 = passStringToWasm02(patch_json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
740
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
741
|
+
wasm2.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
742
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
743
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
744
|
+
deferred3_0 = r0;
|
|
745
|
+
deferred3_1 = r1;
|
|
746
|
+
return getStringFromWasm02(r0, r1);
|
|
747
|
+
} finally {
|
|
748
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
749
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
function diff2(a, b, input_format_sel, output_format_sel, context, locate, similarity, bbox_tolerance, spaces_around_values) {
|
|
753
|
+
let deferred5_0;
|
|
754
|
+
let deferred5_1;
|
|
755
|
+
try {
|
|
756
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
757
|
+
const ptr0 = passStringToWasm02(a, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
758
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
759
|
+
const ptr1 = passStringToWasm02(b, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
760
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
761
|
+
const ptr2 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
762
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
763
|
+
const ptr3 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
764
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
765
|
+
wasm2.diff(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, context, locate, similarity, bbox_tolerance, spaces_around_values);
|
|
766
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
767
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
768
|
+
deferred5_0 = r0;
|
|
769
|
+
deferred5_1 = r1;
|
|
770
|
+
return getStringFromWasm02(r0, r1);
|
|
771
|
+
} finally {
|
|
772
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
773
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
function register2(data_type, data) {
|
|
777
|
+
let deferred3_0;
|
|
778
|
+
let deferred3_1;
|
|
779
|
+
try {
|
|
780
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
781
|
+
const ptr0 = passStringToWasm02(data_type, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
782
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
783
|
+
const ptr1 = passStringToWasm02(data, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
784
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
785
|
+
wasm2.register(retptr, ptr0, len0, ptr1, len1);
|
|
786
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
787
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
788
|
+
deferred3_0 = r0;
|
|
789
|
+
deferred3_1 = r1;
|
|
790
|
+
return getStringFromWasm02(r0, r1);
|
|
791
|
+
} finally {
|
|
792
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
793
|
+
wasm2.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
function convert2(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
797
|
+
let deferred5_0;
|
|
798
|
+
let deferred5_1;
|
|
799
|
+
try {
|
|
800
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
801
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
802
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
803
|
+
const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
804
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
805
|
+
const ptr2 = passStringToWasm02(output_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
806
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
807
|
+
const ptr3 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
808
|
+
const len3 = WASM_VECTOR_LEN2;
|
|
809
|
+
wasm2.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
|
|
810
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
811
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
812
|
+
deferred5_0 = r0;
|
|
813
|
+
deferred5_1 = r1;
|
|
814
|
+
return getStringFromWasm02(r0, r1);
|
|
815
|
+
} finally {
|
|
816
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
817
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
function canonicalize2(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
821
|
+
let deferred4_0;
|
|
822
|
+
let deferred4_1;
|
|
823
|
+
try {
|
|
824
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
825
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
826
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
827
|
+
const ptr1 = passStringToWasm02(input_format_sel, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
828
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
829
|
+
const ptr2 = passStringToWasm02(mode, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
830
|
+
const len2 = WASM_VECTOR_LEN2;
|
|
831
|
+
wasm2.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
832
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
833
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
834
|
+
deferred4_0 = r0;
|
|
835
|
+
deferred4_1 = r1;
|
|
836
|
+
return getStringFromWasm02(r0, r1);
|
|
837
|
+
} finally {
|
|
838
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
839
|
+
wasm2.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
function count_bits2(input) {
|
|
843
|
+
let deferred2_0;
|
|
844
|
+
let deferred2_1;
|
|
845
|
+
try {
|
|
846
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
847
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
848
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
849
|
+
wasm2.count_bits(retptr, ptr0, len0);
|
|
850
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
851
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
852
|
+
deferred2_0 = r0;
|
|
853
|
+
deferred2_1 = r1;
|
|
854
|
+
return getStringFromWasm02(r0, r1);
|
|
855
|
+
} finally {
|
|
856
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
857
|
+
wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
function split_bits2(input) {
|
|
861
|
+
let deferred2_0;
|
|
862
|
+
let deferred2_1;
|
|
863
|
+
try {
|
|
864
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
865
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
866
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
867
|
+
wasm2.split_bits(retptr, ptr0, len0);
|
|
868
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
869
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
870
|
+
deferred2_0 = r0;
|
|
871
|
+
deferred2_1 = r1;
|
|
872
|
+
return getStringFromWasm02(r0, r1);
|
|
873
|
+
} finally {
|
|
874
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
875
|
+
wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
function is_bitmark2(input) {
|
|
879
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
880
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
881
|
+
const ret = wasm2.is_bitmark(ptr0, len0);
|
|
882
|
+
return ret !== 0;
|
|
883
|
+
}
|
|
884
|
+
function split_json_bits2(input) {
|
|
885
|
+
let deferred2_0;
|
|
886
|
+
let deferred2_1;
|
|
887
|
+
try {
|
|
888
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
889
|
+
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
890
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
891
|
+
wasm2.split_json_bits(retptr, ptr0, len0);
|
|
892
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
893
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
894
|
+
deferred2_0 = r0;
|
|
895
|
+
deferred2_1 = r1;
|
|
896
|
+
return getStringFromWasm02(r0, r1);
|
|
897
|
+
} finally {
|
|
898
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
899
|
+
wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
function prettify2(json, indent) {
|
|
903
|
+
let deferred2_0;
|
|
904
|
+
let deferred2_1;
|
|
905
|
+
try {
|
|
906
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
907
|
+
const ptr0 = passStringToWasm02(json, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
908
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
909
|
+
wasm2.prettify(retptr, ptr0, len0, indent);
|
|
910
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
911
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
912
|
+
deferred2_0 = r0;
|
|
913
|
+
deferred2_1 = r1;
|
|
914
|
+
return getStringFromWasm02(r0, r1);
|
|
915
|
+
} finally {
|
|
916
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
917
|
+
wasm2.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
async function __wbg_load2(module, imports) {
|
|
921
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
922
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
923
|
+
try {
|
|
924
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
925
|
+
} catch (e) {
|
|
926
|
+
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
927
|
+
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);
|
|
928
|
+
} else {
|
|
929
|
+
throw e;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
const bytes = await module.arrayBuffer();
|
|
934
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
935
|
+
} else {
|
|
936
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
937
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
938
|
+
return { instance, module };
|
|
939
|
+
} else {
|
|
940
|
+
return instance;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
function __wbg_get_imports2() {
|
|
945
|
+
const imports = {};
|
|
946
|
+
imports.wbg = {};
|
|
947
|
+
return imports;
|
|
948
|
+
}
|
|
949
|
+
function __wbg_init_memory2(imports, memory) {
|
|
950
|
+
}
|
|
951
|
+
function __wbg_finalize_init2(instance, module) {
|
|
952
|
+
wasm2 = instance.exports;
|
|
953
|
+
__wbg_init2.__wbindgen_wasm_module = module;
|
|
954
|
+
cachedDataViewMemory02 = null;
|
|
955
|
+
cachedUint8ArrayMemory02 = null;
|
|
956
|
+
return wasm2;
|
|
957
|
+
}
|
|
958
|
+
function initSync2(module) {
|
|
959
|
+
if (wasm2 !== void 0) return wasm2;
|
|
960
|
+
if (typeof module !== "undefined") {
|
|
961
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
962
|
+
({ module } = module);
|
|
963
|
+
} else {
|
|
964
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
const imports = __wbg_get_imports2();
|
|
968
|
+
__wbg_init_memory2(imports);
|
|
969
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
970
|
+
module = new WebAssembly.Module(module);
|
|
971
|
+
}
|
|
972
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
973
|
+
return __wbg_finalize_init2(instance, module);
|
|
974
|
+
}
|
|
975
|
+
async function __wbg_init2(module_or_path) {
|
|
976
|
+
if (wasm2 !== void 0) return wasm2;
|
|
977
|
+
if (typeof module_or_path !== "undefined") {
|
|
978
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
979
|
+
({ module_or_path } = module_or_path);
|
|
980
|
+
} else {
|
|
981
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
if (typeof module_or_path === "undefined") {
|
|
985
|
+
module_or_path = new URL("bitmark_browser_full_wasm_bg.wasm", import.meta.url);
|
|
986
|
+
}
|
|
987
|
+
const imports = __wbg_get_imports2();
|
|
988
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
989
|
+
module_or_path = fetch(module_or_path);
|
|
990
|
+
}
|
|
991
|
+
__wbg_init_memory2(imports);
|
|
992
|
+
const { instance, module } = await __wbg_load2(await module_or_path, imports);
|
|
993
|
+
return __wbg_finalize_init2(instance, module);
|
|
994
|
+
}
|
|
995
|
+
var bitmark_browser_full_wasm_default = __wbg_init2;
|
|
996
|
+
|
|
997
|
+
// wasm-web-bitmark-json/bitmark_json_wasm.js
|
|
998
|
+
var bitmark_json_wasm_exports = {};
|
|
999
|
+
__export(bitmark_json_wasm_exports, {
|
|
1000
|
+
breakscape_text: () => breakscape_text3,
|
|
1001
|
+
canonicalize: () => canonicalize3,
|
|
1002
|
+
convert: () => convert3,
|
|
1003
|
+
convert_text: () => convert_text3,
|
|
1004
|
+
count_bits: () => count_bits3,
|
|
1005
|
+
default: () => bitmark_json_wasm_default,
|
|
1006
|
+
info: () => info3,
|
|
1007
|
+
initSync: () => initSync3,
|
|
1008
|
+
is_bitmark: () => is_bitmark3,
|
|
1009
|
+
prettify: () => prettify3,
|
|
1010
|
+
register: () => register3,
|
|
1011
|
+
resolve_patch_document: () => resolve_patch_document3,
|
|
1012
|
+
split_bits: () => split_bits3,
|
|
1013
|
+
split_json_bits: () => split_json_bits3,
|
|
1014
|
+
transform: () => transform3,
|
|
1015
|
+
unbreakscape_text: () => unbreakscape_text3
|
|
1016
|
+
});
|
|
1017
|
+
var wasm3;
|
|
1018
|
+
var WASM_VECTOR_LEN3 = 0;
|
|
1019
|
+
var cachedUint8ArrayMemory03 = null;
|
|
1020
|
+
function getUint8ArrayMemory03() {
|
|
1021
|
+
if (cachedUint8ArrayMemory03 === null || cachedUint8ArrayMemory03.byteLength === 0) {
|
|
1022
|
+
cachedUint8ArrayMemory03 = new Uint8Array(wasm3.memory.buffer);
|
|
1023
|
+
}
|
|
1024
|
+
return cachedUint8ArrayMemory03;
|
|
1025
|
+
}
|
|
1026
|
+
var cachedTextEncoder3 = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
1027
|
+
throw Error("TextEncoder not available");
|
|
1028
|
+
} };
|
|
1029
|
+
var encodeString3 = typeof cachedTextEncoder3.encodeInto === "function" ? function(arg, view) {
|
|
1030
|
+
return cachedTextEncoder3.encodeInto(arg, view);
|
|
1031
|
+
} : function(arg, view) {
|
|
1032
|
+
const buf = cachedTextEncoder3.encode(arg);
|
|
468
1033
|
view.set(buf);
|
|
469
1034
|
return {
|
|
470
1035
|
read: arg.length,
|
|
471
1036
|
written: buf.length
|
|
472
1037
|
};
|
|
473
1038
|
};
|
|
474
|
-
function
|
|
1039
|
+
function passStringToWasm03(arg, malloc, realloc) {
|
|
475
1040
|
if (realloc === void 0) {
|
|
476
|
-
const buf =
|
|
1041
|
+
const buf = cachedTextEncoder3.encode(arg);
|
|
477
1042
|
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
478
|
-
|
|
479
|
-
|
|
1043
|
+
getUint8ArrayMemory03().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
1044
|
+
WASM_VECTOR_LEN3 = buf.length;
|
|
480
1045
|
return ptr2;
|
|
481
1046
|
}
|
|
482
1047
|
let len = arg.length;
|
|
483
1048
|
let ptr = malloc(len, 1) >>> 0;
|
|
484
|
-
const mem =
|
|
1049
|
+
const mem = getUint8ArrayMemory03();
|
|
485
1050
|
let offset = 0;
|
|
486
1051
|
for (; offset < len; offset++) {
|
|
487
1052
|
const code = arg.charCodeAt(offset);
|
|
@@ -493,272 +1058,314 @@ function passStringToWasm02(arg, malloc, realloc) {
|
|
|
493
1058
|
arg = arg.slice(offset);
|
|
494
1059
|
}
|
|
495
1060
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
496
|
-
const view =
|
|
497
|
-
const ret =
|
|
1061
|
+
const view = getUint8ArrayMemory03().subarray(ptr + offset, ptr + len);
|
|
1062
|
+
const ret = encodeString3(arg, view);
|
|
498
1063
|
offset += ret.written;
|
|
499
1064
|
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
500
1065
|
}
|
|
501
|
-
|
|
1066
|
+
WASM_VECTOR_LEN3 = offset;
|
|
502
1067
|
return ptr;
|
|
503
1068
|
}
|
|
504
|
-
var
|
|
505
|
-
function
|
|
506
|
-
if (
|
|
507
|
-
|
|
1069
|
+
var cachedDataViewMemory03 = null;
|
|
1070
|
+
function getDataViewMemory03() {
|
|
1071
|
+
if (cachedDataViewMemory03 === null || cachedDataViewMemory03.buffer.detached === true || cachedDataViewMemory03.buffer.detached === void 0 && cachedDataViewMemory03.buffer !== wasm3.memory.buffer) {
|
|
1072
|
+
cachedDataViewMemory03 = new DataView(wasm3.memory.buffer);
|
|
508
1073
|
}
|
|
509
|
-
return
|
|
1074
|
+
return cachedDataViewMemory03;
|
|
510
1075
|
}
|
|
511
|
-
var
|
|
1076
|
+
var cachedTextDecoder3 = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
512
1077
|
throw Error("TextDecoder not available");
|
|
513
1078
|
} };
|
|
514
1079
|
if (typeof TextDecoder !== "undefined") {
|
|
515
|
-
|
|
1080
|
+
cachedTextDecoder3.decode();
|
|
516
1081
|
}
|
|
517
|
-
function
|
|
1082
|
+
function getStringFromWasm03(ptr, len) {
|
|
518
1083
|
ptr = ptr >>> 0;
|
|
519
|
-
return
|
|
1084
|
+
return cachedTextDecoder3.decode(getUint8ArrayMemory03().subarray(ptr, ptr + len));
|
|
520
1085
|
}
|
|
521
|
-
function
|
|
1086
|
+
function breakscape_text3(input, format, location) {
|
|
522
1087
|
let deferred4_0;
|
|
523
1088
|
let deferred4_1;
|
|
524
1089
|
try {
|
|
525
|
-
const retptr =
|
|
526
|
-
const ptr0 =
|
|
527
|
-
const len0 =
|
|
528
|
-
const ptr1 =
|
|
529
|
-
const len1 =
|
|
530
|
-
const ptr2 =
|
|
531
|
-
const len2 =
|
|
532
|
-
|
|
533
|
-
var r0 =
|
|
534
|
-
var r1 =
|
|
1090
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1091
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1092
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1093
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1094
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1095
|
+
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1096
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1097
|
+
wasm3.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1098
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1099
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
535
1100
|
deferred4_0 = r0;
|
|
536
1101
|
deferred4_1 = r1;
|
|
537
|
-
return
|
|
1102
|
+
return getStringFromWasm03(r0, r1);
|
|
538
1103
|
} finally {
|
|
539
|
-
|
|
540
|
-
|
|
1104
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1105
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
541
1106
|
}
|
|
542
1107
|
}
|
|
543
|
-
function
|
|
1108
|
+
function unbreakscape_text3(input, format, location) {
|
|
544
1109
|
let deferred4_0;
|
|
545
1110
|
let deferred4_1;
|
|
546
1111
|
try {
|
|
547
|
-
const retptr =
|
|
548
|
-
const ptr0 =
|
|
549
|
-
const len0 =
|
|
550
|
-
const ptr1 =
|
|
551
|
-
const len1 =
|
|
552
|
-
const ptr2 =
|
|
553
|
-
const len2 =
|
|
554
|
-
|
|
555
|
-
var r0 =
|
|
556
|
-
var r1 =
|
|
1112
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1113
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1114
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1115
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1116
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1117
|
+
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1118
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1119
|
+
wasm3.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1120
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1121
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
557
1122
|
deferred4_0 = r0;
|
|
558
1123
|
deferred4_1 = r1;
|
|
559
|
-
return
|
|
1124
|
+
return getStringFromWasm03(r0, r1);
|
|
560
1125
|
} finally {
|
|
561
|
-
|
|
562
|
-
|
|
1126
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1127
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
563
1128
|
}
|
|
564
1129
|
}
|
|
565
|
-
function
|
|
566
|
-
let
|
|
567
|
-
let
|
|
1130
|
+
function info3(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
1131
|
+
let deferred5_0;
|
|
1132
|
+
let deferred5_1;
|
|
568
1133
|
try {
|
|
569
|
-
const retptr =
|
|
570
|
-
const ptr0 =
|
|
571
|
-
const len0 =
|
|
572
|
-
const ptr1 =
|
|
573
|
-
const len1 =
|
|
574
|
-
const ptr2 =
|
|
575
|
-
const len2 =
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
1134
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1135
|
+
const ptr0 = passStringToWasm03(info_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1136
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1137
|
+
const ptr1 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1138
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1139
|
+
const ptr2 = passStringToWasm03(bit, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1140
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1141
|
+
const ptr3 = passStringToWasm03(language, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1142
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1143
|
+
wasm3.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
|
|
1144
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1145
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1146
|
+
deferred5_0 = r0;
|
|
1147
|
+
deferred5_1 = r1;
|
|
1148
|
+
return getStringFromWasm03(r0, r1);
|
|
582
1149
|
} finally {
|
|
583
|
-
|
|
584
|
-
|
|
1150
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1151
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
585
1152
|
}
|
|
586
1153
|
}
|
|
587
|
-
function
|
|
1154
|
+
function register3(data_type, data) {
|
|
1155
|
+
let deferred3_0;
|
|
1156
|
+
let deferred3_1;
|
|
1157
|
+
try {
|
|
1158
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1159
|
+
const ptr0 = passStringToWasm03(data_type, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1160
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1161
|
+
const ptr1 = passStringToWasm03(data, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1162
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1163
|
+
wasm3.register(retptr, ptr0, len0, ptr1, len1);
|
|
1164
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1165
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1166
|
+
deferred3_0 = r0;
|
|
1167
|
+
deferred3_1 = r1;
|
|
1168
|
+
return getStringFromWasm03(r0, r1);
|
|
1169
|
+
} finally {
|
|
1170
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1171
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
function transform3(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
|
|
1175
|
+
let deferred6_0;
|
|
1176
|
+
let deferred6_1;
|
|
1177
|
+
try {
|
|
1178
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1179
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1180
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1181
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1182
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1183
|
+
const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1184
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1185
|
+
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1186
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1187
|
+
const ptr4 = passStringToWasm03(patch_json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1188
|
+
const len4 = WASM_VECTOR_LEN3;
|
|
1189
|
+
wasm3.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
|
|
1190
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1191
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1192
|
+
deferred6_0 = r0;
|
|
1193
|
+
deferred6_1 = r1;
|
|
1194
|
+
return getStringFromWasm03(r0, r1);
|
|
1195
|
+
} finally {
|
|
1196
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1197
|
+
wasm3.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
function resolve_patch_document3(input, patch_json) {
|
|
1201
|
+
let deferred3_0;
|
|
1202
|
+
let deferred3_1;
|
|
1203
|
+
try {
|
|
1204
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1205
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1206
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1207
|
+
const ptr1 = passStringToWasm03(patch_json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1208
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1209
|
+
wasm3.resolve_patch_document(retptr, ptr0, len0, ptr1, len1);
|
|
1210
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1211
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1212
|
+
deferred3_0 = r0;
|
|
1213
|
+
deferred3_1 = r1;
|
|
1214
|
+
return getStringFromWasm03(r0, r1);
|
|
1215
|
+
} finally {
|
|
1216
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1217
|
+
wasm3.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
function convert3(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
588
1221
|
let deferred5_0;
|
|
589
1222
|
let deferred5_1;
|
|
590
1223
|
try {
|
|
591
|
-
const retptr =
|
|
592
|
-
const ptr0 =
|
|
593
|
-
const len0 =
|
|
594
|
-
const ptr1 =
|
|
595
|
-
const len1 =
|
|
596
|
-
const ptr2 =
|
|
597
|
-
const len2 =
|
|
598
|
-
const ptr3 =
|
|
599
|
-
const len3 =
|
|
600
|
-
|
|
601
|
-
var r0 =
|
|
602
|
-
var r1 =
|
|
1224
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1225
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1226
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1227
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1228
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1229
|
+
const ptr2 = passStringToWasm03(output_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1230
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1231
|
+
const ptr3 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1232
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1233
|
+
wasm3.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
|
|
1234
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1235
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
603
1236
|
deferred5_0 = r0;
|
|
604
1237
|
deferred5_1 = r1;
|
|
605
|
-
return
|
|
1238
|
+
return getStringFromWasm03(r0, r1);
|
|
606
1239
|
} finally {
|
|
607
|
-
|
|
608
|
-
|
|
1240
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1241
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
609
1242
|
}
|
|
610
1243
|
}
|
|
611
|
-
function
|
|
1244
|
+
function canonicalize3(input, input_format_sel, mode, pretty, indent, spaces_around_values) {
|
|
612
1245
|
let deferred4_0;
|
|
613
1246
|
let deferred4_1;
|
|
614
1247
|
try {
|
|
615
|
-
const retptr =
|
|
616
|
-
const ptr0 =
|
|
617
|
-
const len0 =
|
|
618
|
-
const ptr1 =
|
|
619
|
-
const len1 =
|
|
620
|
-
const ptr2 =
|
|
621
|
-
const len2 =
|
|
622
|
-
|
|
623
|
-
var r0 =
|
|
624
|
-
var r1 =
|
|
1248
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1249
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1250
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1251
|
+
const ptr1 = passStringToWasm03(input_format_sel, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1252
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1253
|
+
const ptr2 = passStringToWasm03(mode, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1254
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1255
|
+
wasm3.canonicalize(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, spaces_around_values);
|
|
1256
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1257
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
625
1258
|
deferred4_0 = r0;
|
|
626
1259
|
deferred4_1 = r1;
|
|
627
|
-
return
|
|
1260
|
+
return getStringFromWasm03(r0, r1);
|
|
628
1261
|
} finally {
|
|
629
|
-
|
|
630
|
-
|
|
1262
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1263
|
+
wasm3.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
631
1264
|
}
|
|
632
1265
|
}
|
|
633
|
-
function
|
|
1266
|
+
function count_bits3(input) {
|
|
634
1267
|
let deferred2_0;
|
|
635
1268
|
let deferred2_1;
|
|
636
1269
|
try {
|
|
637
|
-
const retptr =
|
|
638
|
-
const ptr0 =
|
|
639
|
-
const len0 =
|
|
640
|
-
|
|
641
|
-
var r0 =
|
|
642
|
-
var r1 =
|
|
1270
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1271
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1272
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1273
|
+
wasm3.count_bits(retptr, ptr0, len0);
|
|
1274
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1275
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
643
1276
|
deferred2_0 = r0;
|
|
644
1277
|
deferred2_1 = r1;
|
|
645
|
-
return
|
|
1278
|
+
return getStringFromWasm03(r0, r1);
|
|
646
1279
|
} finally {
|
|
647
|
-
|
|
648
|
-
|
|
1280
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1281
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
649
1282
|
}
|
|
650
1283
|
}
|
|
651
|
-
function
|
|
1284
|
+
function split_bits3(input) {
|
|
652
1285
|
let deferred2_0;
|
|
653
1286
|
let deferred2_1;
|
|
654
1287
|
try {
|
|
655
|
-
const retptr =
|
|
656
|
-
const ptr0 =
|
|
657
|
-
const len0 =
|
|
658
|
-
|
|
659
|
-
var r0 =
|
|
660
|
-
var r1 =
|
|
1288
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1289
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1290
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1291
|
+
wasm3.split_bits(retptr, ptr0, len0);
|
|
1292
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1293
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
661
1294
|
deferred2_0 = r0;
|
|
662
1295
|
deferred2_1 = r1;
|
|
663
|
-
return
|
|
1296
|
+
return getStringFromWasm03(r0, r1);
|
|
664
1297
|
} finally {
|
|
665
|
-
|
|
666
|
-
|
|
1298
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1299
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
667
1300
|
}
|
|
668
1301
|
}
|
|
669
|
-
function
|
|
670
|
-
const ptr0 =
|
|
671
|
-
const len0 =
|
|
672
|
-
const ret =
|
|
1302
|
+
function is_bitmark3(input) {
|
|
1303
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1304
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1305
|
+
const ret = wasm3.is_bitmark(ptr0, len0);
|
|
673
1306
|
return ret !== 0;
|
|
674
1307
|
}
|
|
675
|
-
function
|
|
1308
|
+
function split_json_bits3(input) {
|
|
676
1309
|
let deferred2_0;
|
|
677
1310
|
let deferred2_1;
|
|
678
1311
|
try {
|
|
679
|
-
const retptr =
|
|
680
|
-
const ptr0 =
|
|
681
|
-
const len0 =
|
|
682
|
-
|
|
683
|
-
var r0 =
|
|
684
|
-
var r1 =
|
|
1312
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1313
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1314
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1315
|
+
wasm3.split_json_bits(retptr, ptr0, len0);
|
|
1316
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1317
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
685
1318
|
deferred2_0 = r0;
|
|
686
1319
|
deferred2_1 = r1;
|
|
687
|
-
return
|
|
1320
|
+
return getStringFromWasm03(r0, r1);
|
|
688
1321
|
} finally {
|
|
689
|
-
|
|
690
|
-
|
|
1322
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1323
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
691
1324
|
}
|
|
692
1325
|
}
|
|
693
|
-
function
|
|
1326
|
+
function prettify3(json, indent) {
|
|
694
1327
|
let deferred2_0;
|
|
695
1328
|
let deferred2_1;
|
|
696
1329
|
try {
|
|
697
|
-
const retptr =
|
|
698
|
-
const ptr0 =
|
|
699
|
-
const len0 =
|
|
700
|
-
|
|
701
|
-
var r0 =
|
|
702
|
-
var r1 =
|
|
1330
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1331
|
+
const ptr0 = passStringToWasm03(json, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1332
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1333
|
+
wasm3.prettify(retptr, ptr0, len0, indent);
|
|
1334
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1335
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
703
1336
|
deferred2_0 = r0;
|
|
704
1337
|
deferred2_1 = r1;
|
|
705
|
-
return
|
|
1338
|
+
return getStringFromWasm03(r0, r1);
|
|
706
1339
|
} finally {
|
|
707
|
-
|
|
708
|
-
|
|
1340
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1341
|
+
wasm3.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
709
1342
|
}
|
|
710
1343
|
}
|
|
711
|
-
function
|
|
1344
|
+
function convert_text3(input, direction, format, location) {
|
|
712
1345
|
let deferred5_0;
|
|
713
1346
|
let deferred5_1;
|
|
714
1347
|
try {
|
|
715
|
-
const retptr =
|
|
716
|
-
const ptr0 =
|
|
717
|
-
const len0 =
|
|
718
|
-
const ptr1 =
|
|
719
|
-
const len1 =
|
|
720
|
-
const ptr2 =
|
|
721
|
-
const len2 =
|
|
722
|
-
const ptr3 =
|
|
723
|
-
const len3 =
|
|
724
|
-
|
|
725
|
-
var r0 =
|
|
726
|
-
var r1 =
|
|
1348
|
+
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1349
|
+
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1350
|
+
const len0 = WASM_VECTOR_LEN3;
|
|
1351
|
+
const ptr1 = passStringToWasm03(direction, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1352
|
+
const len1 = WASM_VECTOR_LEN3;
|
|
1353
|
+
const ptr2 = passStringToWasm03(format, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1354
|
+
const len2 = WASM_VECTOR_LEN3;
|
|
1355
|
+
const ptr3 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1356
|
+
const len3 = WASM_VECTOR_LEN3;
|
|
1357
|
+
wasm3.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1358
|
+
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1359
|
+
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
727
1360
|
deferred5_0 = r0;
|
|
728
1361
|
deferred5_1 = r1;
|
|
729
|
-
return
|
|
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);
|
|
1362
|
+
return getStringFromWasm03(r0, r1);
|
|
756
1363
|
} finally {
|
|
757
|
-
|
|
758
|
-
|
|
1364
|
+
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1365
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
759
1366
|
}
|
|
760
1367
|
}
|
|
761
|
-
async function
|
|
1368
|
+
async function __wbg_load3(module, imports) {
|
|
762
1369
|
if (typeof Response === "function" && module instanceof Response) {
|
|
763
1370
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
764
1371
|
try {
|
|
@@ -782,22 +1389,22 @@ async function __wbg_load2(module, imports) {
|
|
|
782
1389
|
}
|
|
783
1390
|
}
|
|
784
1391
|
}
|
|
785
|
-
function
|
|
1392
|
+
function __wbg_get_imports3() {
|
|
786
1393
|
const imports = {};
|
|
787
1394
|
imports.wbg = {};
|
|
788
1395
|
return imports;
|
|
789
1396
|
}
|
|
790
|
-
function
|
|
1397
|
+
function __wbg_init_memory3(imports, memory) {
|
|
791
1398
|
}
|
|
792
|
-
function
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
return
|
|
1399
|
+
function __wbg_finalize_init3(instance, module) {
|
|
1400
|
+
wasm3 = instance.exports;
|
|
1401
|
+
__wbg_init3.__wbindgen_wasm_module = module;
|
|
1402
|
+
cachedDataViewMemory03 = null;
|
|
1403
|
+
cachedUint8ArrayMemory03 = null;
|
|
1404
|
+
return wasm3;
|
|
798
1405
|
}
|
|
799
|
-
function
|
|
800
|
-
if (
|
|
1406
|
+
function initSync3(module) {
|
|
1407
|
+
if (wasm3 !== void 0) return wasm3;
|
|
801
1408
|
if (typeof module !== "undefined") {
|
|
802
1409
|
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
803
1410
|
({ module } = module);
|
|
@@ -805,16 +1412,16 @@ function initSync2(module) {
|
|
|
805
1412
|
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
806
1413
|
}
|
|
807
1414
|
}
|
|
808
|
-
const imports =
|
|
809
|
-
|
|
1415
|
+
const imports = __wbg_get_imports3();
|
|
1416
|
+
__wbg_init_memory3(imports);
|
|
810
1417
|
if (!(module instanceof WebAssembly.Module)) {
|
|
811
1418
|
module = new WebAssembly.Module(module);
|
|
812
1419
|
}
|
|
813
1420
|
const instance = new WebAssembly.Instance(module, imports);
|
|
814
|
-
return
|
|
1421
|
+
return __wbg_finalize_init3(instance, module);
|
|
815
1422
|
}
|
|
816
|
-
async function
|
|
817
|
-
if (
|
|
1423
|
+
async function __wbg_init3(module_or_path) {
|
|
1424
|
+
if (wasm3 !== void 0) return wasm3;
|
|
818
1425
|
if (typeof module_or_path !== "undefined") {
|
|
819
1426
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
820
1427
|
({ module_or_path } = module_or_path);
|
|
@@ -825,32 +1432,39 @@ async function __wbg_init2(module_or_path) {
|
|
|
825
1432
|
if (typeof module_or_path === "undefined") {
|
|
826
1433
|
module_or_path = new URL("bitmark_json_wasm_bg.wasm", import.meta.url);
|
|
827
1434
|
}
|
|
828
|
-
const imports =
|
|
1435
|
+
const imports = __wbg_get_imports3();
|
|
829
1436
|
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
830
1437
|
module_or_path = fetch(module_or_path);
|
|
831
1438
|
}
|
|
832
|
-
|
|
833
|
-
const { instance, module } = await
|
|
834
|
-
return
|
|
1439
|
+
__wbg_init_memory3(imports);
|
|
1440
|
+
const { instance, module } = await __wbg_load3(await module_or_path, imports);
|
|
1441
|
+
return __wbg_finalize_init3(instance, module);
|
|
835
1442
|
}
|
|
836
|
-
var bitmark_json_wasm_default =
|
|
1443
|
+
var bitmark_json_wasm_default = __wbg_init3;
|
|
837
1444
|
|
|
838
1445
|
// src/generated/package_info.ts
|
|
839
1446
|
var PACKAGE_INFO = {
|
|
840
1447
|
"name": "@gmb/bitmark-parser",
|
|
841
|
-
"version": "6.
|
|
1448
|
+
"version": "6.11.1",
|
|
842
1449
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
843
1450
|
"license": "ISC",
|
|
844
1451
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
845
1452
|
};
|
|
846
1453
|
|
|
847
1454
|
// src/core/facade.ts
|
|
1455
|
+
var BROWSER_DEFAULT_FEATURE = "browser-full";
|
|
848
1456
|
var NotInitializedError = class extends Error {
|
|
849
1457
|
constructor() {
|
|
850
1458
|
super("wasm not initialised: call init() (or init({ feature: \u2026 })) first");
|
|
851
1459
|
this.name = "NotInitializedError";
|
|
852
1460
|
}
|
|
853
1461
|
};
|
|
1462
|
+
var RegisterError = class extends Error {
|
|
1463
|
+
constructor(message) {
|
|
1464
|
+
super(message);
|
|
1465
|
+
this.name = "RegisterError";
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
854
1468
|
var UnsupportedFeatureError = class extends Error {
|
|
855
1469
|
constructor(what, active2) {
|
|
856
1470
|
super(
|
|
@@ -862,15 +1476,23 @@ var UnsupportedFeatureError = class extends Error {
|
|
|
862
1476
|
var active;
|
|
863
1477
|
var activeFeature;
|
|
864
1478
|
var lazyLoader;
|
|
1479
|
+
var registrations = /* @__PURE__ */ new Map();
|
|
865
1480
|
function getActive() {
|
|
866
1481
|
if (!active && lazyLoader) lazyLoader();
|
|
867
1482
|
if (!active) throw new NotInitializedError();
|
|
868
1483
|
return active;
|
|
869
1484
|
}
|
|
870
1485
|
function setActive(feature, module) {
|
|
1486
|
+
for (const [type, data] of registrations) {
|
|
1487
|
+
const error = module.register(type, data);
|
|
1488
|
+
if (error) throw new RegisterError(error.replace(/^error:\s*/, ""));
|
|
1489
|
+
}
|
|
871
1490
|
active = module;
|
|
872
1491
|
activeFeature = feature;
|
|
873
1492
|
}
|
|
1493
|
+
function rememberRegistration(type, data) {
|
|
1494
|
+
registrations.set(type, data);
|
|
1495
|
+
}
|
|
874
1496
|
function variant() {
|
|
875
1497
|
return activeFeature;
|
|
876
1498
|
}
|
|
@@ -887,17 +1509,14 @@ function stripArray(doc) {
|
|
|
887
1509
|
const t = doc.trim();
|
|
888
1510
|
return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : doc;
|
|
889
1511
|
}
|
|
890
|
-
function
|
|
891
|
-
if (patch === void 0) return
|
|
892
|
-
if (typeof patch === "string")
|
|
893
|
-
|
|
894
|
-
return trimmed === "" ? [] : JSON.parse(trimmed);
|
|
895
|
-
}
|
|
896
|
-
return patch;
|
|
1512
|
+
function patchJsonOf(patch) {
|
|
1513
|
+
if (patch === void 0) return "";
|
|
1514
|
+
if (typeof patch === "string") return patch.trim();
|
|
1515
|
+
return JSON.stringify(patch);
|
|
897
1516
|
}
|
|
898
|
-
function buildUnits(
|
|
1517
|
+
function buildUnits(wasm4, input, inputIsBitmark) {
|
|
899
1518
|
if (inputIsBitmark) {
|
|
900
|
-
const out2 =
|
|
1519
|
+
const out2 = wasm4.split_bits(input);
|
|
901
1520
|
if (isError(out2)) throw new Error(out2);
|
|
902
1521
|
const slices = JSON.parse(out2);
|
|
903
1522
|
return slices.map((s) => ({
|
|
@@ -905,7 +1524,7 @@ function buildUnits(wasm3, input, inputIsBitmark) {
|
|
|
905
1524
|
source: s.source
|
|
906
1525
|
}));
|
|
907
1526
|
}
|
|
908
|
-
const out =
|
|
1527
|
+
const out = wasm4.split_json_bits(input);
|
|
909
1528
|
if (isError(out)) throw new Error(out);
|
|
910
1529
|
const envelopes = JSON.parse(out);
|
|
911
1530
|
return envelopes.map((env, index) => ({
|
|
@@ -914,42 +1533,70 @@ function buildUnits(wasm3, input, inputIsBitmark) {
|
|
|
914
1533
|
source: JSON.stringify([env])
|
|
915
1534
|
}));
|
|
916
1535
|
}
|
|
917
|
-
function planTransform(
|
|
1536
|
+
function planTransform(wasm4, input, options) {
|
|
918
1537
|
const mode = options.mode ?? "optimized";
|
|
919
1538
|
const output = options.outputFormat ?? "json";
|
|
920
1539
|
const spacesAroundValues = options.spacesAroundValues ?? 1;
|
|
921
1540
|
const indent = options.indent ?? 2;
|
|
922
1541
|
const pretty = options.pretty ?? false;
|
|
923
1542
|
const sel = options.inputFormat ?? "auto";
|
|
924
|
-
const inputIsBitmark = sel === "bitmark" || sel !== "json" &&
|
|
1543
|
+
const inputIsBitmark = sel === "bitmark" || sel !== "json" && wasm4.is_bitmark(input);
|
|
925
1544
|
const inputFormat = inputIsBitmark ? "bitmark" : "json";
|
|
926
|
-
const
|
|
927
|
-
const units = buildUnits(wasm3, input, inputIsBitmark);
|
|
1545
|
+
const units = buildUnits(wasm4, input, inputIsBitmark);
|
|
928
1546
|
const total = units.length;
|
|
929
|
-
const
|
|
930
|
-
const views = [];
|
|
1547
|
+
const hooked = [];
|
|
931
1548
|
for (let index = 0; index < total; index++) {
|
|
932
|
-
const { view
|
|
1549
|
+
const { view } = units[index];
|
|
933
1550
|
view.index = index;
|
|
934
1551
|
view.total = total;
|
|
935
1552
|
const result = options.preHook ? options.preHook(view) || {} : {};
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1553
|
+
hooked.push(result.drop ? null : { patches: result.patches ?? [], outputFormat: result.outputFormat ?? output });
|
|
1554
|
+
}
|
|
1555
|
+
const patchJson = patchJsonOf(options.patch);
|
|
1556
|
+
let resolved;
|
|
1557
|
+
if (patchJson === "") {
|
|
1558
|
+
resolved = units.map((_, index) => ({ source: index, bit: null, patch: [] }));
|
|
1559
|
+
} else {
|
|
1560
|
+
const out = wasm4.resolve_patch_document(input, patchJson);
|
|
1561
|
+
if (isError(out)) throw new Error(out);
|
|
1562
|
+
resolved = JSON.parse(out);
|
|
1563
|
+
}
|
|
1564
|
+
const jobs = [];
|
|
1565
|
+
const views = [];
|
|
1566
|
+
for (const item of resolved) {
|
|
1567
|
+
if (item.source !== null) {
|
|
1568
|
+
const hook = hooked[item.source];
|
|
1569
|
+
if (!hook) continue;
|
|
1570
|
+
jobs.push({
|
|
1571
|
+
index: item.source,
|
|
1572
|
+
source: units[item.source].source,
|
|
1573
|
+
inputFormat,
|
|
1574
|
+
outputFormat: hook.outputFormat,
|
|
1575
|
+
mode,
|
|
1576
|
+
// The document's patches first, the hook's after (the hook contract).
|
|
1577
|
+
patchJson: JSON.stringify([...item.patch, ...hook.patches]),
|
|
1578
|
+
spacesAroundValues
|
|
1579
|
+
});
|
|
1580
|
+
views.push(units[item.source].view);
|
|
1581
|
+
} else {
|
|
1582
|
+
const bit = item.bit ?? {};
|
|
1583
|
+
const index = jobs.length;
|
|
1584
|
+
jobs.push({
|
|
1585
|
+
index,
|
|
1586
|
+
source: JSON.stringify([{ bit }]),
|
|
1587
|
+
inputFormat: "json",
|
|
1588
|
+
outputFormat: output,
|
|
1589
|
+
mode,
|
|
1590
|
+
patchJson: JSON.stringify(item.patch),
|
|
1591
|
+
spacesAroundValues
|
|
1592
|
+
});
|
|
1593
|
+
views.push({ format: "json", index, total, bit });
|
|
1594
|
+
}
|
|
948
1595
|
}
|
|
949
1596
|
return { jobs, views, output, pretty, indent };
|
|
950
1597
|
}
|
|
951
|
-
function computeBit(
|
|
952
|
-
const out =
|
|
1598
|
+
function computeBit(wasm4, job) {
|
|
1599
|
+
const out = wasm4.transform(
|
|
953
1600
|
job.source,
|
|
954
1601
|
job.inputFormat,
|
|
955
1602
|
job.outputFormat,
|
|
@@ -962,33 +1609,33 @@ function computeBit(wasm3, job) {
|
|
|
962
1609
|
if (isError(out)) return out;
|
|
963
1610
|
return job.outputFormat === "json" ? stripArray(out) : out;
|
|
964
1611
|
}
|
|
965
|
-
function recombine(
|
|
1612
|
+
function recombine(wasm4, elements, output, pretty, indent) {
|
|
966
1613
|
if (output === "bitmark" || output === "text") return elements.join("\n");
|
|
967
1614
|
const arr = `[${elements.join(",")}]`;
|
|
968
|
-
return pretty ?
|
|
1615
|
+
return pretty ? wasm4.prettify(arr, indent) : arr;
|
|
969
1616
|
}
|
|
970
|
-
function runHookedTransform(
|
|
1617
|
+
function runHookedTransform(wasm4, input, options) {
|
|
971
1618
|
let plan;
|
|
972
1619
|
try {
|
|
973
|
-
plan = planTransform(
|
|
1620
|
+
plan = planTransform(wasm4, input, options);
|
|
974
1621
|
} catch (e) {
|
|
975
1622
|
return errorString(e);
|
|
976
1623
|
}
|
|
977
1624
|
const rendered = [];
|
|
978
1625
|
for (let i = 0; i < plan.jobs.length; i++) {
|
|
979
|
-
const element = computeBit(
|
|
1626
|
+
const element = computeBit(wasm4, plan.jobs[i]);
|
|
980
1627
|
if (isError(element)) return element;
|
|
981
1628
|
options.postHook?.(plan.views[i], element);
|
|
982
1629
|
rendered.push(element);
|
|
983
1630
|
}
|
|
984
|
-
return recombine(
|
|
1631
|
+
return recombine(wasm4, rendered, plan.output, plan.pretty, plan.indent);
|
|
985
1632
|
}
|
|
986
1633
|
|
|
987
1634
|
// src/core/parallel.ts
|
|
988
|
-
async function orchestrateParallel(
|
|
1635
|
+
async function orchestrateParallel(wasm4, input, options, runJobs) {
|
|
989
1636
|
let plan;
|
|
990
1637
|
try {
|
|
991
|
-
plan = planTransform(
|
|
1638
|
+
plan = planTransform(wasm4, input, options);
|
|
992
1639
|
} catch (e) {
|
|
993
1640
|
return errorString(e);
|
|
994
1641
|
}
|
|
@@ -1002,7 +1649,7 @@ async function orchestrateParallel(wasm3, input, options, runJobs) {
|
|
|
1002
1649
|
if (isError(elements[i])) return elements[i];
|
|
1003
1650
|
options.postHook?.(plan.views[i], elements[i]);
|
|
1004
1651
|
}
|
|
1005
|
-
return recombine(
|
|
1652
|
+
return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
|
|
1006
1653
|
}
|
|
1007
1654
|
|
|
1008
1655
|
// src/legacy/runtime.ts
|
|
@@ -1149,9 +1796,9 @@ function validateJsonOptions(o) {
|
|
|
1149
1796
|
if (o.textAsPlainText) unsupportedOption("jsonOptions.textAsPlainText", V3_ONLY);
|
|
1150
1797
|
if (o.debugGenerationInline) unsupportedOption("jsonOptions.debugGenerationInline");
|
|
1151
1798
|
}
|
|
1152
|
-
function prettyIndent(
|
|
1153
|
-
if (
|
|
1154
|
-
if (typeof
|
|
1799
|
+
function prettyIndent(prettify4) {
|
|
1800
|
+
if (prettify4 === true) return { pretty: true, indent: 2 };
|
|
1801
|
+
if (typeof prettify4 === "number" && prettify4 > 0) return { pretty: true, indent: prettify4 };
|
|
1155
1802
|
return { pretty: false, indent: 2 };
|
|
1156
1803
|
}
|
|
1157
1804
|
function spacesAround(v) {
|
|
@@ -1251,7 +1898,7 @@ var Builder = class {
|
|
|
1251
1898
|
* more than one resource, use the first one").
|
|
1252
1899
|
*/
|
|
1253
1900
|
buildBit(data, _options) {
|
|
1254
|
-
const
|
|
1901
|
+
const wasm4 = getLegacyWasm();
|
|
1255
1902
|
const src = { ...data };
|
|
1256
1903
|
const bitType = src.bitType;
|
|
1257
1904
|
const bitConfig = this.getBitConfig(bitType);
|
|
@@ -1312,7 +1959,7 @@ var Builder = class {
|
|
|
1312
1959
|
}
|
|
1313
1960
|
}
|
|
1314
1961
|
this.parseStringTexts(bit);
|
|
1315
|
-
const out =
|
|
1962
|
+
const out = wasm4.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
|
|
1316
1963
|
if (out.startsWith("error:")) {
|
|
1317
1964
|
throw new Error(out.slice("error:".length).trim());
|
|
1318
1965
|
}
|
|
@@ -1368,10 +2015,10 @@ var Builder = class {
|
|
|
1368
2015
|
* (bpg TextParser.toAst ignores format; only location matters).
|
|
1369
2016
|
*/
|
|
1370
2017
|
parseStringTexts(bit) {
|
|
1371
|
-
const
|
|
2018
|
+
const wasm4 = getLegacyWasm();
|
|
1372
2019
|
const toAst = (s, location) => {
|
|
1373
2020
|
if (s === "") return s;
|
|
1374
|
-
const out =
|
|
2021
|
+
const out = wasm4.convert_text(s, "textToAst", "bitmark++", location);
|
|
1375
2022
|
try {
|
|
1376
2023
|
return JSON.parse(out);
|
|
1377
2024
|
} catch {
|
|
@@ -1401,11 +2048,11 @@ var Builder = class {
|
|
|
1401
2048
|
* unknown-bit-type error (`Config.getBitConfig` parity).
|
|
1402
2049
|
*/
|
|
1403
2050
|
getBitConfig(bitType) {
|
|
1404
|
-
const
|
|
2051
|
+
const wasm4 = getLegacyWasm();
|
|
1405
2052
|
if (bitType !== void 0) {
|
|
1406
2053
|
try {
|
|
1407
|
-
const
|
|
1408
|
-
if (
|
|
2054
|
+
const info5 = JSON.parse(wasm4.info("bit", "json", bitType, false, 2, false, false, true, ""));
|
|
2055
|
+
if (info5.error === void 0) return { bodyFormat: info5.body?.format };
|
|
1409
2056
|
} catch {
|
|
1410
2057
|
}
|
|
1411
2058
|
}
|
|
@@ -1444,7 +2091,7 @@ var BitmarkParserGenerator = class {
|
|
|
1444
2091
|
validateBitmarkOptions(bitmarkOptions);
|
|
1445
2092
|
validateJsonOptions(jsonOptions);
|
|
1446
2093
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1447
|
-
const
|
|
2094
|
+
const wasm4 = getLegacyWasm();
|
|
1448
2095
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1449
2096
|
const outputFormat = opts.outputFormat ?? (isBitmark ? "json" : "bitmark");
|
|
1450
2097
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
@@ -1452,7 +2099,7 @@ var BitmarkParserGenerator = class {
|
|
|
1452
2099
|
const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
|
|
1453
2100
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1454
2101
|
const includeUnknown = !jsonOptions.excludeUnknownProperties;
|
|
1455
|
-
const out =
|
|
2102
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
|
|
1456
2103
|
this.throwOnError(out);
|
|
1457
2104
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1458
2105
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1480,13 +2127,13 @@ var BitmarkParserGenerator = class {
|
|
|
1480
2127
|
validateBitmarkOptions(bitmarkOptions);
|
|
1481
2128
|
validateJsonOptions(jsonOptions);
|
|
1482
2129
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1483
|
-
const
|
|
2130
|
+
const wasm4 = getLegacyWasm();
|
|
1484
2131
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1485
2132
|
const { pretty, indent } = prettyIndent(
|
|
1486
2133
|
isBitmark ? bitmarkOptions.prettifyJson : jsonOptions.prettify
|
|
1487
2134
|
);
|
|
1488
2135
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1489
|
-
const out =
|
|
2136
|
+
const out = wasm4.canonicalize(source, isBitmark ? "bitmark" : "json", "optimized", pretty, indent, spaces);
|
|
1490
2137
|
this.throwOnError(out);
|
|
1491
2138
|
if (isBitmark) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
1492
2139
|
if (opts.outputFile) return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1498,12 +2145,12 @@ var BitmarkParserGenerator = class {
|
|
|
1498
2145
|
*/
|
|
1499
2146
|
info(options) {
|
|
1500
2147
|
const opts = Object.assign({}, options);
|
|
1501
|
-
const
|
|
2148
|
+
const wasm4 = getLegacyWasm();
|
|
1502
2149
|
const type = opts.type ?? "list";
|
|
1503
2150
|
const format = opts.outputFormat ?? "text";
|
|
1504
2151
|
const { pretty, indent } = prettyIndent(opts.prettify);
|
|
1505
2152
|
const coreFormat = format === "pojo" ? "json" : format;
|
|
1506
|
-
const out =
|
|
2153
|
+
const out = wasm4.info(type, coreFormat, opts.bit ?? "", pretty, indent, false, false, true, "");
|
|
1507
2154
|
this.throwOnError(out);
|
|
1508
2155
|
if (format === "pojo") return JSON.parse(out);
|
|
1509
2156
|
return out;
|
|
@@ -1531,12 +2178,12 @@ var BitmarkParserGenerator = class {
|
|
|
1531
2178
|
if (opts.keepUnknownTags) unsupportedOption("keepUnknownTags");
|
|
1532
2179
|
if (opts.noBreakscaping) unsupportedOption("noBreakscaping");
|
|
1533
2180
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1534
|
-
const
|
|
2181
|
+
const wasm4 = getLegacyWasm();
|
|
1535
2182
|
const inStr = typeof input === "string" ? this.maybeReadFile(input, void 0) : "";
|
|
1536
2183
|
const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
|
|
1537
2184
|
if (!isHtmlInput) {
|
|
1538
2185
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1539
|
-
const out2 =
|
|
2186
|
+
const out2 = wasm4.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
|
|
1540
2187
|
this.throwOnError(out2);
|
|
1541
2188
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1542
2189
|
}
|
|
@@ -1546,12 +2193,12 @@ var BitmarkParserGenerator = class {
|
|
|
1546
2193
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
1547
2194
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1548
2195
|
if (outputFormat === "html") {
|
|
1549
|
-
const out2 =
|
|
2196
|
+
const out2 = wasm4.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
|
|
1550
2197
|
this.throwOnError(out2);
|
|
1551
2198
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1552
2199
|
}
|
|
1553
2200
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
1554
|
-
const out =
|
|
2201
|
+
const out = wasm4.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
|
|
1555
2202
|
this.throwOnError(out);
|
|
1556
2203
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1557
2204
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1574,9 +2221,9 @@ var BitmarkParserGenerator = class {
|
|
|
1574
2221
|
*/
|
|
1575
2222
|
createAst(input, options) {
|
|
1576
2223
|
const opts = Object.assign({}, options);
|
|
1577
|
-
const
|
|
2224
|
+
const wasm4 = getLegacyWasm();
|
|
1578
2225
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1579
|
-
const out =
|
|
2226
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
|
|
1580
2227
|
this.throwOnError(out);
|
|
1581
2228
|
return makePseudoAst(JSON.parse(out));
|
|
1582
2229
|
}
|
|
@@ -1587,9 +2234,9 @@ var BitmarkParserGenerator = class {
|
|
|
1587
2234
|
if (!input) return input;
|
|
1588
2235
|
const opts = Object.assign({}, options);
|
|
1589
2236
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1590
|
-
const
|
|
2237
|
+
const wasm4 = getLegacyWasm();
|
|
1591
2238
|
const inStr = this.maybeReadFile(input, opts.inputFormat);
|
|
1592
|
-
const res =
|
|
2239
|
+
const res = wasm4.breakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
|
|
1593
2240
|
return this.deliver(res, opts.outputFile, opts.fileOptions);
|
|
1594
2241
|
}
|
|
1595
2242
|
/**
|
|
@@ -1599,9 +2246,9 @@ var BitmarkParserGenerator = class {
|
|
|
1599
2246
|
if (!input) return input;
|
|
1600
2247
|
const opts = Object.assign({}, options);
|
|
1601
2248
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1602
|
-
const
|
|
2249
|
+
const wasm4 = getLegacyWasm();
|
|
1603
2250
|
const inStr = this.maybeReadFile(input, opts.inputFormat);
|
|
1604
|
-
const res =
|
|
2251
|
+
const res = wasm4.unbreakscape_text(inStr, mapTextFormat(opts.textFormat), opts.textLocation ?? "body");
|
|
1605
2252
|
return this.deliver(res, opts.outputFile, opts.fileOptions);
|
|
1606
2253
|
}
|
|
1607
2254
|
/**
|
|
@@ -1615,7 +2262,7 @@ var BitmarkParserGenerator = class {
|
|
|
1615
2262
|
const opts = Object.assign({}, options);
|
|
1616
2263
|
const jsonOptions = Object.assign({}, opts.jsonOptions);
|
|
1617
2264
|
this.checkBrowserFileWrite(opts.outputFile);
|
|
1618
|
-
const
|
|
2265
|
+
const wasm4 = getLegacyWasm();
|
|
1619
2266
|
const isBitmarkText = opts.textFormat === void 0 || mapTextFormat(opts.textFormat) === "bitmark++";
|
|
1620
2267
|
const textLocation = opts.textLocation ?? "body";
|
|
1621
2268
|
let inStr;
|
|
@@ -1628,14 +2275,14 @@ var BitmarkParserGenerator = class {
|
|
|
1628
2275
|
ast = Array.isArray(input) ? input : void 0;
|
|
1629
2276
|
}
|
|
1630
2277
|
if (ast !== void 0) {
|
|
1631
|
-
const out2 = isBitmarkText ?
|
|
2278
|
+
const out2 = isBitmarkText ? wasm4.convert_text(JSON.stringify(ast), "astToText", "bitmark++", textLocation) : wasm4.convert_text(JSON.stringify(ast), "astToPlainText", "plainText", textLocation);
|
|
1632
2279
|
this.throwOnError(out2);
|
|
1633
2280
|
return this.deliver(out2, opts.outputFile, opts.fileOptions);
|
|
1634
2281
|
}
|
|
1635
|
-
const out =
|
|
2282
|
+
const out = wasm4.convert_text(inStr, "textToAst", isBitmarkText ? "bitmark++" : "plainText", "body");
|
|
1636
2283
|
this.throwOnError(out);
|
|
1637
2284
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
1638
|
-
const outStr = pretty ?
|
|
2285
|
+
const outStr = pretty ? wasm4.prettify(out, indent) : out;
|
|
1639
2286
|
if (opts.outputFile) return this.deliver(outStr, opts.outputFile, opts.fileOptions);
|
|
1640
2287
|
if (pretty) return outStr;
|
|
1641
2288
|
return JSON.parse(out);
|
|
@@ -1644,8 +2291,8 @@ var BitmarkParserGenerator = class {
|
|
|
1644
2291
|
* Convert a text AST to plain text (bpg-compatible `textAstToPlainText`).
|
|
1645
2292
|
*/
|
|
1646
2293
|
textAstToPlainText(textAst, _options) {
|
|
1647
|
-
const
|
|
1648
|
-
const out =
|
|
2294
|
+
const wasm4 = getLegacyWasm();
|
|
2295
|
+
const out = wasm4.convert_text(
|
|
1649
2296
|
typeof textAst === "string" ? textAst : JSON.stringify(textAst),
|
|
1650
2297
|
"astToPlainText",
|
|
1651
2298
|
"bitmark++",
|
|
@@ -1659,17 +2306,17 @@ var BitmarkParserGenerator = class {
|
|
|
1659
2306
|
*/
|
|
1660
2307
|
extractPlainText(input, options) {
|
|
1661
2308
|
const inputFormat = options?.inputFormat;
|
|
1662
|
-
const
|
|
2309
|
+
const wasm4 = getLegacyWasm();
|
|
1663
2310
|
if (inputFormat === "plainText") {
|
|
1664
2311
|
return typeof input === "string" ? String(input) : "";
|
|
1665
2312
|
}
|
|
1666
2313
|
if (inputFormat === "bitmarkText") {
|
|
1667
|
-
const ast =
|
|
1668
|
-
const out2 =
|
|
2314
|
+
const ast = wasm4.convert_text(String(input), "textToAst", "bitmark++", "body");
|
|
2315
|
+
const out2 = wasm4.convert_text(ast, "astToPlainText", "bitmark++", "body");
|
|
1669
2316
|
this.throwOnError(out2);
|
|
1670
2317
|
return out2;
|
|
1671
2318
|
}
|
|
1672
|
-
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !
|
|
2319
|
+
if (typeof input === "string" && this.parseTextAstString(input) === void 0 && !wasm4.is_bitmark(input)) {
|
|
1673
2320
|
const looksJson = (() => {
|
|
1674
2321
|
try {
|
|
1675
2322
|
JSON.parse(input);
|
|
@@ -1683,7 +2330,7 @@ var BitmarkParserGenerator = class {
|
|
|
1683
2330
|
}
|
|
1684
2331
|
}
|
|
1685
2332
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1686
|
-
const out =
|
|
2333
|
+
const out = wasm4.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
|
|
1687
2334
|
this.throwOnError(out);
|
|
1688
2335
|
return out;
|
|
1689
2336
|
}
|
|
@@ -1717,8 +2364,8 @@ var BitmarkParserGenerator = class {
|
|
|
1717
2364
|
};
|
|
1718
2365
|
}
|
|
1719
2366
|
const inStr = this.maybeReadFile(input, inputFormat);
|
|
1720
|
-
const
|
|
1721
|
-
if (
|
|
2367
|
+
const wasm4 = getLegacyWasm();
|
|
2368
|
+
if (wasm4.is_bitmark(inStr)) return { source: inStr, isBitmark: true };
|
|
1722
2369
|
try {
|
|
1723
2370
|
const parsed = JSON.parse(inStr);
|
|
1724
2371
|
const entries = this.jsonEntries(parsed);
|
|
@@ -2087,8 +2734,8 @@ function bitNameToKey(name) {
|
|
|
2087
2734
|
var bitTypeCache;
|
|
2088
2735
|
function loadBitTypes() {
|
|
2089
2736
|
if (!bitTypeCache) {
|
|
2090
|
-
const
|
|
2091
|
-
const all = JSON.parse(
|
|
2737
|
+
const wasm4 = getLegacyWasm();
|
|
2738
|
+
const all = JSON.parse(wasm4.info("all", "json", "", false, 2, true, false, false, ""));
|
|
2092
2739
|
const map = { _standard: "_standard" };
|
|
2093
2740
|
for (const { name } of all) {
|
|
2094
2741
|
map[bitNameToKey(name)] = name;
|
|
@@ -2159,12 +2806,13 @@ var StreamWriter = stubClass("StreamWriter", INTERNAL_REASON);
|
|
|
2159
2806
|
function patchEntry(path, op, value) {
|
|
2160
2807
|
return value === void 0 ? { path, op } : { path, op, value };
|
|
2161
2808
|
}
|
|
2809
|
+
var ALL_LANGUAGES = "all";
|
|
2162
2810
|
|
|
2163
2811
|
// src/core/api.ts
|
|
2164
|
-
function
|
|
2165
|
-
const
|
|
2166
|
-
if (typeof
|
|
2167
|
-
return
|
|
2812
|
+
function lex3(input, options = {}) {
|
|
2813
|
+
const wasm4 = getActive();
|
|
2814
|
+
if (typeof wasm4.lex !== "function") throw new UnsupportedFeatureError("lex", variant());
|
|
2815
|
+
return wasm4.lex(input, options.stage ?? "lex");
|
|
2168
2816
|
}
|
|
2169
2817
|
function bitmarkToObjects(input, options = {}) {
|
|
2170
2818
|
const out = getActive().convert(
|
|
@@ -2199,7 +2847,7 @@ function objectsToBitmark(bits, options = {}) {
|
|
|
2199
2847
|
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2200
2848
|
return out;
|
|
2201
2849
|
}
|
|
2202
|
-
function
|
|
2850
|
+
function convert4(input, options = {}) {
|
|
2203
2851
|
return getActive().convert(
|
|
2204
2852
|
input,
|
|
2205
2853
|
options.inputFormat ?? "auto",
|
|
@@ -2212,7 +2860,7 @@ function convert3(input, options = {}) {
|
|
|
2212
2860
|
options.mappingReport ?? false
|
|
2213
2861
|
);
|
|
2214
2862
|
}
|
|
2215
|
-
function
|
|
2863
|
+
function canonicalize4(input, options = {}) {
|
|
2216
2864
|
return getActive().canonicalize(
|
|
2217
2865
|
input,
|
|
2218
2866
|
options.inputFormat ?? "auto",
|
|
@@ -2230,13 +2878,13 @@ function countBits(input) {
|
|
|
2230
2878
|
function splitBits(input) {
|
|
2231
2879
|
return JSON.parse(getActive().split_bits(input));
|
|
2232
2880
|
}
|
|
2233
|
-
function
|
|
2234
|
-
const
|
|
2881
|
+
function transform4(input, options = {}) {
|
|
2882
|
+
const wasm4 = getActive();
|
|
2235
2883
|
if (options.preHook || options.postHook) {
|
|
2236
|
-
return runHookedTransform(
|
|
2884
|
+
return runHookedTransform(wasm4, input, options);
|
|
2237
2885
|
}
|
|
2238
2886
|
const patchJson = options.patch === void 0 ? "" : typeof options.patch === "string" ? options.patch : JSON.stringify(options.patch);
|
|
2239
|
-
return
|
|
2887
|
+
return wasm4.transform(
|
|
2240
2888
|
input,
|
|
2241
2889
|
options.inputFormat ?? "auto",
|
|
2242
2890
|
options.outputFormat ?? "json",
|
|
@@ -2247,6 +2895,26 @@ function transform3(input, options = {}) {
|
|
|
2247
2895
|
options.spacesAroundValues ?? 1
|
|
2248
2896
|
);
|
|
2249
2897
|
}
|
|
2898
|
+
function diff3(a, b, options = {}) {
|
|
2899
|
+
const wasm4 = getActive();
|
|
2900
|
+
if (typeof wasm4.diff !== "function") throw new UnsupportedFeatureError("diff", variant());
|
|
2901
|
+
const out = wasm4.diff(
|
|
2902
|
+
a,
|
|
2903
|
+
b,
|
|
2904
|
+
options.inputFormat ?? "auto",
|
|
2905
|
+
options.outputFormat ?? "bitmark",
|
|
2906
|
+
options.context ?? 3,
|
|
2907
|
+
options.locate ?? false,
|
|
2908
|
+
options.similarity ?? 0.6,
|
|
2909
|
+
options.bboxTolerance ?? 8,
|
|
2910
|
+
options.spacesAroundValues ?? 0
|
|
2911
|
+
);
|
|
2912
|
+
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
2913
|
+
return out;
|
|
2914
|
+
}
|
|
2915
|
+
function diffBits(a, b, options = {}) {
|
|
2916
|
+
return JSON.parse(diff3(a, b, { ...options, outputFormat: "json" }));
|
|
2917
|
+
}
|
|
2250
2918
|
function breakscapeText(input, options = {}) {
|
|
2251
2919
|
const format = options.format ?? "bitmark++";
|
|
2252
2920
|
const location = options.location ?? "body";
|
|
@@ -2257,7 +2925,7 @@ function unbreakscapeText(input, options = {}) {
|
|
|
2257
2925
|
const location = options.location ?? "body";
|
|
2258
2926
|
return getActive().unbreakscape_text(input, format, location);
|
|
2259
2927
|
}
|
|
2260
|
-
function
|
|
2928
|
+
function info4(options = {}) {
|
|
2261
2929
|
const infoType = options.infoType ?? "list";
|
|
2262
2930
|
const format = options.format ?? "text";
|
|
2263
2931
|
const bit = options.bit ?? "";
|
|
@@ -2266,10 +2934,27 @@ function info3(options = {}) {
|
|
|
2266
2934
|
const includeDeprecated = options.includeDeprecated ?? false;
|
|
2267
2935
|
const onlyDeprecated = options.onlyDeprecated ?? false;
|
|
2268
2936
|
const full = options.full ?? false;
|
|
2269
|
-
|
|
2937
|
+
const language = typeof options.language === "string" ? options.language : options.language?.join(",") ?? "";
|
|
2938
|
+
return getActive().info(
|
|
2939
|
+
infoType,
|
|
2940
|
+
format,
|
|
2941
|
+
bit,
|
|
2942
|
+
pretty,
|
|
2943
|
+
indent,
|
|
2944
|
+
includeDeprecated,
|
|
2945
|
+
onlyDeprecated,
|
|
2946
|
+
full,
|
|
2947
|
+
language
|
|
2948
|
+
);
|
|
2949
|
+
}
|
|
2950
|
+
function register4(options) {
|
|
2951
|
+
const result = getActive().register(options.type, options.data);
|
|
2952
|
+
if (result) throw new RegisterError(result.replace(/^error:\s*/, ""));
|
|
2953
|
+
rememberRegistration(options.type, options.data);
|
|
2270
2954
|
}
|
|
2271
2955
|
|
|
2272
2956
|
// src/browser/index.ts
|
|
2957
|
+
var WASM_BASE = true ? "../wasm/" : "./";
|
|
2273
2958
|
var VARIANTS = {
|
|
2274
2959
|
full: {
|
|
2275
2960
|
init: bitmark_wasm_default,
|
|
@@ -2277,20 +2962,33 @@ var VARIANTS = {
|
|
|
2277
2962
|
ns: bitmark_wasm_exports,
|
|
2278
2963
|
wasmFile: "bitmark_wasm_bg.wasm"
|
|
2279
2964
|
},
|
|
2965
|
+
"browser-full": {
|
|
2966
|
+
init: bitmark_browser_full_wasm_default,
|
|
2967
|
+
initSync: initSync2,
|
|
2968
|
+
ns: bitmark_browser_full_wasm_exports,
|
|
2969
|
+
wasmFile: "bitmark_browser_full_wasm_bg.wasm"
|
|
2970
|
+
},
|
|
2280
2971
|
"bitmark-json": {
|
|
2281
2972
|
init: bitmark_json_wasm_default,
|
|
2282
|
-
initSync:
|
|
2973
|
+
initSync: initSync3,
|
|
2283
2974
|
ns: bitmark_json_wasm_exports,
|
|
2284
2975
|
wasmFile: "bitmark_json_wasm_bg.wasm"
|
|
2285
2976
|
}
|
|
2286
2977
|
};
|
|
2287
2978
|
setLegacyWasmProvider(() => getActive());
|
|
2979
|
+
function defaultFeatureFor(module_or_path) {
|
|
2980
|
+
return module_or_path === void 0 ? BROWSER_DEFAULT_FEATURE : "full";
|
|
2981
|
+
}
|
|
2288
2982
|
function normalizeInit(arg) {
|
|
2289
2983
|
if (arg !== null && typeof arg === "object" && !(arg instanceof URL) && ("feature" in arg || "module_or_path" in arg)) {
|
|
2290
2984
|
const o = arg;
|
|
2291
|
-
return {
|
|
2985
|
+
return {
|
|
2986
|
+
feature: o.feature ?? defaultFeatureFor(o.module_or_path),
|
|
2987
|
+
module_or_path: o.module_or_path
|
|
2988
|
+
};
|
|
2292
2989
|
}
|
|
2293
|
-
|
|
2990
|
+
const module_or_path = arg ?? void 0;
|
|
2991
|
+
return { feature: defaultFeatureFor(module_or_path), module_or_path };
|
|
2294
2992
|
}
|
|
2295
2993
|
var initSeq = 0;
|
|
2296
2994
|
var activeOut;
|
|
@@ -2303,7 +3001,7 @@ async function init(options) {
|
|
|
2303
3001
|
}
|
|
2304
3002
|
const mySeq = ++initSeq;
|
|
2305
3003
|
const v = VARIANTS[feature];
|
|
2306
|
-
const source = module_or_path ?? new URL(`${v.wasmFile}?v=${PACKAGE_INFO.version}`, import.meta.url);
|
|
3004
|
+
const source = module_or_path ?? new URL(`${WASM_BASE}${v.wasmFile}?v=${PACKAGE_INFO.version}`, import.meta.url);
|
|
2307
3005
|
const promise = (async () => {
|
|
2308
3006
|
try {
|
|
2309
3007
|
const out = await v.init(source);
|
|
@@ -2321,8 +3019,8 @@ async function init(options) {
|
|
|
2321
3019
|
inflight = { feature, seq: mySeq, promise };
|
|
2322
3020
|
return promise;
|
|
2323
3021
|
}
|
|
2324
|
-
function
|
|
2325
|
-
const feature = options.feature ??
|
|
3022
|
+
function initSync4(module, options = {}) {
|
|
3023
|
+
const feature = options.feature ?? defaultFeatureFor(module);
|
|
2326
3024
|
const v = VARIANTS[feature];
|
|
2327
3025
|
const out = v.initSync(module);
|
|
2328
3026
|
setActive(feature, v.ns);
|
|
@@ -2333,32 +3031,37 @@ function version() {
|
|
|
2333
3031
|
return PACKAGE_INFO.version;
|
|
2334
3032
|
}
|
|
2335
3033
|
function transformParallel(input, options = {}) {
|
|
2336
|
-
const
|
|
2337
|
-
const feature = variant() ??
|
|
3034
|
+
const wasm4 = getActive();
|
|
3035
|
+
const feature = variant() ?? BROWSER_DEFAULT_FEATURE;
|
|
2338
3036
|
return orchestrateParallel(
|
|
2339
|
-
|
|
3037
|
+
wasm4,
|
|
2340
3038
|
input,
|
|
2341
3039
|
options,
|
|
2342
3040
|
(jobs, workers) => runJobsParallel(jobs, workers, feature)
|
|
2343
3041
|
);
|
|
2344
3042
|
}
|
|
2345
3043
|
export {
|
|
3044
|
+
ALL_LANGUAGES,
|
|
2346
3045
|
NotInitializedError,
|
|
3046
|
+
RegisterError,
|
|
2347
3047
|
UnsupportedFeatureError,
|
|
2348
3048
|
bitmarkToObjects,
|
|
2349
3049
|
breakscapeText,
|
|
2350
|
-
|
|
2351
|
-
|
|
3050
|
+
canonicalize4 as canonicalize,
|
|
3051
|
+
convert4 as convert,
|
|
2352
3052
|
countBits,
|
|
2353
|
-
|
|
3053
|
+
diff3 as diff,
|
|
3054
|
+
diffBits,
|
|
3055
|
+
info4 as info,
|
|
2354
3056
|
init,
|
|
2355
|
-
|
|
3057
|
+
initSync4 as initSync,
|
|
2356
3058
|
legacy_exports as legacy,
|
|
2357
|
-
|
|
3059
|
+
lex3 as lex,
|
|
2358
3060
|
objectsToBitmark,
|
|
2359
3061
|
patchEntry,
|
|
3062
|
+
register4 as register,
|
|
2360
3063
|
splitBits,
|
|
2361
|
-
|
|
3064
|
+
transform4 as transform,
|
|
2362
3065
|
transformParallel,
|
|
2363
3066
|
unbreakscapeText,
|
|
2364
3067
|
variant,
|