mobx 6.13.6 → 6.13.7

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/dist/mobx.esm.js CHANGED
@@ -4703,8 +4703,8 @@ var ObservableSet = /*#__PURE__*/function () {
4703
4703
  if (!change) {
4704
4704
  return this;
4705
4705
  }
4706
- // ideally, value = change.value would be done here, so that values can be
4707
- // changed by interceptor. Same applies for other Set and Map api's.
4706
+ // implemented reassignment same as it's done for ObservableMap
4707
+ value = change.newValue;
4708
4708
  }
4709
4709
  if (!this.has(value)) {
4710
4710
  transaction(function () {
@@ -5759,6 +5759,8 @@ function deepEqual(a, b, depth) {
5759
5759
  return eq(a, b, depth);
5760
5760
  }
5761
5761
  // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
5762
+ // Modified: "Deep compare objects" part to iterate over keys in forward order instead of reverse order.
5763
+ //
5762
5764
  // Internal recursive comparison function for `isEqual`.
5763
5765
  function eq(a, b, depth, aStack, bStack) {
5764
5766
  // Identical objects are equal. `0 === -0`, but they aren't identical.
@@ -5871,15 +5873,14 @@ function eq(a, b, depth, aStack, bStack) {
5871
5873
  } else {
5872
5874
  // Deep compare objects.
5873
5875
  var keys = Object.keys(a);
5874
- var key;
5875
- length = keys.length;
5876
+ var _length = keys.length;
5876
5877
  // Ensure that both objects contain the same number of properties before comparing deep equality.
5877
- if (Object.keys(b).length !== length) {
5878
+ if (Object.keys(b).length !== _length) {
5878
5879
  return false;
5879
5880
  }
5880
- while (length--) {
5881
+ for (var i = 0; i < _length; i++) {
5881
5882
  // Deep compare each member
5882
- key = keys[length];
5883
+ var key = keys[i];
5883
5884
  if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {
5884
5885
  return false;
5885
5886
  }