@gmb/bitmark-parser 6.6.0 → 6.8.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 +14 -0
- package/dist/browser/bitmark-parser.min.js +4 -4
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/index.cjs +25 -13
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +271 -14
- package/dist/browser/esm/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/esm/index.d.ts +271 -14
- package/dist/browser/esm/index.js +25 -13
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js.map +1 -1
- package/dist/index.cjs +23 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +270 -13
- package/dist/index.d.ts +270 -13
- package/dist/index.js +23 -11
- package/dist/index.js.map +1 -1
- package/dist/legacy.cjs +8 -8
- package/dist/legacy.cjs.map +1 -1
- package/dist/legacy.js +8 -8
- package/dist/legacy.js.map +1 -1
- package/package.json +6 -6
- package/schema/bitmark.schema.json +842 -154
- package/wasm/bitmark_wasm.d.ts +3 -1
- package/wasm/bitmark_wasm.js +5 -2
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +1 -1
- package/wasm/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -246,7 +246,7 @@ function transform(input, input_format_sel, output_format_sel, mode, patch_json,
|
|
|
246
246
|
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties) {
|
|
249
|
+
function convert(input, input_format_sel, output_format_sel, mode, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report) {
|
|
250
250
|
let deferred5_0;
|
|
251
251
|
let deferred5_1;
|
|
252
252
|
try {
|
|
@@ -259,7 +259,7 @@ function convert(input, input_format_sel, output_format_sel, mode, pretty, inden
|
|
|
259
259
|
const len2 = WASM_VECTOR_LEN;
|
|
260
260
|
const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
261
261
|
const len3 = WASM_VECTOR_LEN;
|
|
262
|
-
wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties);
|
|
262
|
+
wasm.convert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, pretty, indent, spaces_around_values, include_unknown_properties, mapping_report);
|
|
263
263
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
264
264
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
265
265
|
deferred5_0 = r0;
|
|
@@ -474,7 +474,7 @@ var bitmark_wasm_default = __wbg_init;
|
|
|
474
474
|
// src/generated/package_info.ts
|
|
475
475
|
var PACKAGE_INFO = {
|
|
476
476
|
"name": "@gmb/bitmark-parser",
|
|
477
|
-
"version": "6.
|
|
477
|
+
"version": "6.8.0",
|
|
478
478
|
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
479
479
|
"license": "ISC",
|
|
480
480
|
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
@@ -917,7 +917,7 @@ var Builder = class {
|
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
919
|
this.parseStringTexts(bit);
|
|
920
|
-
const out = wasm2.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false);
|
|
920
|
+
const out = wasm2.convert(JSON.stringify([{ bit }]), "json", "json", "optimized", false, 2, 1, false, false);
|
|
921
921
|
if (out.startsWith("error:")) {
|
|
922
922
|
throw new Error(out.slice("error:".length).trim());
|
|
923
923
|
}
|
|
@@ -1057,7 +1057,7 @@ var BitmarkParserGenerator = class {
|
|
|
1057
1057
|
const emit = coreFormat === "bitmark" ? prettyIndent(bitmarkOptions.prettifyJson) : { pretty, indent };
|
|
1058
1058
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1059
1059
|
const includeUnknown = !jsonOptions.excludeUnknownProperties;
|
|
1060
|
-
const out = wasm2.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown);
|
|
1060
|
+
const out = wasm2.convert(source, isBitmark ? "bitmark" : "json", coreFormat, "optimized", emit.pretty, emit.indent, spaces, includeUnknown, false);
|
|
1061
1061
|
this.throwOnError(out);
|
|
1062
1062
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1063
1063
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1141,7 +1141,7 @@ var BitmarkParserGenerator = class {
|
|
|
1141
1141
|
const isHtmlInput = opts.inputFormat === "html" || opts.inputFormat === void 0 && typeof input === "string" && /<table[\s>]/iu.test(inStr);
|
|
1142
1142
|
if (!isHtmlInput) {
|
|
1143
1143
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1144
|
-
const out2 = wasm2.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false);
|
|
1144
|
+
const out2 = wasm2.convert(source, isBitmark ? "bitmark" : "json", "html", "optimized", false, 2, 1, false, false);
|
|
1145
1145
|
this.throwOnError(out2);
|
|
1146
1146
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1147
1147
|
}
|
|
@@ -1151,12 +1151,12 @@ var BitmarkParserGenerator = class {
|
|
|
1151
1151
|
const { pretty, indent } = prettyIndent(jsonOptions.prettify);
|
|
1152
1152
|
const spaces = spacesAround(bitmarkOptions.spacesAroundValues);
|
|
1153
1153
|
if (outputFormat === "html") {
|
|
1154
|
-
const out2 = wasm2.convert(wrapped, "html", "html", "optimized", false, 2, 1, false);
|
|
1154
|
+
const out2 = wasm2.convert(wrapped, "html", "html", "optimized", false, 2, 1, false, false);
|
|
1155
1155
|
this.throwOnError(out2);
|
|
1156
1156
|
return this.deliver(extractHtmlTables(out2).join("\n"), opts.outputFile, opts.fileOptions);
|
|
1157
1157
|
}
|
|
1158
1158
|
const coreFormat = outputFormat === "ast" ? "json" : outputFormat;
|
|
1159
|
-
const out = wasm2.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false);
|
|
1159
|
+
const out = wasm2.convert(wrapped, "html", coreFormat, "optimized", pretty, indent, spaces, false, false);
|
|
1160
1160
|
this.throwOnError(out);
|
|
1161
1161
|
if (outputFormat === "bitmark" || outputFormat === "text") {
|
|
1162
1162
|
return this.deliver(out, opts.outputFile, opts.fileOptions);
|
|
@@ -1181,7 +1181,7 @@ var BitmarkParserGenerator = class {
|
|
|
1181
1181
|
const opts = Object.assign({}, options);
|
|
1182
1182
|
const wasm2 = getLegacyWasm();
|
|
1183
1183
|
const { source, isBitmark } = this.resolveInput(input, opts.inputFormat);
|
|
1184
|
-
const out = wasm2.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true);
|
|
1184
|
+
const out = wasm2.convert(source, isBitmark ? "bitmark" : "json", "json", "optimized", false, 2, 1, true, false);
|
|
1185
1185
|
this.throwOnError(out);
|
|
1186
1186
|
return makePseudoAst(JSON.parse(out));
|
|
1187
1187
|
}
|
|
@@ -1288,7 +1288,7 @@ var BitmarkParserGenerator = class {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
1290
|
const { source, isBitmark } = this.resolveInput(input, void 0);
|
|
1291
|
-
const out = wasm2.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false);
|
|
1291
|
+
const out = wasm2.convert(source, isBitmark ? "bitmark" : "json", "text", "optimized", false, 2, 1, false, false);
|
|
1292
1292
|
this.throwOnError(out);
|
|
1293
1293
|
return out;
|
|
1294
1294
|
}
|
|
@@ -1788,7 +1788,8 @@ function bitmarkToObjects(input, options = {}) {
|
|
|
1788
1788
|
false,
|
|
1789
1789
|
2,
|
|
1790
1790
|
1,
|
|
1791
|
-
options.includeUnknownProperties ?? false
|
|
1791
|
+
options.includeUnknownProperties ?? false,
|
|
1792
|
+
false
|
|
1792
1793
|
);
|
|
1793
1794
|
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
1794
1795
|
return JSON.parse(out);
|
|
@@ -1797,7 +1798,17 @@ function objectsToBitmark(bits, options = {}) {
|
|
|
1797
1798
|
const entries = bits.map(
|
|
1798
1799
|
(b) => b !== null && typeof b === "object" && "bit" in b && typeof b.bit === "object" ? b : { bit: b }
|
|
1799
1800
|
);
|
|
1800
|
-
const out = convert(
|
|
1801
|
+
const out = convert(
|
|
1802
|
+
JSON.stringify(entries),
|
|
1803
|
+
"json",
|
|
1804
|
+
"bitmark",
|
|
1805
|
+
options.mode ?? "optimized",
|
|
1806
|
+
false,
|
|
1807
|
+
2,
|
|
1808
|
+
1,
|
|
1809
|
+
false,
|
|
1810
|
+
false
|
|
1811
|
+
);
|
|
1801
1812
|
if (out.startsWith("error:")) throw new Error(out.slice("error:".length).trim());
|
|
1802
1813
|
return out;
|
|
1803
1814
|
}
|
|
@@ -1810,7 +1821,8 @@ function convert2(input, options = {}) {
|
|
|
1810
1821
|
options.pretty ?? false,
|
|
1811
1822
|
options.indent ?? 2,
|
|
1812
1823
|
options.spacesAroundValues ?? 1,
|
|
1813
|
-
options.includeUnknownProperties ?? false
|
|
1824
|
+
options.includeUnknownProperties ?? false,
|
|
1825
|
+
options.mappingReport ?? false
|
|
1814
1826
|
);
|
|
1815
1827
|
}
|
|
1816
1828
|
function canonicalize2(input, options = {}) {
|