@gmb/bitmark-parser 7.2.0 → 7.4.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 +163 -23
- package/config/bitmark-json.tsp +439 -0
- package/config/bitmark.json +85074 -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 +6299 -6806
- package/dist/browser/esm/index.d.ts +6299 -6806
- 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 +6299 -6806
- package/dist/index.d.ts +6299 -6806
- 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 +9 -1
- package/dist/legacy.d.ts +9 -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 +10459 -14050
- 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
|
@@ -101,6 +101,9 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
101
101
|
WASM_VECTOR_LEN = offset;
|
|
102
102
|
return ptr;
|
|
103
103
|
}
|
|
104
|
+
function isLikeNone(x) {
|
|
105
|
+
return x === void 0 || x === null;
|
|
106
|
+
}
|
|
104
107
|
var cachedDataViewMemory0 = null;
|
|
105
108
|
function getDataViewMemory0() {
|
|
106
109
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
@@ -108,9 +111,9 @@ function getDataViewMemory0() {
|
|
|
108
111
|
}
|
|
109
112
|
return cachedDataViewMemory0;
|
|
110
113
|
}
|
|
111
|
-
function breakscape_text(input, format, location) {
|
|
112
|
-
let
|
|
113
|
-
let
|
|
114
|
+
function breakscape_text(input, format, location, sub_location) {
|
|
115
|
+
let deferred5_0;
|
|
116
|
+
let deferred5_1;
|
|
114
117
|
try {
|
|
115
118
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
116
119
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -119,20 +122,22 @@ function breakscape_text(input, format, location) {
|
|
|
119
122
|
const len1 = WASM_VECTOR_LEN;
|
|
120
123
|
const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
121
124
|
const len2 = WASM_VECTOR_LEN;
|
|
122
|
-
|
|
125
|
+
var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
126
|
+
var len3 = WASM_VECTOR_LEN;
|
|
127
|
+
wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
123
128
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
124
129
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
deferred5_0 = r0;
|
|
131
|
+
deferred5_1 = r1;
|
|
127
132
|
return getStringFromWasm0(r0, r1);
|
|
128
133
|
} finally {
|
|
129
134
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
130
|
-
wasm.__wbindgen_export_2(
|
|
135
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
|
-
function unbreakscape_text(input, format, location) {
|
|
134
|
-
let
|
|
135
|
-
let
|
|
138
|
+
function unbreakscape_text(input, format, location, sub_location) {
|
|
139
|
+
let deferred5_0;
|
|
140
|
+
let deferred5_1;
|
|
136
141
|
try {
|
|
137
142
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
138
143
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -141,15 +146,17 @@ function unbreakscape_text(input, format, location) {
|
|
|
141
146
|
const len1 = WASM_VECTOR_LEN;
|
|
142
147
|
const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
143
148
|
const len2 = WASM_VECTOR_LEN;
|
|
144
|
-
|
|
149
|
+
var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
150
|
+
var len3 = WASM_VECTOR_LEN;
|
|
151
|
+
wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
145
152
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
146
153
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
147
|
-
|
|
148
|
-
|
|
154
|
+
deferred5_0 = r0;
|
|
155
|
+
deferred5_1 = r1;
|
|
149
156
|
return getStringFromWasm0(r0, r1);
|
|
150
157
|
} finally {
|
|
151
158
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
152
|
-
wasm.__wbindgen_export_2(
|
|
159
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
162
|
function info(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
@@ -775,6 +782,9 @@ function passStringToWasm02(arg, malloc, realloc) {
|
|
|
775
782
|
WASM_VECTOR_LEN2 = offset;
|
|
776
783
|
return ptr;
|
|
777
784
|
}
|
|
785
|
+
function isLikeNone2(x) {
|
|
786
|
+
return x === void 0 || x === null;
|
|
787
|
+
}
|
|
778
788
|
var cachedDataViewMemory02 = null;
|
|
779
789
|
function getDataViewMemory02() {
|
|
780
790
|
if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
|
|
@@ -782,9 +792,9 @@ function getDataViewMemory02() {
|
|
|
782
792
|
}
|
|
783
793
|
return cachedDataViewMemory02;
|
|
784
794
|
}
|
|
785
|
-
function breakscape_text2(input, format, location) {
|
|
786
|
-
let
|
|
787
|
-
let
|
|
795
|
+
function breakscape_text2(input, format, location, sub_location) {
|
|
796
|
+
let deferred5_0;
|
|
797
|
+
let deferred5_1;
|
|
788
798
|
try {
|
|
789
799
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
790
800
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -793,20 +803,22 @@ function breakscape_text2(input, format, location) {
|
|
|
793
803
|
const len1 = WASM_VECTOR_LEN2;
|
|
794
804
|
const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
795
805
|
const len2 = WASM_VECTOR_LEN2;
|
|
796
|
-
|
|
806
|
+
var ptr3 = isLikeNone2(sub_location) ? 0 : passStringToWasm02(sub_location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
807
|
+
var len3 = WASM_VECTOR_LEN2;
|
|
808
|
+
wasm2.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
797
809
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
798
810
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
799
|
-
|
|
800
|
-
|
|
811
|
+
deferred5_0 = r0;
|
|
812
|
+
deferred5_1 = r1;
|
|
801
813
|
return getStringFromWasm02(r0, r1);
|
|
802
814
|
} finally {
|
|
803
815
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
804
|
-
wasm2.__wbindgen_export_2(
|
|
816
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
805
817
|
}
|
|
806
818
|
}
|
|
807
|
-
function unbreakscape_text2(input, format, location) {
|
|
808
|
-
let
|
|
809
|
-
let
|
|
819
|
+
function unbreakscape_text2(input, format, location, sub_location) {
|
|
820
|
+
let deferred5_0;
|
|
821
|
+
let deferred5_1;
|
|
810
822
|
try {
|
|
811
823
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
812
824
|
const ptr0 = passStringToWasm02(input, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
@@ -815,15 +827,17 @@ function unbreakscape_text2(input, format, location) {
|
|
|
815
827
|
const len1 = WASM_VECTOR_LEN2;
|
|
816
828
|
const ptr2 = passStringToWasm02(location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
817
829
|
const len2 = WASM_VECTOR_LEN2;
|
|
818
|
-
|
|
830
|
+
var ptr3 = isLikeNone2(sub_location) ? 0 : passStringToWasm02(sub_location, wasm2.__wbindgen_export_0, wasm2.__wbindgen_export_1);
|
|
831
|
+
var len3 = WASM_VECTOR_LEN2;
|
|
832
|
+
wasm2.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
819
833
|
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
820
834
|
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
821
|
-
|
|
822
|
-
|
|
835
|
+
deferred5_0 = r0;
|
|
836
|
+
deferred5_1 = r1;
|
|
823
837
|
return getStringFromWasm02(r0, r1);
|
|
824
838
|
} finally {
|
|
825
839
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
826
|
-
wasm2.__wbindgen_export_2(
|
|
840
|
+
wasm2.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
827
841
|
}
|
|
828
842
|
}
|
|
829
843
|
function info2(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
@@ -1447,6 +1461,9 @@ function passStringToWasm03(arg, malloc, realloc) {
|
|
|
1447
1461
|
WASM_VECTOR_LEN3 = offset;
|
|
1448
1462
|
return ptr;
|
|
1449
1463
|
}
|
|
1464
|
+
function isLikeNone3(x) {
|
|
1465
|
+
return x === void 0 || x === null;
|
|
1466
|
+
}
|
|
1450
1467
|
var cachedDataViewMemory03 = null;
|
|
1451
1468
|
function getDataViewMemory03() {
|
|
1452
1469
|
if (cachedDataViewMemory03 === null || cachedDataViewMemory03.buffer.detached === true || cachedDataViewMemory03.buffer.detached === void 0 && cachedDataViewMemory03.buffer !== wasm3.memory.buffer) {
|
|
@@ -1454,9 +1471,9 @@ function getDataViewMemory03() {
|
|
|
1454
1471
|
}
|
|
1455
1472
|
return cachedDataViewMemory03;
|
|
1456
1473
|
}
|
|
1457
|
-
function breakscape_text3(input, format, location) {
|
|
1458
|
-
let
|
|
1459
|
-
let
|
|
1474
|
+
function breakscape_text3(input, format, location, sub_location) {
|
|
1475
|
+
let deferred5_0;
|
|
1476
|
+
let deferred5_1;
|
|
1460
1477
|
try {
|
|
1461
1478
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1462
1479
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1465,20 +1482,22 @@ function breakscape_text3(input, format, location) {
|
|
|
1465
1482
|
const len1 = WASM_VECTOR_LEN3;
|
|
1466
1483
|
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1467
1484
|
const len2 = WASM_VECTOR_LEN3;
|
|
1468
|
-
|
|
1485
|
+
var ptr3 = isLikeNone3(sub_location) ? 0 : passStringToWasm03(sub_location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1486
|
+
var len3 = WASM_VECTOR_LEN3;
|
|
1487
|
+
wasm3.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1469
1488
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1470
1489
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1471
|
-
|
|
1472
|
-
|
|
1490
|
+
deferred5_0 = r0;
|
|
1491
|
+
deferred5_1 = r1;
|
|
1473
1492
|
return getStringFromWasm03(r0, r1);
|
|
1474
1493
|
} finally {
|
|
1475
1494
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1476
|
-
wasm3.__wbindgen_export_2(
|
|
1495
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1477
1496
|
}
|
|
1478
1497
|
}
|
|
1479
|
-
function unbreakscape_text3(input, format, location) {
|
|
1480
|
-
let
|
|
1481
|
-
let
|
|
1498
|
+
function unbreakscape_text3(input, format, location, sub_location) {
|
|
1499
|
+
let deferred5_0;
|
|
1500
|
+
let deferred5_1;
|
|
1482
1501
|
try {
|
|
1483
1502
|
const retptr = wasm3.__wbindgen_add_to_stack_pointer(-16);
|
|
1484
1503
|
const ptr0 = passStringToWasm03(input, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
@@ -1487,15 +1506,17 @@ function unbreakscape_text3(input, format, location) {
|
|
|
1487
1506
|
const len1 = WASM_VECTOR_LEN3;
|
|
1488
1507
|
const ptr2 = passStringToWasm03(location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1489
1508
|
const len2 = WASM_VECTOR_LEN3;
|
|
1490
|
-
|
|
1509
|
+
var ptr3 = isLikeNone3(sub_location) ? 0 : passStringToWasm03(sub_location, wasm3.__wbindgen_export_0, wasm3.__wbindgen_export_1);
|
|
1510
|
+
var len3 = WASM_VECTOR_LEN3;
|
|
1511
|
+
wasm3.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1491
1512
|
var r0 = getDataViewMemory03().getInt32(retptr + 4 * 0, true);
|
|
1492
1513
|
var r1 = getDataViewMemory03().getInt32(retptr + 4 * 1, true);
|
|
1493
|
-
|
|
1494
|
-
|
|
1514
|
+
deferred5_0 = r0;
|
|
1515
|
+
deferred5_1 = r1;
|
|
1495
1516
|
return getStringFromWasm03(r0, r1);
|
|
1496
1517
|
} finally {
|
|
1497
1518
|
wasm3.__wbindgen_add_to_stack_pointer(16);
|
|
1498
|
-
wasm3.__wbindgen_export_2(
|
|
1519
|
+
wasm3.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
1499
1520
|
}
|
|
1500
1521
|
}
|
|
1501
1522
|
function info3(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
|
|
@@ -1990,6 +2011,16 @@ var bitmark_json_wasm_default = __wbg_init3;
|
|
|
1990
2011
|
// src/core/facade.ts
|
|
1991
2012
|
var BROWSER_DEFAULT_FEATURE = "browser-full";
|
|
1992
2013
|
|
|
2014
|
+
// src/core/hooked-transform.ts
|
|
2015
|
+
function stripArray(doc) {
|
|
2016
|
+
const t = doc.trim();
|
|
2017
|
+
return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : doc;
|
|
2018
|
+
}
|
|
2019
|
+
function bitOutput(envelopeJson, outputFormat) {
|
|
2020
|
+
const { data, diagnostics } = JSON.parse(envelopeJson);
|
|
2021
|
+
return { element: outputFormat === "json" ? stripArray(data) : data, diagnostics };
|
|
2022
|
+
}
|
|
2023
|
+
|
|
1993
2024
|
// src/browser/worker-entry.ts
|
|
1994
2025
|
var ctx = self;
|
|
1995
2026
|
var WASM_BASE = true ? "../wasm/" : "./";
|
|
@@ -2020,26 +2051,24 @@ function ensureReady(feature) {
|
|
|
2020
2051
|
}
|
|
2021
2052
|
return p;
|
|
2022
2053
|
}
|
|
2023
|
-
function stripArray(doc) {
|
|
2024
|
-
const t = doc.trim();
|
|
2025
|
-
return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : doc;
|
|
2026
|
-
}
|
|
2027
2054
|
ctx.addEventListener("message", (ev) => {
|
|
2028
2055
|
const { id, job, feature } = ev.data;
|
|
2029
2056
|
const f = feature ?? BROWSER_DEFAULT_FEATURE;
|
|
2030
2057
|
ensureReady(f).then(() => {
|
|
2031
|
-
const
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2058
|
+
const { element, diagnostics } = bitOutput(
|
|
2059
|
+
VARIANTS[f].ns.transform(
|
|
2060
|
+
job.source,
|
|
2061
|
+
job.inputFormat,
|
|
2062
|
+
job.outputFormat,
|
|
2063
|
+
job.mode,
|
|
2064
|
+
job.patchJson,
|
|
2065
|
+
false,
|
|
2066
|
+
2,
|
|
2067
|
+
job.spacesAroundValues
|
|
2068
|
+
),
|
|
2069
|
+
job.outputFormat
|
|
2040
2070
|
);
|
|
2041
|
-
|
|
2042
|
-
ctx.postMessage({ id, ok: true, element });
|
|
2071
|
+
ctx.postMessage({ id, ok: true, element, diagnostics });
|
|
2043
2072
|
}).catch((e) => {
|
|
2044
2073
|
ctx.postMessage({ id, ok: false, error: e instanceof Error ? e.message : String(e) });
|
|
2045
2074
|
});
|