@gmb/bitmark-parser 3.0.3 → 6.0.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.
@@ -86,7 +86,7 @@ function getStringFromWasm0(ptr, len) {
86
86
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
87
87
  }
88
88
  /**
89
- * Breakscape text (escape bitmark special characters).
89
+ * Unbreakscape text (unescape bitmark special characters).
90
90
  *
91
91
  * `format`: `"bitmark++"` (default) or `"plainText"`
92
92
  * `location`: `"body"` (default) or `"tag"`
@@ -95,7 +95,7 @@ function getStringFromWasm0(ptr, len) {
95
95
  * @param {string} location
96
96
  * @returns {string}
97
97
  */
98
- module.exports.breakscape_text = function(input, format, location) {
98
+ module.exports.unbreakscape_text = function(input, format, location) {
99
99
  let deferred4_0;
100
100
  let deferred4_1;
101
101
  try {
@@ -106,7 +106,7 @@ module.exports.breakscape_text = function(input, format, location) {
106
106
  const len1 = WASM_VECTOR_LEN;
107
107
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
108
108
  const len2 = WASM_VECTOR_LEN;
109
- wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
109
+ wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
110
110
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
111
111
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
112
112
  deferred4_0 = r0;
@@ -119,54 +119,25 @@ module.exports.breakscape_text = function(input, format, location) {
119
119
  };
120
120
 
121
121
  /**
122
- * Query information about supported bit types.
122
+ * Auto-detect input format and convert between bitmark and JSON.
123
123
  *
124
- * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
125
- * `format`: `"text"` or `"json"`
126
- * `bit`: bit name (required when `info_type` is `"bit"`)
127
- * `pretty`: whether to pretty-print JSON output
124
+ * `mode`: `"optimized"` (default) or `"full"`
125
+ * `warnings`: whether to include validation warnings (default: false)
126
+ * `plain_text`: output text as plain text — debug mode (default: false)
127
+ * `pretty`: prettify JSON output (default: false)
128
128
  * `indent`: indent size for pretty-printing (default: 2)
129
- * @param {string} info_type
130
- * @param {string} format
131
- * @param {string} bit
132
- * @param {boolean} pretty
133
- * @param {number} indent
134
- * @returns {string}
135
- */
136
- module.exports.info = function(info_type, format, bit, pretty, indent) {
137
- let deferred4_0;
138
- let deferred4_1;
139
- try {
140
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
141
- const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
142
- const len0 = WASM_VECTOR_LEN;
143
- const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
144
- const len1 = WASM_VECTOR_LEN;
145
- const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
146
- const len2 = WASM_VECTOR_LEN;
147
- wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);
148
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
149
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
150
- deferred4_0 = r0;
151
- deferred4_1 = r1;
152
- return getStringFromWasm0(r0, r1);
153
- } finally {
154
- wasm.__wbindgen_add_to_stack_pointer(16);
155
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
156
- }
157
- };
158
-
159
- /**
160
- * Parse bitmark input text and return the reference JSON format.
161
- *
162
- * Uses the full pipeline: parse → validate → serialize.
163
129
  *
164
- * `mode`: `"optimized"` (default) or `"full"`
130
+ * Returns JSON if input is bitmark, or an error message if input is JSON
131
+ * (generator not yet implemented).
165
132
  * @param {string} input
166
133
  * @param {string} mode
134
+ * @param {boolean} warnings
135
+ * @param {boolean} plain_text
136
+ * @param {boolean} pretty
137
+ * @param {number} indent
167
138
  * @returns {string}
168
139
  */
169
- module.exports.parse = function(input, mode) {
140
+ module.exports.convert = function(input, mode, warnings, plain_text, pretty, indent) {
170
141
  let deferred3_0;
171
142
  let deferred3_1;
172
143
  try {
@@ -175,7 +146,7 @@ module.exports.parse = function(input, mode) {
175
146
  const len0 = WASM_VECTOR_LEN;
176
147
  const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
177
148
  const len1 = WASM_VECTOR_LEN;
178
- wasm.parse(retptr, ptr0, len0, ptr1, len1);
149
+ wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);
179
150
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
180
151
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
181
152
  deferred3_0 = r0;
@@ -220,7 +191,7 @@ module.exports.lex = function(input, stage) {
220
191
  };
221
192
 
222
193
  /**
223
- * Unbreakscape text (unescape bitmark special characters).
194
+ * Breakscape text (escape bitmark special characters).
224
195
  *
225
196
  * `format`: `"bitmark++"` (default) or `"plainText"`
226
197
  * `location`: `"body"` (default) or `"tag"`
@@ -229,7 +200,7 @@ module.exports.lex = function(input, stage) {
229
200
  * @param {string} location
230
201
  * @returns {string}
231
202
  */
232
- module.exports.unbreakscape_text = function(input, format, location) {
203
+ module.exports.breakscape_text = function(input, format, location) {
233
204
  let deferred4_0;
234
205
  let deferred4_1;
235
206
  try {
@@ -240,7 +211,7 @@ module.exports.unbreakscape_text = function(input, format, location) {
240
211
  const len1 = WASM_VECTOR_LEN;
241
212
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
242
213
  const len2 = WASM_VECTOR_LEN;
243
- wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
214
+ wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
244
215
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
245
216
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
246
217
  deferred4_0 = r0;
@@ -253,25 +224,54 @@ module.exports.unbreakscape_text = function(input, format, location) {
253
224
  };
254
225
 
255
226
  /**
256
- * Auto-detect input format and convert between bitmark and JSON.
227
+ * Query information about supported bit types.
257
228
  *
258
- * `mode`: `"optimized"` (default) or `"full"`
259
- * `warnings`: whether to include validation warnings (default: false)
260
- * `plain_text`: output text as plain text — debug mode (default: false)
261
- * `pretty`: prettify JSON output (default: false)
229
+ * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
230
+ * `format`: `"text"` or `"json"`
231
+ * `bit`: bit name (required when `info_type` is `"bit"`)
232
+ * `pretty`: whether to pretty-print JSON output
262
233
  * `indent`: indent size for pretty-printing (default: 2)
234
+ * @param {string} info_type
235
+ * @param {string} format
236
+ * @param {string} bit
237
+ * @param {boolean} pretty
238
+ * @param {number} indent
239
+ * @returns {string}
240
+ */
241
+ module.exports.info = function(info_type, format, bit, pretty, indent) {
242
+ let deferred4_0;
243
+ let deferred4_1;
244
+ try {
245
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
246
+ const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
247
+ const len0 = WASM_VECTOR_LEN;
248
+ const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
249
+ const len1 = WASM_VECTOR_LEN;
250
+ const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
251
+ const len2 = WASM_VECTOR_LEN;
252
+ wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);
253
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
254
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
255
+ deferred4_0 = r0;
256
+ deferred4_1 = r1;
257
+ return getStringFromWasm0(r0, r1);
258
+ } finally {
259
+ wasm.__wbindgen_add_to_stack_pointer(16);
260
+ wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
261
+ }
262
+ };
263
+
264
+ /**
265
+ * Parse bitmark input text and return the reference JSON format.
263
266
  *
264
- * Returns JSON if input is bitmark, or an error message if input is JSON
265
- * (generator not yet implemented).
267
+ * Uses the full pipeline: parse → validate → serialize.
268
+ *
269
+ * `mode`: `"optimized"` (default) or `"full"`
266
270
  * @param {string} input
267
271
  * @param {string} mode
268
- * @param {boolean} warnings
269
- * @param {boolean} plain_text
270
- * @param {boolean} pretty
271
- * @param {number} indent
272
272
  * @returns {string}
273
273
  */
274
- module.exports.convert = function(input, mode, warnings, plain_text, pretty, indent) {
274
+ module.exports.parse = function(input, mode) {
275
275
  let deferred3_0;
276
276
  let deferred3_1;
277
277
  try {
@@ -280,7 +280,7 @@ module.exports.convert = function(input, mode, warnings, plain_text, pretty, ind
280
280
  const len0 = WASM_VECTOR_LEN;
281
281
  const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
282
282
  const len1 = WASM_VECTOR_LEN;
283
- wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);
283
+ wasm.parse(retptr, ptr0, len0, ptr1, len1);
284
284
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
285
285
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
286
286
  deferred3_0 = r0;
Binary file
package/wasm/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Get More Brain Ltd <info@getmorebrain.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for the bitmark parser",
7
- "version": "3.0.3",
7
+ "version": "6.0.1",
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",