@gmb/bitmark-parser 7.1.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -23
- package/config/bitmark-json.tsp +330 -0
- package/config/bitmark.json +83394 -0
- package/dist/browser/bitmark-parser.min.js +6 -4
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/cjs/index.cjs +140 -72
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +6283 -6798
- package/dist/browser/esm/index.d.ts +6283 -6798
- package/dist/browser/esm/index.js +139 -72
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js +86 -57
- 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 +76 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6283 -6798
- package/dist/index.d.ts +6283 -6798
- package/dist/index.js +75 -29
- package/dist/index.js.map +1 -1
- package/dist/legacy.cjs +4 -3
- package/dist/legacy.cjs.map +1 -1
- package/dist/legacy.d.cts +2 -1
- package/dist/legacy.d.ts +2 -1
- package/dist/legacy.js +4 -3
- package/dist/legacy.js.map +1 -1
- package/dist/worker-entry.cjs +23 -15
- package/dist/worker-entry.cjs.map +1 -1
- package/package.json +11 -7
- package/schema/bitmark.schema.json +10427 -14036
- package/wasm/bitmark_wasm.d.ts +12 -3
- package/wasm/bitmark_wasm.js +34 -15
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +2 -2
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm.d.ts +12 -3
- package/wasm-bitmark-json/bitmark_json_wasm.js +34 -15
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +2 -2
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +12 -3
- package/wasm-browser-full/bitmark_browser_full_wasm.js +34 -15
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +2 -2
- package/wasm-browser-full/package.json +1 -1
|
@@ -103,6 +103,9 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
103
103
|
WASM_VECTOR_LEN = offset;
|
|
104
104
|
return ptr;
|
|
105
105
|
}
|
|
106
|
+
function isLikeNone(x) {
|
|
107
|
+
return x === void 0 || x === null;
|
|
108
|
+
}
|
|
106
109
|
var cachedDataViewMemory0 = null;
|
|
107
110
|
function getDataViewMemory0() {
|
|
108
111
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
@@ -110,9 +113,9 @@ function getDataViewMemory0() {
|
|
|
110
113
|
}
|
|
111
114
|
return cachedDataViewMemory0;
|
|
112
115
|
}
|
|
113
|
-
function breakscape_text(input, format, location) {
|
|
114
|
-
let
|
|
115
|
-
let
|
|
116
|
+
function breakscape_text(input, format, location, sub_location) {
|
|
117
|
+
let deferred5_0;
|
|
118
|
+
let deferred5_1;
|
|
116
119
|
try {
|
|
117
120
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
118
121
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -121,20 +124,22 @@ function breakscape_text(input, format, location) {
|
|
|
121
124
|
const len1 = WASM_VECTOR_LEN;
|
|
122
125
|
const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
123
126
|
const len2 = WASM_VECTOR_LEN;
|
|
124
|
-
|
|
127
|
+
var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
128
|
+
var len3 = WASM_VECTOR_LEN;
|
|
129
|
+
wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
125
130
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
126
131
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
deferred5_0 = r0;
|
|
133
|
+
deferred5_1 = r1;
|
|
129
134
|
return getStringFromWasm0(r0, r1);
|
|
130
135
|
} finally {
|
|
131
136
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
132
|
-
wasm.__wbindgen_export_2(
|
|
137
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
|
-
function unbreakscape_text(input, format, location) {
|
|
136
|
-
let
|
|
137
|
-
let
|
|
140
|
+
function unbreakscape_text(input, format, location, sub_location) {
|
|
141
|
+
let deferred5_0;
|
|
142
|
+
let deferred5_1;
|
|
138
143
|
try {
|
|
139
144
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
140
145
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -143,15 +148,17 @@ function unbreakscape_text(input, format, location) {
|
|
|
143
148
|
const len1 = WASM_VECTOR_LEN;
|
|
144
149
|
const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
145
150
|
const len2 = WASM_VECTOR_LEN;
|
|
146
|
-
|
|
151
|
+
var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
152
|
+
var len3 = WASM_VECTOR_LEN;
|
|
153
|
+
wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
147
154
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
148
155
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
149
|
-
|
|
150
|
-
|
|
156
|
+
deferred5_0 = r0;
|
|
157
|
+
deferred5_1 = r1;
|
|
151
158
|
return getStringFromWasm0(r0, r1);
|
|
152
159
|
} finally {
|
|
153
160
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
154
|
-
wasm.__wbindgen_export_2(
|
|
161
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
155
162
|
}
|
|
156
163
|
}
|
|
157
164
|
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
@@ -777,6 +784,9 @@ function passStringToWasm02(arg, malloc, realloc) {
|
|
|
777
784
|
WASM_VECTOR_LEN2 = offset;
|
|
778
785
|
return ptr;
|
|
779
786
|
}
|
|
787
|
+
function isLikeNone2(x) {
|
|
788
|
+
return x === void 0 || x === null;
|
|
789
|
+
}
|
|
780
790
|
var cachedDataViewMemory02 = null;
|
|
781
791
|
function getDataViewMemory02() {
|
|
782
792
|
if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
|
|
@@ -784,9 +794,9 @@ function getDataViewMemory02() {
|
|
|
784
794
|
}
|
|
785
795
|
return cachedDataViewMemory02;
|
|
786
796
|
}
|
|
787
|
-
function breakscape_text2(input, format, location) {
|
|
788
|
-
let
|
|
789
|
-
let
|
|
797
|
+
function breakscape_text2(input, format, location, sub_location) {
|
|
798
|
+
let deferred5_0;
|
|
799
|
+
let deferred5_1;
|
|
790
800
|
try {
|
|
791
801
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
792
802
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -795,20 +805,22 @@ function breakscape_text2(input, format, location) {
|
|
|
795
805
|
const len1 = WASM_VECTOR_LEN2;
|
|
796
806
|
const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
797
807
|
const len2 = WASM_VECTOR_LEN2;
|
|
798
|
-
|
|
808
|
+
var ptr3 = isLikeNone2(sub_location) ? 0 : passStringToWasm02(sub_location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
809
|
+
var len3 = WASM_VECTOR_LEN2;
|
|
810
|
+
wasm2.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
799
811
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
800
812
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
801
|
-
|
|
802
|
-
|
|
813
|
+
deferred5_0 = r0;
|
|
814
|
+
deferred5_1 = r1;
|
|
803
815
|
return getStringFromWasm02(r0, r1);
|
|
804
816
|
} finally {
|
|
805
817
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
806
|
-
wasm2.__wbindgen_export_2(
|
|
818
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
807
819
|
}
|
|
808
820
|
}
|
|
809
|
-
function unbreakscape_text2(input, format, location) {
|
|
810
|
-
let
|
|
811
|
-
let
|
|
821
|
+
function unbreakscape_text2(input, format, location, sub_location) {
|
|
822
|
+
let deferred5_0;
|
|
823
|
+
let deferred5_1;
|
|
812
824
|
try {
|
|
813
825
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
814
826
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -817,15 +829,17 @@ function unbreakscape_text2(input, format, location) {
|
|
|
817
829
|
const len1 = WASM_VECTOR_LEN2;
|
|
818
830
|
const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
819
831
|
const len2 = WASM_VECTOR_LEN2;
|
|
820
|
-
|
|
832
|
+
var ptr3 = isLikeNone2(sub_location) ? 0 : passStringToWasm02(sub_location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
833
|
+
var len3 = WASM_VECTOR_LEN2;
|
|
834
|
+
wasm2.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
821
835
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
822
836
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
823
|
-
|
|
824
|
-
|
|
837
|
+
deferred5_0 = r0;
|
|
838
|
+
deferred5_1 = r1;
|
|
825
839
|
return getStringFromWasm02(r0, r1);
|
|
826
840
|
} finally {
|
|
827
841
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
828
|
-
wasm2.__wbindgen_export_2(
|
|
842
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
829
843
|
}
|
|
830
844
|
}
|
|
831
845
|
function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
@@ -1449,6 +1463,9 @@ function passStringToWasm03(arg, malloc, realloc) {
|
|
|
1449
1463
|
WASM_VECTOR_LEN3 = offset;
|
|
1450
1464
|
return ptr;
|
|
1451
1465
|
}
|
|
1466
|
+
function isLikeNone3(x) {
|
|
1467
|
+
return x === void 0 || x === null;
|
|
1468
|
+
}
|
|
1452
1469
|
var cachedDataViewMemory03 = null;
|
|
1453
1470
|
function getDataViewMemory03() {
|
|
1454
1471
|
if (cachedDataViewMemory03 === null || cachedDataViewMemory03.buffer.detached === true || cachedDataViewMemory03.buffer.detached === void 0 && cachedDataViewMemory03.buffer !== wasm3.memory.buffer) {
|
|
@@ -1456,9 +1473,9 @@ function getDataViewMemory03() {
|
|
|
1456
1473
|
}
|
|
1457
1474
|
return cachedDataViewMemory03;
|
|
1458
1475
|
}
|
|
1459
|
-
function breakscape_text3(input, format, location) {
|
|
1460
|
-
let
|
|
1461
|
-
let
|
|
1476
|
+
function breakscape_text3(input, format, location, sub_location) {
|
|
1477
|
+
let deferred5_0;
|
|
1478
|
+
let deferred5_1;
|
|
1462
1479
|
try {
|
|
1463
1480
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1464
1481
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1467,20 +1484,22 @@ function breakscape_text3(input, format, location) {
|
|
|
1467
1484
|
const len1 = WASM_VECTOR_LEN3;
|
|
1468
1485
|
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1469
1486
|
const len2 = WASM_VECTOR_LEN3;
|
|
1470
|
-
|
|
1487
|
+
var ptr3 = isLikeNone3(sub_location) ? 0 : passStringToWasm03(sub_location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1488
|
+
var len3 = WASM_VECTOR_LEN3;
|
|
1489
|
+
wasm3.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1471
1490
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1472
1491
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1473
|
-
|
|
1474
|
-
|
|
1492
|
+
deferred5_0 = r0;
|
|
1493
|
+
deferred5_1 = r1;
|
|
1475
1494
|
return getStringFromWasm03(r0, r1);
|
|
1476
1495
|
} finally {
|
|
1477
1496
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1478
|
-
wasm3.__wbindgen_export_2(
|
|
1497
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1479
1498
|
}
|
|
1480
1499
|
}
|
|
1481
|
-
function unbreakscape_text3(input, format, location) {
|
|
1482
|
-
let
|
|
1483
|
-
let
|
|
1500
|
+
function unbreakscape_text3(input, format, location, sub_location) {
|
|
1501
|
+
let deferred5_0;
|
|
1502
|
+
let deferred5_1;
|
|
1484
1503
|
try {
|
|
1485
1504
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1486
1505
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1489,15 +1508,17 @@ function unbreakscape_text3(input, format, location) {
|
|
|
1489
1508
|
const len1 = WASM_VECTOR_LEN3;
|
|
1490
1509
|
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1491
1510
|
const len2 = WASM_VECTOR_LEN3;
|
|
1492
|
-
|
|
1511
|
+
var ptr3 = isLikeNone3(sub_location) ? 0 : passStringToWasm03(sub_location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1512
|
+
var len3 = WASM_VECTOR_LEN3;
|
|
1513
|
+
wasm3.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1493
1514
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1494
1515
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1495
|
-
|
|
1496
|
-
|
|
1516
|
+
deferred5_0 = r0;
|
|
1517
|
+
deferred5_1 = r1;
|
|
1497
1518
|
return getStringFromWasm03(r0, r1);
|
|
1498
1519
|
} finally {
|
|
1499
1520
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1500
|
-
wasm3.__wbindgen_export_2(
|
|
1521
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1501
1522
|
}
|
|
1502
1523
|
}
|
|
1503
1524
|
function info3(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
@@ -1992,7 +2013,7 @@ var bitmark_json_wasm_default = __wbg_init3;
|
|
|
1992
2013
|
// src/generated/package_info.ts
|
|
1993
2014
|
var PACKAGE_INFO = {
|
|
1994
2015
|
"name": "@gmb/bitmark-parser",
|
|
1995
|
-
"version": "7.
|
|
2016
|
+
"version": "7.3.0",
|
|
1996
2017
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
1997
2018
|
"license": "ISC",
|
|
1998
2019
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
@@ -2012,6 +2033,18 @@ var RegisterError = class extends Error {
|
|
|
2012
2033
|
this.name = "RegisterError";
|
|
2013
2034
|
}
|
|
2014
2035
|
};
|
|
2036
|
+
var PatchError = class extends Error {
|
|
2037
|
+
constructor(diagnostics2) {
|
|
2038
|
+
const lines = diagnostics2.map((d) => `${d.kind} at ${d.path}: ${d.message}`);
|
|
2039
|
+
super(
|
|
2040
|
+
`${diagnostics2.length} patch ${diagnostics2.length === 1 ? "entry was" : "entries were"} skipped:
|
|
2041
|
+
` + lines.join("\n")
|
|
2042
|
+
);
|
|
2043
|
+
__publicField(this, "diagnostics");
|
|
2044
|
+
this.name = "PatchError";
|
|
2045
|
+
this.diagnostics = diagnostics2;
|
|
2046
|
+
}
|
|
2047
|
+
};
|
|
2015
2048
|
var UnsupportedFeatureError = class extends Error {
|
|
2016
2049
|
constructor(what, active2) {
|
|
2017
2050
|
super(
|
|
@@ -2118,6 +2151,18 @@ function planTransform(wasm4, input, options) {
|
|
|
2118
2151
|
spacesAroundValues
|
|
2119
2152
|
});
|
|
2120
2153
|
views.push(units[item.source].view);
|
|
2154
|
+
} else if (typeof item.bit === "string") {
|
|
2155
|
+
const index = jobs.length;
|
|
2156
|
+
jobs.push({
|
|
2157
|
+
index,
|
|
2158
|
+
source: item.bit,
|
|
2159
|
+
inputFormat: "bitmark",
|
|
2160
|
+
outputFormat: output,
|
|
2161
|
+
mode,
|
|
2162
|
+
patchJson: JSON.stringify(item.patch),
|
|
2163
|
+
spacesAroundValues
|
|
2164
|
+
});
|
|
2165
|
+
views.push({ format: "bitmark", index, total, source: item.bit });
|
|
2121
2166
|
} else {
|
|
2122
2167
|
const bit = item.bit ?? {};
|
|
2123
2168
|
const index = jobs.length;
|
|
@@ -2135,18 +2180,24 @@ function planTransform(wasm4, input, options) {
|
|
|
2135
2180
|
}
|
|
2136
2181
|
return { jobs, views, output, pretty, indent };
|
|
2137
2182
|
}
|
|
2183
|
+
function bitOutput(envelopeJson, outputFormat) {
|
|
2184
|
+
const { data, diagnostics: diagnostics2 } = JSON.parse(envelopeJson);
|
|
2185
|
+
return { element: outputFormat === "json" ? stripArray(data) : data, diagnostics: diagnostics2 };
|
|
2186
|
+
}
|
|
2138
2187
|
function computeBit(wasm4, job) {
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2188
|
+
return bitOutput(
|
|
2189
|
+
wasm4.transform(
|
|
2190
|
+
job.source,
|
|
2191
|
+
job.inputFormat,
|
|
2192
|
+
job.outputFormat,
|
|
2193
|
+
job.mode,
|
|
2194
|
+
job.patchJson,
|
|
2195
|
+
false,
|
|
2196
|
+
2,
|
|
2197
|
+
job.spacesAroundValues
|
|
2198
|
+
),
|
|
2199
|
+
job.outputFormat
|
|
2148
2200
|
);
|
|
2149
|
-
return job.outputFormat === "json" ? stripArray(out) : out;
|
|
2150
2201
|
}
|
|
2151
2202
|
function recombine(wasm4, elements, output, pretty, indent) {
|
|
2152
2203
|
if (output !== "json") return elements.join("\n");
|
|
@@ -2156,21 +2207,29 @@ function recombine(wasm4, elements, output, pretty, indent) {
|
|
|
2156
2207
|
function runHookedTransform(wasm4, input, options) {
|
|
2157
2208
|
const plan = planTransform(wasm4, input, options);
|
|
2158
2209
|
const rendered = [];
|
|
2210
|
+
const skipped = [];
|
|
2159
2211
|
for (let i = 0; i < plan.jobs.length; i++) {
|
|
2160
|
-
const element = computeBit(wasm4, plan.jobs[i]);
|
|
2212
|
+
const { element, diagnostics: diagnostics2 } = computeBit(wasm4, plan.jobs[i]);
|
|
2213
|
+
skipped.push(...diagnostics2);
|
|
2161
2214
|
options.postHook?.(plan.views[i], element);
|
|
2162
2215
|
rendered.push(element);
|
|
2163
2216
|
}
|
|
2217
|
+
if (skipped.length > 0) throw new PatchError(skipped);
|
|
2164
2218
|
return recombine(wasm4, rendered, plan.output, plan.pretty, plan.indent);
|
|
2165
2219
|
}
|
|
2166
2220
|
|
|
2167
2221
|
// src/core/parallel.ts
|
|
2168
2222
|
async function orchestrateParallel(wasm4, input, options, runJobs) {
|
|
2169
2223
|
const plan = planTransform(wasm4, input, options);
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2224
|
+
const outputs = await runJobs(plan.jobs, options.workers ?? 4);
|
|
2225
|
+
const elements = [];
|
|
2226
|
+
const skipped = [];
|
|
2227
|
+
for (let i = 0; i < outputs.length; i++) {
|
|
2228
|
+
elements.push(outputs[i].element);
|
|
2229
|
+
skipped.push(...outputs[i].diagnostics);
|
|
2230
|
+
options.postHook?.(plan.views[i], outputs[i].element);
|
|
2231
|
+
}
|
|
2232
|
+
if (skipped.length > 0) throw new PatchError(skipped);
|
|
2174
2233
|
return recombine(wasm4, elements, plan.output, plan.pretty, plan.indent);
|
|
2175
2234
|
}
|
|
2176
2235
|
|
|
@@ -2218,7 +2277,7 @@ function runJobsWithPool(jobs, workers, spawn) {
|
|
|
2218
2277
|
const w = spawn((res) => {
|
|
2219
2278
|
if (done) return;
|
|
2220
2279
|
if (!res.ok) return finish(new Error(res.error ?? "worker job failed"));
|
|
2221
|
-
results[res.id] = res.element;
|
|
2280
|
+
results[res.id] = { element: res.element, diagnostics: res.diagnostics ?? [] };
|
|
2222
2281
|
if (++settled === jobs.length) finish();
|
|
2223
2282
|
else dispatch(w);
|
|
2224
2283
|
}, finish);
|
|
@@ -2560,7 +2619,7 @@ var Builder = class {
|
|
|
2560
2619
|
}
|
|
2561
2620
|
/**
|
|
2562
2621
|
* Look up the bit's config (`wasm.info`); throws bpg's exact
|
|
2563
|
-
*
|
|
2622
|
+
* bit-type-invalid error (`Config.getBitConfig` parity).
|
|
2564
2623
|
*/
|
|
2565
2624
|
getBitConfig(bitType) {
|
|
2566
2625
|
const wasm4 = getLegacyWasm();
|
|
@@ -3139,7 +3198,8 @@ var BodyTextFormat = {
|
|
|
3139
3198
|
};
|
|
3140
3199
|
var TextLocation = {
|
|
3141
3200
|
tag: "tag",
|
|
3142
|
-
body: "body"
|
|
3201
|
+
body: "body",
|
|
3202
|
+
cardBody: "cardBody"
|
|
3143
3203
|
};
|
|
3144
3204
|
|
|
3145
3205
|
// src/legacy/enums-extra.ts
|
|
@@ -3451,16 +3511,20 @@ function transform4(input, options = {}) {
|
|
|
3451
3511
|
return runHookedTransform(wasm4, input, options);
|
|
3452
3512
|
}
|
|
3453
3513
|
const patchJson = options.patch === void 0 ? "" : typeof options.patch === "string" ? options.patch : JSON.stringify(options.patch);
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3514
|
+
const { data, diagnostics: diagnostics2 } = JSON.parse(
|
|
3515
|
+
wasm4.transform(
|
|
3516
|
+
input,
|
|
3517
|
+
options.inputFormat ?? "auto",
|
|
3518
|
+
options.outputFormat ?? "json",
|
|
3519
|
+
options.mode ?? "optimized",
|
|
3520
|
+
patchJson,
|
|
3521
|
+
options.pretty ?? false,
|
|
3522
|
+
options.indent ?? 2,
|
|
3523
|
+
options.spacesAroundValues ?? 1
|
|
3524
|
+
)
|
|
3463
3525
|
);
|
|
3526
|
+
if (diagnostics2.length > 0) throw new PatchError(diagnostics2);
|
|
3527
|
+
return data;
|
|
3464
3528
|
}
|
|
3465
3529
|
function diff3(a, b, options = {}) {
|
|
3466
3530
|
const wasm4 = getActive();
|
|
@@ -3484,12 +3548,14 @@ function diffBits(a, b, options = {}) {
|
|
|
3484
3548
|
function breakscapeText(input, options = {}) {
|
|
3485
3549
|
const format = options.format ?? "bitmark++";
|
|
3486
3550
|
const location = options.location ?? "body";
|
|
3487
|
-
|
|
3551
|
+
const subLocation = options.subLocation ?? "text";
|
|
3552
|
+
return getActive().breakscape_text(input, format, location, subLocation);
|
|
3488
3553
|
}
|
|
3489
3554
|
function unbreakscapeText(input, options = {}) {
|
|
3490
3555
|
const format = options.format ?? "bitmark++";
|
|
3491
3556
|
const location = options.location ?? "body";
|
|
3492
|
-
|
|
3557
|
+
const subLocation = options.subLocation ?? "text";
|
|
3558
|
+
return getActive().unbreakscape_text(input, format, location, subLocation);
|
|
3493
3559
|
}
|
|
3494
3560
|
function info4(options = {}) {
|
|
3495
3561
|
const infoType = options.infoType ?? "list";
|
|
@@ -3626,6 +3692,7 @@ export {
|
|
|
3626
3692
|
CompletionItemTag,
|
|
3627
3693
|
DiagnosticSeverity,
|
|
3628
3694
|
NotInitializedError,
|
|
3695
|
+
PatchError,
|
|
3629
3696
|
RegisterError,
|
|
3630
3697
|
UnsupportedFeatureError,
|
|
3631
3698
|
bitmarkToObjects,
|