mol_dump_lib 0.0.172 → 0.0.173

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/web.mjs CHANGED
@@ -643,7 +643,7 @@ var $;
643
643
  var $;
644
644
  (function ($) {
645
645
  function $mol_promise_like(val) {
646
- return val && typeof val.then === 'function';
646
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
647
647
  }
648
648
  $.$mol_promise_like = $mol_promise_like;
649
649
  })($ || ($ = {}));
@@ -911,6 +911,8 @@ var $;
911
911
  return value;
912
912
  if (value instanceof RegExp)
913
913
  return value.toString();
914
+ if (value instanceof Uint8Array)
915
+ return [...value];
914
916
  let key = $.$mol_key_store.get(value);
915
917
  if (key)
916
918
  return key;
package/web.test.js CHANGED
@@ -2078,6 +2078,11 @@ var $;
2078
2078
  $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
2079
2079
  $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
2080
2080
  },
2081
+ 'Uint8Array'() {
2082
+ $mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
2083
+ $mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
2084
+ $mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
2085
+ },
2081
2086
  'Function'() {
2082
2087
  const func = () => { };
2083
2088
  $mol_assert_equal($mol_key(func), $mol_key(func));