hyoo_sync_client 0.0.260 → 0.0.262

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
@@ -1853,7 +1853,7 @@ var $;
1853
1853
  var $;
1854
1854
  (function ($) {
1855
1855
  function $mol_promise_like(val) {
1856
- return val && typeof val.then === 'function';
1856
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
1857
1857
  }
1858
1858
  $.$mol_promise_like = $mol_promise_like;
1859
1859
  })($ || ($ = {}));
@@ -2121,6 +2121,8 @@ var $;
2121
2121
  return value;
2122
2122
  if (value instanceof RegExp)
2123
2123
  return value.toString();
2124
+ if (value instanceof Uint8Array)
2125
+ return [...value];
2124
2126
  let key = $.$mol_key_store.get(value);
2125
2127
  if (key)
2126
2128
  return key;
package/node.test.js CHANGED
@@ -1845,7 +1845,7 @@ var $;
1845
1845
  var $;
1846
1846
  (function ($) {
1847
1847
  function $mol_promise_like(val) {
1848
- return val && typeof val.then === 'function';
1848
+ return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
1849
1849
  }
1850
1850
  $.$mol_promise_like = $mol_promise_like;
1851
1851
  })($ || ($ = {}));
@@ -2113,6 +2113,8 @@ var $;
2113
2113
  return value;
2114
2114
  if (value instanceof RegExp)
2115
2115
  return value.toString();
2116
+ if (value instanceof Uint8Array)
2117
+ return [...value];
2116
2118
  let key = $.$mol_key_store.get(value);
2117
2119
  if (key)
2118
2120
  return key;
@@ -8556,6 +8558,11 @@ var $;
8556
8558
  $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
8557
8559
  $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
8558
8560
  },
8561
+ 'Uint8Array'() {
8562
+ $mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
8563
+ $mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
8564
+ $mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
8565
+ },
8559
8566
  'Function'() {
8560
8567
  const func = () => { };
8561
8568
  $mol_assert_equal($mol_key(func), $mol_key(func));