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
@@ -894,7 +894,7 @@ var _IterableEntryBase = class _IterableEntryBase {
894
894
  every(predicate, thisArg) {
895
895
  let index = 0;
896
896
  for (const item of this) {
897
- if (!predicate.call(thisArg, item[0], item[1], index++, this)) {
897
+ if (!predicate.call(thisArg, item[1], item[0], index++, this)) {
898
898
  return false;
899
899
  }
900
900
  }
@@ -910,7 +910,7 @@ var _IterableEntryBase = class _IterableEntryBase {
910
910
  some(predicate, thisArg) {
911
911
  let index = 0;
912
912
  for (const item of this) {
913
- if (predicate.call(thisArg, item[0], item[1], index++, this)) {
913
+ if (predicate.call(thisArg, item[1], item[0], index++, this)) {
914
914
  return true;
915
915
  }
916
916
  }
@@ -926,7 +926,7 @@ var _IterableEntryBase = class _IterableEntryBase {
926
926
  let index = 0;
927
927
  for (const item of this) {
928
928
  const [key, value] = item;
929
- callbackfn.call(thisArg, key, value, index++, this);
929
+ callbackfn.call(thisArg, value, key, index++, this);
930
930
  }
931
931
  }
932
932
  /**
@@ -940,7 +940,7 @@ var _IterableEntryBase = class _IterableEntryBase {
940
940
  let index = 0;
941
941
  for (const item of this) {
942
942
  const [key, value] = item;
943
- if (callbackfn.call(thisArg, key, value, index++, this)) return item;
943
+ if (callbackfn.call(thisArg, value, key, index++, this)) return item;
944
944
  }
945
945
  return;
946
946
  }
@@ -2192,7 +2192,7 @@ var _BinaryTree = class _BinaryTree extends IterableEntryBase {
2192
2192
  filter(predicate, thisArg) {
2193
2193
  const out = this._createInstance();
2194
2194
  let i = 0;
2195
- for (const [k, v] of this) if (predicate.call(thisArg, k, v, i++, this)) out.add([k, v]);
2195
+ for (const [k, v] of this) if (predicate.call(thisArg, v, k, i++, this)) out.add([k, v]);
2196
2196
  return out;
2197
2197
  }
2198
2198
  /**
@@ -2210,7 +2210,7 @@ var _BinaryTree = class _BinaryTree extends IterableEntryBase {
2210
2210
  map(cb, options, thisArg) {
2211
2211
  const out = this._createLike([], options);
2212
2212
  let i = 0;
2213
- for (const [k, v] of this) out.add(cb.call(thisArg, k, v, i++, this));
2213
+ for (const [k, v] of this) out.add(cb.call(thisArg, v, k, i++, this));
2214
2214
  return out;
2215
2215
  }
2216
2216
  /**
@@ -3310,7 +3310,7 @@ var _BST = class _BST extends BinaryTree {
3310
3310
  const out = this._createLike([], options);
3311
3311
  let index = 0;
3312
3312
  for (const [key, value] of this) {
3313
- out.add(callback.call(thisArg, key, value, index++, this));
3313
+ out.add(callback.call(thisArg, value, key, index++, this));
3314
3314
  }
3315
3315
  return out;
3316
3316
  }
@@ -3714,7 +3714,7 @@ var _AVLTree = class _AVLTree extends BST {
3714
3714
  const out = this._createLike([], options);
3715
3715
  let index = 0;
3716
3716
  for (const [key, value] of this) {
3717
- out.add(callback.call(thisArg, key, value, index++, this));
3717
+ out.add(callback.call(thisArg, value, key, index++, this));
3718
3718
  }
3719
3719
  return out;
3720
3720
  }