mol_jsx_lib 0.0.697 → 0.0.698

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
@@ -846,7 +846,7 @@ var $;
846
846
  var $;
847
847
  (function ($) {
848
848
  function $mol_promise_like(val) {
849
- return val && typeof val.then === 'function';
849
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
850
850
  }
851
851
  $.$mol_promise_like = $mol_promise_like;
852
852
  })($ || ($ = {}));
@@ -1114,6 +1114,8 @@ var $;
1114
1114
  return value;
1115
1115
  if (value instanceof RegExp)
1116
1116
  return value.toString();
1117
+ if (value instanceof Uint8Array)
1118
+ return [...value];
1117
1119
  let key = $.$mol_key_store.get(value);
1118
1120
  if (key)
1119
1121
  return key;
package/web.test.js CHANGED
@@ -689,6 +689,11 @@ var $;
689
689
  $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
690
690
  $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
691
691
  },
692
+ 'Uint8Array'() {
693
+ $mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
694
+ $mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
695
+ $mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
696
+ },
692
697
  'Function'() {
693
698
  const func = () => { };
694
699
  $mol_assert_equal($mol_key(func), $mol_key(func));