@blackglory/structures 0.10.10 → 0.10.13

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.
@@ -16490,6 +16490,9 @@
16490
16490
  get size() {
16491
16491
  return this.indexToKey.length;
16492
16492
  }
16493
+ get internalArray() {
16494
+ return this.indexToValue;
16495
+ }
16493
16496
  *entries() {
16494
16497
  for (let i = 0; i < this.indexToKey.length; i++) {
16495
16498
  yield [this.indexToKey[i], this.indexToValue[i]];
@@ -16501,6 +16504,9 @@
16501
16504
  values() {
16502
16505
  return this.indexToValue.values();
16503
16506
  }
16507
+ getInternalIndexOfKey(key) {
16508
+ return this.keyToIndex[key];
16509
+ }
16504
16510
  has(key) {
16505
16511
  // 跟一般的稀疏集实现不同, 不需要访问values数组.
16506
16512
  return key in this.keyToIndex;
@@ -16537,7 +16543,7 @@
16537
16543
  const index = this.keyToIndex[key];
16538
16544
  this.indexToKey[index] = lastKey;
16539
16545
  this.indexToValue[index] = lastValue;
16540
- this.keyToIndex[key] = index;
16546
+ this.keyToIndex[lastKey] = index;
16541
16547
  delete this.keyToIndex[key];
16542
16548
  }
16543
16549
  }
@@ -16557,6 +16563,9 @@
16557
16563
  get size() {
16558
16564
  return this.indexToKey.length;
16559
16565
  }
16566
+ get internalTypedArray() {
16567
+ return this.indexToValue.internalTypedArray;
16568
+ }
16560
16569
  *entries() {
16561
16570
  for (let i = 0; i < this.indexToKey.length; i++) {
16562
16571
  yield [
@@ -16573,6 +16582,9 @@
16573
16582
  yield this.indexToValue.internalTypedArray[i];
16574
16583
  }
16575
16584
  }
16585
+ getInternalIndexOfKey(key) {
16586
+ return this.keyToIndex[key];
16587
+ }
16576
16588
  has(key) {
16577
16589
  const index = this.keyToIndex[key];
16578
16590
  return this.indexToKey[index] === key;