avl-tree-typed 2.2.0 → 2.2.1

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 {
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 {
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 {
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 {
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
  }
@@ -2186,7 +2186,7 @@ var BinaryTree = class extends IterableEntryBase {
2186
2186
  filter(predicate, thisArg) {
2187
2187
  const out = this._createInstance();
2188
2188
  let i = 0;
2189
- for (const [k, v] of this) if (predicate.call(thisArg, k, v, i++, this)) out.add([k, v]);
2189
+ for (const [k, v] of this) if (predicate.call(thisArg, v, k, i++, this)) out.add([k, v]);
2190
2190
  return out;
2191
2191
  }
2192
2192
  /**
@@ -2204,7 +2204,7 @@ var BinaryTree = class extends IterableEntryBase {
2204
2204
  map(cb, options, thisArg) {
2205
2205
  const out = this._createLike([], options);
2206
2206
  let i = 0;
2207
- for (const [k, v] of this) out.add(cb.call(thisArg, k, v, i++, this));
2207
+ for (const [k, v] of this) out.add(cb.call(thisArg, v, k, i++, this));
2208
2208
  return out;
2209
2209
  }
2210
2210
  /**
@@ -3310,7 +3310,7 @@ var BST = class 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
  }
@@ -3715,7 +3715,7 @@ var AVLTree = class extends BST {
3715
3715
  const out = this._createLike([], options);
3716
3716
  let index = 0;
3717
3717
  for (const [key, value] of this) {
3718
- out.add(callback.call(thisArg, key, value, index++, this));
3718
+ out.add(callback.call(thisArg, value, key, index++, this));
3719
3719
  }
3720
3720
  return out;
3721
3721
  }