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
@@ -896,7 +896,7 @@ var IterableEntryBase = class {
896
896
  every(predicate, thisArg) {
897
897
  let index = 0;
898
898
  for (const item of this) {
899
- if (!predicate.call(thisArg, item[0], item[1], index++, this)) {
899
+ if (!predicate.call(thisArg, item[1], item[0], index++, this)) {
900
900
  return false;
901
901
  }
902
902
  }
@@ -912,7 +912,7 @@ var IterableEntryBase = class {
912
912
  some(predicate, thisArg) {
913
913
  let index = 0;
914
914
  for (const item of this) {
915
- if (predicate.call(thisArg, item[0], item[1], index++, this)) {
915
+ if (predicate.call(thisArg, item[1], item[0], index++, this)) {
916
916
  return true;
917
917
  }
918
918
  }
@@ -928,7 +928,7 @@ var IterableEntryBase = class {
928
928
  let index = 0;
929
929
  for (const item of this) {
930
930
  const [key, value] = item;
931
- callbackfn.call(thisArg, key, value, index++, this);
931
+ callbackfn.call(thisArg, value, key, index++, this);
932
932
  }
933
933
  }
934
934
  /**
@@ -942,7 +942,7 @@ var IterableEntryBase = class {
942
942
  let index = 0;
943
943
  for (const item of this) {
944
944
  const [key, value] = item;
945
- if (callbackfn.call(thisArg, key, value, index++, this)) return item;
945
+ if (callbackfn.call(thisArg, value, key, index++, this)) return item;
946
946
  }
947
947
  return;
948
948
  }
@@ -2188,7 +2188,7 @@ var BinaryTree = class extends IterableEntryBase {
2188
2188
  filter(predicate, thisArg) {
2189
2189
  const out = this._createInstance();
2190
2190
  let i = 0;
2191
- for (const [k, v] of this) if (predicate.call(thisArg, k, v, i++, this)) out.add([k, v]);
2191
+ for (const [k, v] of this) if (predicate.call(thisArg, v, k, i++, this)) out.add([k, v]);
2192
2192
  return out;
2193
2193
  }
2194
2194
  /**
@@ -2206,7 +2206,7 @@ var BinaryTree = class extends IterableEntryBase {
2206
2206
  map(cb, options, thisArg) {
2207
2207
  const out = this._createLike([], options);
2208
2208
  let i = 0;
2209
- for (const [k, v] of this) out.add(cb.call(thisArg, k, v, i++, this));
2209
+ for (const [k, v] of this) out.add(cb.call(thisArg, v, k, i++, this));
2210
2210
  return out;
2211
2211
  }
2212
2212
  /**
@@ -3312,7 +3312,7 @@ var BST = class extends BinaryTree {
3312
3312
  const out = this._createLike([], options);
3313
3313
  let index = 0;
3314
3314
  for (const [key, value] of this) {
3315
- out.add(callback.call(thisArg, key, value, index++, this));
3315
+ out.add(callback.call(thisArg, value, key, index++, this));
3316
3316
  }
3317
3317
  return out;
3318
3318
  }
@@ -3717,7 +3717,7 @@ var AVLTree = class extends BST {
3717
3717
  const out = this._createLike([], options);
3718
3718
  let index = 0;
3719
3719
  for (const [key, value] of this) {
3720
- out.add(callback.call(thisArg, key, value, index++, this));
3720
+ out.add(callback.call(thisArg, value, key, index++, this));
3721
3721
  }
3722
3722
  return out;
3723
3723
  }