mol_wire_dom 0.0.813 → 0.0.815

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.mjs CHANGED
@@ -617,7 +617,7 @@ var $;
617
617
  var $;
618
618
  (function ($) {
619
619
  function $mol_promise_like(val) {
620
- return val && typeof val.then === 'function';
620
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
621
621
  }
622
622
  $.$mol_promise_like = $mol_promise_like;
623
623
  })($ || ($ = {}));
@@ -885,6 +885,8 @@ var $;
885
885
  return value;
886
886
  if (value instanceof RegExp)
887
887
  return value.toString();
888
+ if (value instanceof Uint8Array)
889
+ return [...value];
888
890
  let key = $.$mol_key_store.get(value);
889
891
  if (key)
890
892
  return key;
package/node.test.js CHANGED
@@ -609,7 +609,7 @@ var $;
609
609
  var $;
610
610
  (function ($) {
611
611
  function $mol_promise_like(val) {
612
- return val && typeof val.then === 'function';
612
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
613
613
  }
614
614
  $.$mol_promise_like = $mol_promise_like;
615
615
  })($ || ($ = {}));
@@ -877,6 +877,8 @@ var $;
877
877
  return value;
878
878
  if (value instanceof RegExp)
879
879
  return value.toString();
880
+ if (value instanceof Uint8Array)
881
+ return [...value];
880
882
  let key = $.$mol_key_store.get(value);
881
883
  if (key)
882
884
  return key;
@@ -3457,6 +3459,11 @@ var $;
3457
3459
  $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
3458
3460
  $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
3459
3461
  },
3462
+ 'Uint8Array'() {
3463
+ $mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
3464
+ $mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
3465
+ $mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
3466
+ },
3460
3467
  'Function'() {
3461
3468
  const func = () => { };
3462
3469
  $mol_assert_equal($mol_key(func), $mol_key(func));