@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.
@@ -9768,9 +9768,9 @@
9768
9768
  }
9769
9769
 
9770
9770
  class SparseSet {
9771
- constructor() {
9772
- this.indexToValue = new DynamicTypedArray(Uint32Array);
9773
- this.valueToIndex = new DynamicTypedArray(Uint32Array);
9771
+ constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) {
9772
+ this.indexToValue = new DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor });
9773
+ this.valueToIndex = new DynamicTypedArray(Uint32Array, { capacity, growthFactor });
9774
9774
  }
9775
9775
  get [Symbol.toStringTag]() {
9776
9776
  return this.constructor.name;
@@ -9802,10 +9802,10 @@
9802
9802
  }
9803
9803
 
9804
9804
  class SparseMap {
9805
- constructor() {
9806
- this.keyToIndex = new DynamicTypedArray(Uint32Array);
9807
- this.indexToKey = new DynamicTypedArray(Uint32Array);
9808
- this.indexToValue = new DynamicTypedArray(Uint32Array);
9805
+ constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) {
9806
+ this.indexToValue = new DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor });
9807
+ this.keyToIndex = new DynamicTypedArray(Uint32Array, { capacity, growthFactor });
9808
+ this.indexToKey = new DynamicTypedArray(Uint32Array, { capacity, growthFactor });
9809
9809
  }
9810
9810
  get [Symbol.toStringTag]() {
9811
9811
  return this.constructor.name;