mol_tree2 1.0.506 → 1.0.507

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/node.test.js CHANGED
@@ -2296,6 +2296,8 @@ var $;
2296
2296
  return true;
2297
2297
  }
2298
2298
  function compare_buffer(left, right) {
2299
+ if (left instanceof DataView)
2300
+ return compare_buffer(new Uint8Array(left.buffer, left.byteOffset, left.byteLength), new Uint8Array(right.buffer, left.byteOffset, left.byteLength));
2299
2301
  const len = left.byteLength;
2300
2302
  if (len !== right.byteLength)
2301
2303
  return false;
@@ -2439,6 +2441,11 @@ var $;
2439
2441
  $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
2440
2442
  $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
2441
2443
  },
2444
+ 'DataView'() {
2445
+ $mol_assert_ok($mol_compare_deep(new DataView(new Uint8Array().buffer), new DataView(new Uint8Array().buffer)));
2446
+ $mol_assert_ok($mol_compare_deep(new DataView(new Uint8Array([0]).buffer), new DataView(new Uint8Array([0]).buffer)));
2447
+ $mol_assert_not($mol_compare_deep(new DataView(new Uint8Array([0]).buffer), new DataView(new Uint8Array([1]).buffer)));
2448
+ },
2442
2449
  'Serializale'() {
2443
2450
  class User {
2444
2451
  name;
@@ -2549,7 +2556,7 @@ var $;
2549
2556
  if ('outerHTML' in val)
2550
2557
  return val.outerHTML;
2551
2558
  try {
2552
- return JSON.stringify(val, null, '\t');
2559
+ return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
2553
2560
  }
2554
2561
  catch (error) {
2555
2562
  console.error(error);