@gmb/bitmark-parser 6.1.0 → 6.1.2

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.
@@ -118,34 +118,38 @@ module.exports.lex = function(input, stage) {
118
118
  };
119
119
 
120
120
  /**
121
- * Pretty-print a compact JSON string with the given indent. Used to format a
122
- * document recombined on the JS side (the per-bit hook path) so its output
123
- * matches the in-Rust recombination byte-for-byte.
124
- * @param {string} json
125
- * @param {number} indent
121
+ * Parse bitmark input text and return the reference JSON format.
122
+ *
123
+ * Uses the full pipeline: parse → validate → serialize.
124
+ *
125
+ * `mode`: `"optimized"` (default) or `"full"`
126
+ * @param {string} input
127
+ * @param {string} mode
126
128
  * @returns {string}
127
129
  */
128
- module.exports.prettify = function(json, indent) {
129
- let deferred2_0;
130
- let deferred2_1;
130
+ module.exports.parse = function(input, mode) {
131
+ let deferred3_0;
132
+ let deferred3_1;
131
133
  try {
132
134
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
133
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
135
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
134
136
  const len0 = WASM_VECTOR_LEN;
135
- wasm.prettify(retptr, ptr0, len0, indent);
137
+ const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
138
+ const len1 = WASM_VECTOR_LEN;
139
+ wasm.parse(retptr, ptr0, len0, ptr1, len1);
136
140
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
137
141
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
138
- deferred2_0 = r0;
139
- deferred2_1 = r1;
142
+ deferred3_0 = r0;
143
+ deferred3_1 = r1;
140
144
  return getStringFromWasm0(r0, r1);
141
145
  } finally {
142
146
  wasm.__wbindgen_add_to_stack_pointer(16);
143
- wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
147
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
144
148
  }
145
149
  };
146
150
 
147
151
  /**
148
- * Unbreakscape text (unescape bitmark special characters).
152
+ * Breakscape text (escape bitmark special characters).
149
153
  *
150
154
  * `format`: `"bitmark++"` (default) or `"plainText"`
151
155
  * `location`: `"body"` (default) or `"tag"`
@@ -154,7 +158,7 @@ module.exports.prettify = function(json, indent) {
154
158
  * @param {string} location
155
159
  * @returns {string}
156
160
  */
157
- module.exports.unbreakscape_text = function(input, format, location) {
161
+ module.exports.breakscape_text = function(input, format, location) {
158
162
  let deferred4_0;
159
163
  let deferred4_1;
160
164
  try {
@@ -165,7 +169,7 @@ module.exports.unbreakscape_text = function(input, format, location) {
165
169
  const len1 = WASM_VECTOR_LEN;
166
170
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
167
171
  const len2 = WASM_VECTOR_LEN;
168
- wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
172
+ wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
169
173
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
170
174
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
171
175
  deferred4_0 = r0;
@@ -178,32 +182,27 @@ module.exports.unbreakscape_text = function(input, format, location) {
178
182
  };
179
183
 
180
184
  /**
181
- * Query information about supported bit types.
185
+ * Unbreakscape text (unescape bitmark special characters).
182
186
  *
183
- * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
184
- * `format`: `"text"` or `"json"`
185
- * `bit`: bit name (required when `info_type` is `"bit"`)
186
- * `pretty`: whether to pretty-print JSON output
187
- * `indent`: indent size for pretty-printing (default: 2)
188
- * @param {string} info_type
187
+ * `format`: `"bitmark++"` (default) or `"plainText"`
188
+ * `location`: `"body"` (default) or `"tag"`
189
+ * @param {string} input
189
190
  * @param {string} format
190
- * @param {string} bit
191
- * @param {boolean} pretty
192
- * @param {number} indent
191
+ * @param {string} location
193
192
  * @returns {string}
194
193
  */
195
- module.exports.info = function(info_type, format, bit, pretty, indent) {
194
+ module.exports.unbreakscape_text = function(input, format, location) {
196
195
  let deferred4_0;
197
196
  let deferred4_1;
198
197
  try {
199
198
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
200
- const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
199
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
201
200
  const len0 = WASM_VECTOR_LEN;
202
201
  const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
203
202
  const len1 = WASM_VECTOR_LEN;
204
- const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
203
+ const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
205
204
  const len2 = WASM_VECTOR_LEN;
206
- wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);
205
+ wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
207
206
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
208
207
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
209
208
  deferred4_0 = r0;
@@ -216,130 +215,139 @@ module.exports.info = function(info_type, format, bit, pretty, indent) {
216
215
  };
217
216
 
218
217
  /**
219
- * Apply a patch (a JSON array of patch entries) to every bit and re-emit.
220
- *
221
- * `input_format_sel`: `"auto"` | `"bitmark"` | `"json"`.
222
- * `output_format_sel`: `"bitmark"` | `"json"` (default json).
223
- * `patch_json`: the patch entry array (empty string = no patches, i.e. a
224
- * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
225
- * runs sequentially. Returns the document text/JSON, or `error: …`.
218
+ * Split a JSON document (a top-level array of bit envelopes) into its per-bit
219
+ * envelope objects, returned as a JSON array string. Lets a JS caller iterate
220
+ * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).
221
+ * Returns `error: …` if the input is not a JSON array of bits.
226
222
  * @param {string} input
227
- * @param {string} input_format_sel
228
- * @param {string} output_format_sel
229
- * @param {string} mode
230
- * @param {string} patch_json
231
- * @param {boolean} pretty
232
- * @param {number} indent
233
- * @param {number} spaces_around_values
234
223
  * @returns {string}
235
224
  */
236
- module.exports.transform = function(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
237
- let deferred6_0;
238
- let deferred6_1;
225
+ module.exports.split_json_bits = function(input) {
226
+ let deferred2_0;
227
+ let deferred2_1;
239
228
  try {
240
229
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
241
230
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
242
231
  const len0 = WASM_VECTOR_LEN;
243
- const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
244
- const len1 = WASM_VECTOR_LEN;
245
- const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
246
- const len2 = WASM_VECTOR_LEN;
247
- const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
248
- const len3 = WASM_VECTOR_LEN;
249
- const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
250
- const len4 = WASM_VECTOR_LEN;
251
- wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
232
+ wasm.split_json_bits(retptr, ptr0, len0);
252
233
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
253
234
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
254
- deferred6_0 = r0;
255
- deferred6_1 = r1;
235
+ deferred2_0 = r0;
236
+ deferred2_1 = r1;
256
237
  return getStringFromWasm0(r0, r1);
257
238
  } finally {
258
239
  wasm.__wbindgen_add_to_stack_pointer(16);
259
- wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
240
+ wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
260
241
  }
261
242
  };
262
243
 
263
244
  /**
264
- * Re-emit input in its own format in canonical form at `mode`.
265
- * @param {string} input
266
- * @param {string} mode
267
- * @param {boolean} pretty
245
+ * Pretty-print a compact JSON string with the given indent. Used to format a
246
+ * document recombined on the JS side (the per-bit hook path) so its output
247
+ * matches the in-Rust recombination byte-for-byte.
248
+ * @param {string} json
268
249
  * @param {number} indent
269
- * @param {number} spaces_around_values
270
250
  * @returns {string}
271
251
  */
272
- module.exports.canonicalize = function(input, mode, pretty, indent, spaces_around_values) {
273
- let deferred3_0;
274
- let deferred3_1;
252
+ module.exports.prettify = function(json, indent) {
253
+ let deferred2_0;
254
+ let deferred2_1;
275
255
  try {
276
256
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
277
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
257
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
278
258
  const len0 = WASM_VECTOR_LEN;
279
- const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
280
- const len1 = WASM_VECTOR_LEN;
281
- wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, pretty, indent, spaces_around_values);
259
+ wasm.prettify(retptr, ptr0, len0, indent);
282
260
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
283
261
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
284
- deferred3_0 = r0;
285
- deferred3_1 = r1;
262
+ deferred2_0 = r0;
263
+ deferred2_1 = r1;
286
264
  return getStringFromWasm0(r0, r1);
287
265
  } finally {
288
266
  wasm.__wbindgen_add_to_stack_pointer(16);
289
- wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
267
+ wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
290
268
  }
291
269
  };
292
270
 
293
271
  /**
294
- * Split a JSON document (a top-level array of bit envelopes) into its per-bit
295
- * envelope objects, returned as a JSON array string. Lets a JS caller iterate
296
- * JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).
297
- * Returns `error: …` if the input is not a JSON array of bits.
272
+ * Apply a patch (a JSON array of patch entries) to every bit and re-emit.
273
+ *
274
+ * `input_format_sel`: `"auto"` | `"bitmark"` | `"json"`.
275
+ * `output_format_sel`: `"bitmark"` | `"json"` (default json).
276
+ * `patch_json`: the patch entry array (empty string = no patches, i.e. a
277
+ * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
278
+ * runs sequentially. Returns the document text/JSON, or `error: …`.
298
279
  * @param {string} input
280
+ * @param {string} input_format_sel
281
+ * @param {string} output_format_sel
282
+ * @param {string} mode
283
+ * @param {string} patch_json
284
+ * @param {boolean} pretty
285
+ * @param {number} indent
286
+ * @param {number} spaces_around_values
299
287
  * @returns {string}
300
288
  */
301
- module.exports.split_json_bits = function(input) {
302
- let deferred2_0;
303
- let deferred2_1;
289
+ module.exports.transform = function(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
290
+ let deferred6_0;
291
+ let deferred6_1;
304
292
  try {
305
293
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
306
294
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
307
295
  const len0 = WASM_VECTOR_LEN;
308
- wasm.split_json_bits(retptr, ptr0, len0);
296
+ const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
297
+ const len1 = WASM_VECTOR_LEN;
298
+ const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
299
+ const len2 = WASM_VECTOR_LEN;
300
+ const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
301
+ const len3 = WASM_VECTOR_LEN;
302
+ const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
303
+ const len4 = WASM_VECTOR_LEN;
304
+ wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
309
305
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
310
306
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
311
- deferred2_0 = r0;
312
- deferred2_1 = r1;
307
+ deferred6_0 = r0;
308
+ deferred6_1 = r1;
313
309
  return getStringFromWasm0(r0, r1);
314
310
  } finally {
315
311
  wasm.__wbindgen_add_to_stack_pointer(16);
316
- wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
312
+ wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
317
313
  }
318
314
  };
319
315
 
320
316
  /**
321
- * Re-emit input in its own format at full mode (all keys).
322
- * @param {string} input
317
+ * Query information about supported bit types.
318
+ *
319
+ * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
320
+ * `format`: `"text"` or `"json"`
321
+ * `bit`: bit name (required when `info_type` is `"bit"`)
322
+ * `pretty`: whether to pretty-print JSON output
323
+ * `indent`: indent size for pretty-printing (default: 2)
324
+ * @param {string} info_type
325
+ * @param {string} format
326
+ * @param {string} bit
323
327
  * @param {boolean} pretty
324
328
  * @param {number} indent
325
329
  * @returns {string}
326
330
  */
327
- module.exports.fullize = function(input, pretty, indent) {
328
- let deferred2_0;
329
- let deferred2_1;
331
+ module.exports.info = function(info_type, format, bit, pretty, indent) {
332
+ let deferred4_0;
333
+ let deferred4_1;
330
334
  try {
331
335
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
332
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
336
+ const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
333
337
  const len0 = WASM_VECTOR_LEN;
334
- wasm.fullize(retptr, ptr0, len0, pretty, indent);
338
+ const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
339
+ const len1 = WASM_VECTOR_LEN;
340
+ const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
341
+ const len2 = WASM_VECTOR_LEN;
342
+ wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);
335
343
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
336
344
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
337
- deferred2_0 = r0;
338
- deferred2_1 = r1;
345
+ deferred4_0 = r0;
346
+ deferred4_1 = r1;
339
347
  return getStringFromWasm0(r0, r1);
340
348
  } finally {
341
349
  wasm.__wbindgen_add_to_stack_pointer(16);
342
- wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
350
+ wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
343
351
  }
344
352
  };
345
353
 
@@ -385,105 +393,84 @@ module.exports.convert = function(input, input_format_sel, output_format_sel, mo
385
393
  };
386
394
 
387
395
  /**
388
- * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection
389
- * used across the API so a JS caller can resolve `"auto"` consistently.
390
- * @param {string} input
391
- * @returns {boolean}
392
- */
393
- module.exports.is_bitmark = function(input) {
394
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
395
- const len0 = WASM_VECTOR_LEN;
396
- const ret = wasm.is_bitmark(ptr0, len0);
397
- return ret !== 0;
398
- };
399
-
400
- /**
401
- * Breakscape text (escape bitmark special characters).
402
- *
403
- * `format`: `"bitmark++"` (default) or `"plainText"`
404
- * `location`: `"body"` (default) or `"tag"`
396
+ * Re-emit input in its own format at optimized mode (omit natural defaults).
405
397
  * @param {string} input
406
- * @param {string} format
407
- * @param {string} location
398
+ * @param {boolean} pretty
399
+ * @param {number} indent
408
400
  * @returns {string}
409
401
  */
410
- module.exports.breakscape_text = function(input, format, location) {
411
- let deferred4_0;
412
- let deferred4_1;
402
+ module.exports.optimize = function(input, pretty, indent) {
403
+ let deferred2_0;
404
+ let deferred2_1;
413
405
  try {
414
406
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
415
407
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
416
408
  const len0 = WASM_VECTOR_LEN;
417
- const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
418
- const len1 = WASM_VECTOR_LEN;
419
- const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
420
- const len2 = WASM_VECTOR_LEN;
421
- wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
409
+ wasm.optimize(retptr, ptr0, len0, pretty, indent);
422
410
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
423
411
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
424
- deferred4_0 = r0;
425
- deferred4_1 = r1;
412
+ deferred2_0 = r0;
413
+ deferred2_1 = r1;
426
414
  return getStringFromWasm0(r0, r1);
427
415
  } finally {
428
416
  wasm.__wbindgen_add_to_stack_pointer(16);
429
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
417
+ wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
430
418
  }
431
419
  };
432
420
 
433
421
  /**
434
- * Parse bitmark input text and return the reference JSON format.
435
- *
436
- * Uses the full pipeline: parse → validate → serialize.
437
- *
438
- * `mode`: `"optimized"` (default) or `"full"`
422
+ * Re-emit input in its own format at full mode (all keys).
439
423
  * @param {string} input
440
- * @param {string} mode
424
+ * @param {boolean} pretty
425
+ * @param {number} indent
441
426
  * @returns {string}
442
427
  */
443
- module.exports.parse = function(input, mode) {
444
- let deferred3_0;
445
- let deferred3_1;
428
+ module.exports.fullize = function(input, pretty, indent) {
429
+ let deferred2_0;
430
+ let deferred2_1;
446
431
  try {
447
432
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
448
433
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
449
434
  const len0 = WASM_VECTOR_LEN;
450
- const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
451
- const len1 = WASM_VECTOR_LEN;
452
- wasm.parse(retptr, ptr0, len0, ptr1, len1);
435
+ wasm.fullize(retptr, ptr0, len0, pretty, indent);
453
436
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
454
437
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
455
- deferred3_0 = r0;
456
- deferred3_1 = r1;
438
+ deferred2_0 = r0;
439
+ deferred2_1 = r1;
457
440
  return getStringFromWasm0(r0, r1);
458
441
  } finally {
459
442
  wasm.__wbindgen_add_to_stack_pointer(16);
460
- wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
443
+ wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
461
444
  }
462
445
  };
463
446
 
464
447
  /**
465
- * Re-emit input in its own format at optimized mode (omit natural defaults).
448
+ * Re-emit input in its own format in canonical form at `mode`.
466
449
  * @param {string} input
450
+ * @param {string} mode
467
451
  * @param {boolean} pretty
468
452
  * @param {number} indent
453
+ * @param {number} spaces_around_values
469
454
  * @returns {string}
470
455
  */
471
- module.exports.optimize = function(input, pretty, indent) {
472
- let deferred2_0;
473
- let deferred2_1;
456
+ module.exports.canonicalize = function(input, mode, pretty, indent, spaces_around_values) {
457
+ let deferred3_0;
458
+ let deferred3_1;
474
459
  try {
475
460
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
476
461
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
477
462
  const len0 = WASM_VECTOR_LEN;
478
- wasm.optimize(retptr, ptr0, len0, pretty, indent);
463
+ const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
464
+ const len1 = WASM_VECTOR_LEN;
465
+ wasm.canonicalize(retptr, ptr0, len0, ptr1, len1, pretty, indent, spaces_around_values);
479
466
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
480
467
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
481
- deferred2_0 = r0;
482
- deferred2_1 = r1;
468
+ deferred3_0 = r0;
469
+ deferred3_1 = r1;
483
470
  return getStringFromWasm0(r0, r1);
484
471
  } finally {
485
472
  wasm.__wbindgen_add_to_stack_pointer(16);
486
- wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
473
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
487
474
  }
488
475
  };
489
476
 
@@ -539,6 +526,19 @@ module.exports.split_bits = function(input) {
539
526
  }
540
527
  };
541
528
 
529
+ /**
530
+ * Whether `input` looks like bitmark (vs JSON). Mirrors the auto-detection
531
+ * used across the API so a JS caller can resolve `"auto"` consistently.
532
+ * @param {string} input
533
+ * @returns {boolean}
534
+ */
535
+ module.exports.is_bitmark = function(input) {
536
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
537
+ const len0 = WASM_VECTOR_LEN;
538
+ const ret = wasm.is_bitmark(ptr0, len0);
539
+ return ret !== 0;
540
+ };
541
+
542
542
  const path = require('path').join(__dirname, 'bitmark_wasm_bg.wasm');
543
543
  const bytes = require('fs').readFileSync(path);
544
544
 
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": "6.1.0",
7
+ "version": "6.1.2",
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",