@blackglory/structures 0.10.7 → 0.10.10

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 (48) hide show
  1. package/README.md +9 -2
  2. package/dist/es2015/index.min.mjs +2 -2
  3. package/dist/es2015/index.min.mjs.map +1 -1
  4. package/dist/es2015/index.mjs +20 -0
  5. package/dist/es2015/index.mjs.map +1 -1
  6. package/dist/es2015/index.umd.js +20 -0
  7. package/dist/es2015/index.umd.js.map +1 -1
  8. package/dist/es2015/index.umd.min.js +2 -2
  9. package/dist/es2015/index.umd.min.js.map +1 -1
  10. package/dist/es2018/index.min.mjs +2 -2
  11. package/dist/es2018/index.min.mjs.map +1 -1
  12. package/dist/es2018/index.mjs +20 -0
  13. package/dist/es2018/index.mjs.map +1 -1
  14. package/dist/es2018/index.umd.js +20 -0
  15. package/dist/es2018/index.umd.js.map +1 -1
  16. package/dist/es2018/index.umd.min.js +2 -2
  17. package/dist/es2018/index.umd.min.js.map +1 -1
  18. package/lib/es2015/dynamic-typed-array.d.ts +1 -0
  19. package/lib/es2015/dynamic-typed-array.js +6 -0
  20. package/lib/es2015/dynamic-typed-array.js.map +1 -1
  21. package/lib/es2015/sparse-map.d.ts +1 -0
  22. package/lib/es2015/sparse-map.js +3 -0
  23. package/lib/es2015/sparse-map.js.map +1 -1
  24. package/lib/es2015/sparse-set.d.ts +1 -1
  25. package/lib/es2015/sparse-set.js +4 -0
  26. package/lib/es2015/sparse-set.js.map +1 -1
  27. package/lib/es2015/typed-sparse-map.d.ts +1 -0
  28. package/lib/es2015/typed-sparse-map.js +3 -0
  29. package/lib/es2015/typed-sparse-map.js.map +1 -1
  30. package/lib/es2015/typed-sparse-set.d.ts +1 -1
  31. package/lib/es2015/typed-sparse-set.js +4 -0
  32. package/lib/es2015/typed-sparse-set.js.map +1 -1
  33. package/lib/es2018/dynamic-typed-array.d.ts +1 -0
  34. package/lib/es2018/dynamic-typed-array.js +6 -0
  35. package/lib/es2018/dynamic-typed-array.js.map +1 -1
  36. package/lib/es2018/sparse-map.d.ts +1 -0
  37. package/lib/es2018/sparse-map.js +3 -0
  38. package/lib/es2018/sparse-map.js.map +1 -1
  39. package/lib/es2018/sparse-set.d.ts +1 -1
  40. package/lib/es2018/sparse-set.js +4 -0
  41. package/lib/es2018/sparse-set.js.map +1 -1
  42. package/lib/es2018/typed-sparse-map.d.ts +1 -0
  43. package/lib/es2018/typed-sparse-map.js +3 -0
  44. package/lib/es2018/typed-sparse-map.js.map +1 -1
  45. package/lib/es2018/typed-sparse-set.d.ts +1 -1
  46. package/lib/es2018/typed-sparse-set.js +4 -0
  47. package/lib/es2018/typed-sparse-set.js.map +1 -1
  48. package/package.json +1 -1
@@ -16470,6 +16470,10 @@
16470
16470
  // 跟一般的实现不同, 直接删除值的索引.
16471
16471
  delete this.valueToIndex[value];
16472
16472
  }
16473
+ return true;
16474
+ }
16475
+ else {
16476
+ return false;
16473
16477
  }
16474
16478
  }
16475
16479
  }
@@ -16483,6 +16487,9 @@
16483
16487
  get [Symbol.toStringTag]() {
16484
16488
  return this.constructor.name;
16485
16489
  }
16490
+ get size() {
16491
+ return this.indexToKey.length;
16492
+ }
16486
16493
  *entries() {
16487
16494
  for (let i = 0; i < this.indexToKey.length; i++) {
16488
16495
  yield [this.indexToKey[i], this.indexToValue[i]];
@@ -16547,6 +16554,9 @@
16547
16554
  get [Symbol.toStringTag]() {
16548
16555
  return this.constructor.name;
16549
16556
  }
16557
+ get size() {
16558
+ return this.indexToKey.length;
16559
+ }
16550
16560
  *entries() {
16551
16561
  for (let i = 0; i < this.indexToKey.length; i++) {
16552
16562
  yield [
@@ -16643,6 +16653,10 @@
16643
16653
  this.indexToValue.internalTypedArray[index] = lastValue;
16644
16654
  this.valueToIndex[lastValue] = index;
16645
16655
  }
16656
+ return true;
16657
+ }
16658
+ else {
16659
+ return false;
16646
16660
  }
16647
16661
  }
16648
16662
  }
@@ -16713,6 +16727,12 @@
16713
16727
  return undefined;
16714
16728
  }
16715
16729
  }
16730
+ sort(compare) {
16731
+ const capacity = this.capacity;
16732
+ this.resize(this.length);
16733
+ this.array.sort(compare);
16734
+ this.resize(capacity);
16735
+ }
16716
16736
  resize(newCapacity) {
16717
16737
  if (this.array.length === newCapacity) {
16718
16738
  return;