@blackglory/structures 0.7.0 → 0.8.0

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.
@@ -9762,9 +9762,9 @@ function computeNewCapacity(oldCapacity, targetLength, growthFactor) {
9762
9762
  }
9763
9763
 
9764
9764
  class SparseSet {
9765
- constructor() {
9766
- this.indexToValue = new DynamicTypedArray(Uint32Array);
9767
- this.valueToIndex = new DynamicTypedArray(Uint32Array);
9765
+ constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) {
9766
+ this.indexToValue = new DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor });
9767
+ this.valueToIndex = new DynamicTypedArray(Uint32Array, { capacity, growthFactor });
9768
9768
  }
9769
9769
  get [Symbol.toStringTag]() {
9770
9770
  return this.constructor.name;
@@ -9796,10 +9796,10 @@ class SparseSet {
9796
9796
  }
9797
9797
 
9798
9798
  class SparseMap {
9799
- constructor() {
9800
- this.keyToIndex = new DynamicTypedArray(Uint32Array);
9801
- this.indexToKey = new DynamicTypedArray(Uint32Array);
9802
- this.indexToValue = new DynamicTypedArray(Uint32Array);
9799
+ constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) {
9800
+ this.indexToValue = new DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor });
9801
+ this.keyToIndex = new DynamicTypedArray(Uint32Array, { capacity, growthFactor });
9802
+ this.indexToKey = new DynamicTypedArray(Uint32Array, { capacity, growthFactor });
9803
9803
  }
9804
9804
  get [Symbol.toStringTag]() {
9805
9805
  return this.constructor.name;