mol_jsx_lib 0.0.697 → 0.0.699

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
@@ -1443,7 +1443,7 @@ var $;
1443
1443
  var $;
1444
1444
  (function ($) {
1445
1445
  function $mol_promise_like(val) {
1446
- return val && typeof val.then === 'function';
1446
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
1447
1447
  }
1448
1448
  $.$mol_promise_like = $mol_promise_like;
1449
1449
  })($ || ($ = {}));
@@ -1711,6 +1711,8 @@ var $;
1711
1711
  return value;
1712
1712
  if (value instanceof RegExp)
1713
1713
  return value.toString();
1714
+ if (value instanceof Uint8Array)
1715
+ return [...value];
1714
1716
  let key = $.$mol_key_store.get(value);
1715
1717
  if (key)
1716
1718
  return key;
package/node.test.js CHANGED
@@ -1435,7 +1435,7 @@ var $;
1435
1435
  var $;
1436
1436
  (function ($) {
1437
1437
  function $mol_promise_like(val) {
1438
- return val && typeof val.then === 'function';
1438
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
1439
1439
  }
1440
1440
  $.$mol_promise_like = $mol_promise_like;
1441
1441
  })($ || ($ = {}));
@@ -1703,6 +1703,8 @@ var $;
1703
1703
  return value;
1704
1704
  if (value instanceof RegExp)
1705
1705
  return value.toString();
1706
+ if (value instanceof Uint8Array)
1707
+ return [...value];
1706
1708
  let key = $.$mol_key_store.get(value);
1707
1709
  if (key)
1708
1710
  return key;
@@ -3623,6 +3625,11 @@ var $;
3623
3625
  $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
3624
3626
  $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
3625
3627
  },
3628
+ 'Uint8Array'() {
3629
+ $mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
3630
+ $mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
3631
+ $mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
3632
+ },
3626
3633
  'Function'() {
3627
3634
  const func = () => { };
3628
3635
  $mol_assert_equal($mol_key(func), $mol_key(func));