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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # mobx
2
2
 
3
+ ## 6.13.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`54e3f71ca02f09b3107290f18d8484b70a6e2f0b`](https://github.com/mobxjs/mobx/commit/54e3f71ca02f09b3107290f18d8484b70a6e2f0b) [#4528](https://github.com/mobxjs/mobx/pull/4528) Thanks [@k-g-a](https://github.com/k-g-a)! - Fix observable.set not respecting the new value from interceptors
8
+
3
9
  ## 6.13.6
4
10
 
5
11
  ### Patch Changes
@@ -4682,8 +4682,8 @@ var ObservableSet = /*#__PURE__*/function () {
4682
4682
  if (!change) {
4683
4683
  return this;
4684
4684
  }
4685
- // ideally, value = change.value would be done here, so that values can be
4686
- // changed by interceptor. Same applies for other Set and Map api's.
4685
+ // implemented reassignment same as it's done for ObservableMap
4686
+ value = change.newValue;
4687
4687
  }
4688
4688
  if (!this.has(value)) {
4689
4689
  transaction(function () {
@@ -5738,6 +5738,8 @@ function deepEqual(a, b, depth) {
5738
5738
  return eq(a, b, depth);
5739
5739
  }
5740
5740
  // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
5741
+ // Modified: "Deep compare objects" part to iterate over keys in forward order instead of reverse order.
5742
+ //
5741
5743
  // Internal recursive comparison function for `isEqual`.
5742
5744
  function eq(a, b, depth, aStack, bStack) {
5743
5745
  // Identical objects are equal. `0 === -0`, but they aren't identical.
@@ -5850,15 +5852,14 @@ function eq(a, b, depth, aStack, bStack) {
5850
5852
  } else {
5851
5853
  // Deep compare objects.
5852
5854
  var keys = Object.keys(a);
5853
- var key;
5854
- length = keys.length;
5855
+ var _length = keys.length;
5855
5856
  // Ensure that both objects contain the same number of properties before comparing deep equality.
5856
- if (Object.keys(b).length !== length) {
5857
+ if (Object.keys(b).length !== _length) {
5857
5858
  return false;
5858
5859
  }
5859
- while (length--) {
5860
+ for (var i = 0; i < _length; i++) {
5860
5861
  // Deep compare each member
5861
- key = keys[length];
5862
+ var key = keys[i];
5862
5863
  if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {
5863
5864
  return false;
5864
5865
  }