mol_mutable 0.0.334 → 0.0.335

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
@@ -1045,6 +1045,8 @@ var $;
1045
1045
  return true;
1046
1046
  }
1047
1047
  function compare_buffer(left, right) {
1048
+ if (left instanceof DataView)
1049
+ return compare_buffer(new Uint8Array(left.buffer, left.byteOffset, left.byteLength), new Uint8Array(right.buffer, left.byteOffset, left.byteLength));
1048
1050
  const len = left.byteLength;
1049
1051
  if (len !== right.byteLength)
1050
1052
  return false;
@@ -1188,6 +1190,11 @@ var $;
1188
1190
  $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
1189
1191
  $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
1190
1192
  },
1193
+ 'DataView'() {
1194
+ $mol_assert_ok($mol_compare_deep(new DataView(new Uint8Array().buffer), new DataView(new Uint8Array().buffer)));
1195
+ $mol_assert_ok($mol_compare_deep(new DataView(new Uint8Array([0]).buffer), new DataView(new Uint8Array([0]).buffer)));
1196
+ $mol_assert_not($mol_compare_deep(new DataView(new Uint8Array([0]).buffer), new DataView(new Uint8Array([1]).buffer)));
1197
+ },
1191
1198
  'Serializale'() {
1192
1199
  class User {
1193
1200
  name;
@@ -1298,7 +1305,7 @@ var $;
1298
1305
  if ('outerHTML' in val)
1299
1306
  return val.outerHTML;
1300
1307
  try {
1301
- return JSON.stringify(val, null, '\t');
1308
+ return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
1302
1309
  }
1303
1310
  catch (error) {
1304
1311
  console.error(error);