mol_wire_lib 1.0.828 → 1.0.830

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
  })($ || ($ = {}));
@@ -1075,6 +1075,8 @@ var $;
1075
1075
  return value;
1076
1076
  if (value instanceof RegExp)
1077
1077
  return value.toString();
1078
+ if (value instanceof Uint8Array)
1079
+ return [...value];
1078
1080
  let key = $.$mol_key_store.get(value);
1079
1081
  if (key)
1080
1082
  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
  })($ || ($ = {}));
@@ -1067,6 +1067,8 @@ var $;
1067
1067
  return value;
1068
1068
  if (value instanceof RegExp)
1069
1069
  return value.toString();
1070
+ if (value instanceof Uint8Array)
1071
+ return [...value];
1070
1072
  let key = $.$mol_key_store.get(value);
1071
1073
  if (key)
1072
1074
  return key;
@@ -3913,6 +3915,11 @@ var $;
3913
3915
  $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
3914
3916
  $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
3915
3917
  },
3918
+ 'Uint8Array'() {
3919
+ $mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
3920
+ $mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
3921
+ $mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
3922
+ },
3916
3923
  'Function'() {
3917
3924
  const func = () => { };
3918
3925
  $mol_assert_equal($mol_key(func), $mol_key(func));