mobx 6.13.5 → 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.
@@ -4678,8 +4678,8 @@ var ObservableSet = /*#__PURE__*/function () {
4678
4678
  if (!change) {
4679
4679
  return this;
4680
4680
  }
4681
- // ideally, value = change.value would be done here, so that values can be
4682
- // changed by interceptor. Same applies for other Set and Map api's.
4681
+ // implemented reassignment same as it's done for ObservableMap
4682
+ value = change.newValue;
4683
4683
  }
4684
4684
  if (!this.has(value)) {
4685
4685
  transaction(function () {
@@ -4751,19 +4751,18 @@ var ObservableSet = /*#__PURE__*/function () {
4751
4751
  return this.data_.has(this.dehanceValue_(value));
4752
4752
  };
4753
4753
  _proto.entries = function entries() {
4754
- var nextIndex = 0;
4755
- var keys = Array.from(this.keys());
4756
- var values = Array.from(this.values());
4754
+ var values = this.values();
4757
4755
  return makeIterableForSet({
4758
4756
  next: function next() {
4759
- var index = nextIndex;
4760
- nextIndex += 1;
4761
- return index < values.length ? {
4762
- value: [keys[index], values[index]],
4763
- done: false
4757
+ var _values$next = values.next(),
4758
+ value = _values$next.value,
4759
+ done = _values$next.done;
4760
+ return !done ? {
4761
+ value: [value, value],
4762
+ done: done
4764
4763
  } : {
4765
4764
  value: undefined,
4766
- done: true
4765
+ done: done
4767
4766
  };
4768
4767
  }
4769
4768
  });
@@ -4774,16 +4773,18 @@ var ObservableSet = /*#__PURE__*/function () {
4774
4773
  _proto.values = function values() {
4775
4774
  this.atom_.reportObserved();
4776
4775
  var self = this;
4777
- var nextIndex = 0;
4778
- var observableValues = Array.from(this.data_.values());
4776
+ var values = this.data_.values();
4779
4777
  return makeIterableForSet({
4780
4778
  next: function next() {
4781
- return nextIndex < observableValues.length ? {
4782
- value: self.dehanceValue_(observableValues[nextIndex++]),
4783
- done: false
4779
+ var _values$next2 = values.next(),
4780
+ value = _values$next2.value,
4781
+ done = _values$next2.done;
4782
+ return !done ? {
4783
+ value: self.dehanceValue_(value),
4784
+ done: done
4784
4785
  } : {
4785
4786
  value: undefined,
4786
- done: true
4787
+ done: done
4787
4788
  };
4788
4789
  }
4789
4790
  });
@@ -5733,6 +5734,8 @@ function deepEqual(a, b, depth) {
5733
5734
  return eq(a, b, depth);
5734
5735
  }
5735
5736
  // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
5737
+ // Modified: "Deep compare objects" part to iterate over keys in forward order instead of reverse order.
5738
+ //
5736
5739
  // Internal recursive comparison function for `isEqual`.
5737
5740
  function eq(a, b, depth, aStack, bStack) {
5738
5741
  // Identical objects are equal. `0 === -0`, but they aren't identical.
@@ -5845,15 +5848,14 @@ function eq(a, b, depth, aStack, bStack) {
5845
5848
  } else {
5846
5849
  // Deep compare objects.
5847
5850
  var keys = Object.keys(a);
5848
- var key;
5849
- length = keys.length;
5851
+ var _length = keys.length;
5850
5852
  // Ensure that both objects contain the same number of properties before comparing deep equality.
5851
- if (Object.keys(b).length !== length) {
5853
+ if (Object.keys(b).length !== _length) {
5852
5854
  return false;
5853
5855
  }
5854
- while (length--) {
5856
+ for (var i = 0; i < _length; i++) {
5855
5857
  // Deep compare each member
5856
- key = keys[length];
5858
+ var key = keys[i];
5857
5859
  if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {
5858
5860
  return false;
5859
5861
  }