avl-tree-typed 2.2.0 → 2.2.2

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.
Files changed (31) hide show
  1. package/dist/cjs/index.cjs +8 -8
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs-legacy/index.cjs +8 -8
  4. package/dist/cjs-legacy/index.cjs.map +1 -1
  5. package/dist/esm/index.mjs +8 -8
  6. package/dist/esm/index.mjs.map +1 -1
  7. package/dist/esm-legacy/index.mjs +8 -8
  8. package/dist/esm-legacy/index.mjs.map +1 -1
  9. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +3 -1
  10. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +1 -0
  11. package/dist/types/data-structures/binary-tree/bst.d.ts +1 -0
  12. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +1 -0
  13. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -0
  14. package/dist/types/types/data-structures/base/base.d.ts +1 -1
  15. package/dist/umd/avl-tree-typed.js +8 -8
  16. package/dist/umd/avl-tree-typed.js.map +1 -1
  17. package/dist/umd/avl-tree-typed.min.js +2 -2
  18. package/dist/umd/avl-tree-typed.min.js.map +1 -1
  19. package/package.json +2 -2
  20. package/src/data-structures/base/iterable-entry-base.ts +4 -4
  21. package/src/data-structures/binary-tree/avl-tree-counter.ts +1 -1
  22. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +1 -1
  23. package/src/data-structures/binary-tree/avl-tree.ts +4 -2
  24. package/src/data-structures/binary-tree/binary-tree.ts +3 -2
  25. package/src/data-structures/binary-tree/bst.ts +2 -1
  26. package/src/data-structures/binary-tree/red-black-tree.ts +2 -1
  27. package/src/data-structures/binary-tree/tree-counter.ts +1 -1
  28. package/src/data-structures/binary-tree/tree-multi-map.ts +2 -1
  29. package/src/data-structures/graph/abstract-graph.ts +3 -3
  30. package/src/data-structures/hash/hash-map.ts +4 -4
  31. package/src/types/data-structures/base/base.ts +1 -1
@@ -892,7 +892,7 @@ var _IterableEntryBase = class _IterableEntryBase {
892
892
  every(predicate, thisArg) {
893
893
  let index = 0;
894
894
  for (const item of this) {
895
- if (!predicate.call(thisArg, item[0], item[1], index++, this)) {
895
+ if (!predicate.call(thisArg, item[1], item[0], index++, this)) {
896
896
  return false;
897
897
  }
898
898
  }
@@ -908,7 +908,7 @@ var _IterableEntryBase = class _IterableEntryBase {
908
908
  some(predicate, thisArg) {
909
909
  let index = 0;
910
910
  for (const item of this) {
911
- if (predicate.call(thisArg, item[0], item[1], index++, this)) {
911
+ if (predicate.call(thisArg, item[1], item[0], index++, this)) {
912
912
  return true;
913
913
  }
914
914
  }
@@ -924,7 +924,7 @@ var _IterableEntryBase = class _IterableEntryBase {
924
924
  let index = 0;
925
925
  for (const item of this) {
926
926
  const [key, value] = item;
927
- callbackfn.call(thisArg, key, value, index++, this);
927
+ callbackfn.call(thisArg, value, key, index++, this);
928
928
  }
929
929
  }
930
930
  /**
@@ -938,7 +938,7 @@ var _IterableEntryBase = class _IterableEntryBase {
938
938
  let index = 0;
939
939
  for (const item of this) {
940
940
  const [key, value] = item;
941
- if (callbackfn.call(thisArg, key, value, index++, this)) return item;
941
+ if (callbackfn.call(thisArg, value, key, index++, this)) return item;
942
942
  }
943
943
  return;
944
944
  }
@@ -2190,7 +2190,7 @@ var _BinaryTree = class _BinaryTree extends IterableEntryBase {
2190
2190
  filter(predicate, thisArg) {
2191
2191
  const out = this._createInstance();
2192
2192
  let i = 0;
2193
- for (const [k, v] of this) if (predicate.call(thisArg, k, v, i++, this)) out.add([k, v]);
2193
+ for (const [k, v] of this) if (predicate.call(thisArg, v, k, i++, this)) out.add([k, v]);
2194
2194
  return out;
2195
2195
  }
2196
2196
  /**
@@ -2208,7 +2208,7 @@ var _BinaryTree = class _BinaryTree extends IterableEntryBase {
2208
2208
  map(cb, options, thisArg) {
2209
2209
  const out = this._createLike([], options);
2210
2210
  let i = 0;
2211
- for (const [k, v] of this) out.add(cb.call(thisArg, k, v, i++, this));
2211
+ for (const [k, v] of this) out.add(cb.call(thisArg, v, k, i++, this));
2212
2212
  return out;
2213
2213
  }
2214
2214
  /**
@@ -3308,7 +3308,7 @@ var _BST = class _BST extends BinaryTree {
3308
3308
  const out = this._createLike([], options);
3309
3309
  let index = 0;
3310
3310
  for (const [key, value] of this) {
3311
- out.add(callback.call(thisArg, key, value, index++, this));
3311
+ out.add(callback.call(thisArg, value, key, index++, this));
3312
3312
  }
3313
3313
  return out;
3314
3314
  }
@@ -3712,7 +3712,7 @@ var _AVLTree = class _AVLTree extends BST {
3712
3712
  const out = this._createLike([], options);
3713
3713
  let index = 0;
3714
3714
  for (const [key, value] of this) {
3715
- out.add(callback.call(thisArg, key, value, index++, this));
3715
+ out.add(callback.call(thisArg, value, key, index++, this));
3716
3716
  }
3717
3717
  return out;
3718
3718
  }