aberdeen 1.0.12 → 1.0.13

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/aberdeen.js CHANGED
@@ -731,27 +731,66 @@ var arrayHandler = {
731
731
  return arraySet(target, prop, undefined);
732
732
  }
733
733
  };
734
+ function wrapIteratorSingle(iterator) {
735
+ return {
736
+ [Symbol.iterator]() {
737
+ return this;
738
+ },
739
+ next() {
740
+ const result = iterator.next();
741
+ if (result.done)
742
+ return result;
743
+ return {
744
+ done: false,
745
+ value: optProxy(result.value)
746
+ };
747
+ }
748
+ };
749
+ }
750
+ function wrapIteratorPair(iterator) {
751
+ return {
752
+ [Symbol.iterator]() {
753
+ return this;
754
+ },
755
+ next() {
756
+ const result = iterator.next();
757
+ if (result.done)
758
+ return result;
759
+ return {
760
+ done: false,
761
+ value: [optProxy(result.value[0]), optProxy(result.value[1])]
762
+ };
763
+ }
764
+ };
765
+ }
734
766
  var mapMethodHandlers = {
735
767
  get(key) {
736
768
  const target = this[TARGET_SYMBOL];
769
+ if (typeof key === "object" && key)
770
+ key = key[TARGET_SYMBOL] || key;
737
771
  subscribe(target, key);
738
772
  return optProxy(target.get(key));
739
773
  },
740
774
  set(key, newData) {
741
775
  const target = this[TARGET_SYMBOL];
776
+ if (typeof key === "object" && key)
777
+ key = key[TARGET_SYMBOL] || key;
742
778
  if (typeof newData === "object" && newData)
743
779
  newData = newData[TARGET_SYMBOL] || newData;
744
780
  const oldData = target.get(key);
745
781
  if (newData !== oldData) {
782
+ const oldSize = target.size;
746
783
  target.set(key, newData);
747
784
  emit(target, key, newData, oldData);
748
- emit(target, MAP_SIZE_SYMBOL, target.size, target.size - (oldData === undefined ? 1 : 0));
785
+ emit(target, MAP_SIZE_SYMBOL, target.size, oldSize);
749
786
  runImmediateQueue();
750
787
  }
751
788
  return this;
752
789
  },
753
790
  delete(key) {
754
791
  const target = this[TARGET_SYMBOL];
792
+ if (typeof key === "object" && key)
793
+ key = key[TARGET_SYMBOL] || key;
755
794
  const oldData = target.get(key);
756
795
  const result = target.delete(key);
757
796
  if (result) {
@@ -774,28 +813,30 @@ var mapMethodHandlers = {
774
813
  },
775
814
  has(key) {
776
815
  const target = this[TARGET_SYMBOL];
816
+ if (typeof key === "object" && key)
817
+ key = key[TARGET_SYMBOL] || key;
777
818
  subscribe(target, key);
778
819
  return target.has(key);
779
820
  },
780
821
  keys() {
781
822
  const target = this[TARGET_SYMBOL];
782
823
  subscribe(target, ANY_SYMBOL);
783
- return target.keys();
824
+ return wrapIteratorSingle(target.keys());
784
825
  },
785
826
  values() {
786
827
  const target = this[TARGET_SYMBOL];
787
828
  subscribe(target, ANY_SYMBOL);
788
- return target.values();
829
+ return wrapIteratorSingle(target.values());
789
830
  },
790
831
  entries() {
791
832
  const target = this[TARGET_SYMBOL];
792
833
  subscribe(target, ANY_SYMBOL);
793
- return target.entries();
834
+ return wrapIteratorPair(target.entries());
794
835
  },
795
836
  [Symbol.iterator]() {
796
837
  const target = this[TARGET_SYMBOL];
797
838
  subscribe(target, ANY_SYMBOL);
798
- return target[Symbol.iterator]();
839
+ return wrapIteratorPair(target[Symbol.iterator]());
799
840
  }
800
841
  };
801
842
  var mapHandler = {
@@ -1397,5 +1438,5 @@ export {
1397
1438
  $
1398
1439
  };
1399
1440
 
1400
- //# debugId=273356BBA2542BE564756E2164756E21
1441
+ //# debugId=8143A247906C19B564756E2164756E21
1401
1442
  //# sourceMappingURL=aberdeen.js.map