mol_plot_all 1.2.837 → 1.2.838

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
@@ -652,7 +652,7 @@ var $;
652
652
  var $;
653
653
  (function ($) {
654
654
  function $mol_promise_like(val) {
655
- return val && typeof val.then === 'function';
655
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
656
656
  }
657
657
  $.$mol_promise_like = $mol_promise_like;
658
658
  })($ || ($ = {}));
@@ -920,6 +920,8 @@ var $;
920
920
  return value;
921
921
  if (value instanceof RegExp)
922
922
  return value.toString();
923
+ if (value instanceof Uint8Array)
924
+ return [...value];
923
925
  let key = $.$mol_key_store.get(value);
924
926
  if (key)
925
927
  return key;
package/node.test.js CHANGED
@@ -644,7 +644,7 @@ var $;
644
644
  var $;
645
645
  (function ($) {
646
646
  function $mol_promise_like(val) {
647
- return val && typeof val.then === 'function';
647
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
648
648
  }
649
649
  $.$mol_promise_like = $mol_promise_like;
650
650
  })($ || ($ = {}));
@@ -912,6 +912,8 @@ var $;
912
912
  return value;
913
913
  if (value instanceof RegExp)
914
914
  return value.toString();
915
+ if (value instanceof Uint8Array)
916
+ return [...value];
915
917
  let key = $.$mol_key_store.get(value);
916
918
  if (key)
917
919
  return key;
@@ -8414,6 +8416,11 @@ var $;
8414
8416
  $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
8415
8417
  $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
8416
8418
  },
8419
+ 'Uint8Array'() {
8420
+ $mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
8421
+ $mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
8422
+ $mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
8423
+ },
8417
8424
  'Function'() {
8418
8425
  const func = () => { };
8419
8426
  $mol_assert_equal($mol_key(func), $mol_key(func));