mol_crypto_lib 0.0.919 → 0.0.921

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
@@ -1988,6 +1988,8 @@ var $;
1988
1988
  return true;
1989
1989
  }
1990
1990
  function compare_buffer(left, right) {
1991
+ if (left instanceof DataView)
1992
+ return compare_buffer(new Uint8Array(left.buffer, left.byteOffset, left.byteLength), new Uint8Array(right.buffer, left.byteOffset, left.byteLength));
1991
1993
  const len = left.byteLength;
1992
1994
  if (len !== right.byteLength)
1993
1995
  return false;
@@ -2131,6 +2133,11 @@ var $;
2131
2133
  $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
2132
2134
  $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
2133
2135
  },
2136
+ 'DataView'() {
2137
+ $mol_assert_ok($mol_compare_deep(new DataView(new Uint8Array().buffer), new DataView(new Uint8Array().buffer)));
2138
+ $mol_assert_ok($mol_compare_deep(new DataView(new Uint8Array([0]).buffer), new DataView(new Uint8Array([0]).buffer)));
2139
+ $mol_assert_not($mol_compare_deep(new DataView(new Uint8Array([0]).buffer), new DataView(new Uint8Array([1]).buffer)));
2140
+ },
2134
2141
  'Serializale'() {
2135
2142
  class User {
2136
2143
  name;
@@ -2241,7 +2248,7 @@ var $;
2241
2248
  if ('outerHTML' in val)
2242
2249
  return val.outerHTML;
2243
2250
  try {
2244
- return JSON.stringify(val, null, '\t');
2251
+ return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
2245
2252
  }
2246
2253
  catch (error) {
2247
2254
  console.error(error);