mol_jsx_lib 0.0.397 → 0.0.398

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
@@ -1713,7 +1713,9 @@ var $;
1713
1713
  }
1714
1714
  let result;
1715
1715
  try {
1716
- if (left_proto && !Reflect.getPrototypeOf(left_proto))
1716
+ if (!left_proto)
1717
+ result = compare_pojo(left, right);
1718
+ else if (!Reflect.getPrototypeOf(left_proto))
1717
1719
  result = compare_pojo(left, right);
1718
1720
  else if (Array.isArray(left))
1719
1721
  result = compare_array(left, right);
@@ -1781,10 +1783,18 @@ var $;
1781
1783
  function compare_pojo(left, right) {
1782
1784
  const left_keys = Object.getOwnPropertyNames(left);
1783
1785
  const right_keys = Object.getOwnPropertyNames(right);
1784
- if (left_keys.length !== right_keys.length)
1786
+ if (!compare_array(left_keys, right_keys))
1785
1787
  return false;
1786
1788
  for (let key of left_keys) {
1787
- if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
1789
+ if (!$mol_compare_deep(left[key], right[key]))
1790
+ return false;
1791
+ }
1792
+ const left_syms = Object.getOwnPropertySymbols(left);
1793
+ const right_syms = Object.getOwnPropertySymbols(right);
1794
+ if (!compare_array(left_syms, right_syms))
1795
+ return false;
1796
+ for (let key of left_syms) {
1797
+ if (!$mol_compare_deep(left[key], right[key]))
1788
1798
  return false;
1789
1799
  }
1790
1800
  return true;