@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.
- package/README.md +9 -2
- package/dist/es2015/index.min.mjs +2 -2
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +20 -0
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +20 -0
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +2 -2
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +2 -2
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +20 -0
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +20 -0
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +2 -2
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/dynamic-typed-array.d.ts +1 -0
- package/lib/es2015/dynamic-typed-array.js +6 -0
- package/lib/es2015/dynamic-typed-array.js.map +1 -1
- package/lib/es2015/sparse-map.d.ts +1 -0
- package/lib/es2015/sparse-map.js +3 -0
- package/lib/es2015/sparse-map.js.map +1 -1
- package/lib/es2015/sparse-set.d.ts +1 -1
- package/lib/es2015/sparse-set.js +4 -0
- package/lib/es2015/sparse-set.js.map +1 -1
- package/lib/es2015/typed-sparse-map.d.ts +1 -0
- package/lib/es2015/typed-sparse-map.js +3 -0
- package/lib/es2015/typed-sparse-map.js.map +1 -1
- package/lib/es2015/typed-sparse-set.d.ts +1 -1
- package/lib/es2015/typed-sparse-set.js +4 -0
- package/lib/es2015/typed-sparse-set.js.map +1 -1
- package/lib/es2018/dynamic-typed-array.d.ts +1 -0
- package/lib/es2018/dynamic-typed-array.js +6 -0
- package/lib/es2018/dynamic-typed-array.js.map +1 -1
- package/lib/es2018/sparse-map.d.ts +1 -0
- package/lib/es2018/sparse-map.js +3 -0
- package/lib/es2018/sparse-map.js.map +1 -1
- package/lib/es2018/sparse-set.d.ts +1 -1
- package/lib/es2018/sparse-set.js +4 -0
- package/lib/es2018/sparse-set.js.map +1 -1
- package/lib/es2018/typed-sparse-map.d.ts +1 -0
- package/lib/es2018/typed-sparse-map.js +3 -0
- package/lib/es2018/typed-sparse-map.js.map +1 -1
- package/lib/es2018/typed-sparse-set.d.ts +1 -1
- package/lib/es2018/typed-sparse-set.js +4 -0
- package/lib/es2018/typed-sparse-set.js.map +1 -1
- package/package.json +1 -1
package/dist/es2015/index.mjs
CHANGED
|
@@ -16464,6 +16464,10 @@ class SparseSet {
|
|
|
16464
16464
|
// 跟一般的实现不同, 直接删除值的索引.
|
|
16465
16465
|
delete this.valueToIndex[value];
|
|
16466
16466
|
}
|
|
16467
|
+
return true;
|
|
16468
|
+
}
|
|
16469
|
+
else {
|
|
16470
|
+
return false;
|
|
16467
16471
|
}
|
|
16468
16472
|
}
|
|
16469
16473
|
}
|
|
@@ -16477,6 +16481,9 @@ class SparseMap {
|
|
|
16477
16481
|
get [Symbol.toStringTag]() {
|
|
16478
16482
|
return this.constructor.name;
|
|
16479
16483
|
}
|
|
16484
|
+
get size() {
|
|
16485
|
+
return this.indexToKey.length;
|
|
16486
|
+
}
|
|
16480
16487
|
*entries() {
|
|
16481
16488
|
for (let i = 0; i < this.indexToKey.length; i++) {
|
|
16482
16489
|
yield [this.indexToKey[i], this.indexToValue[i]];
|
|
@@ -16541,6 +16548,9 @@ class TypedSparseMap {
|
|
|
16541
16548
|
get [Symbol.toStringTag]() {
|
|
16542
16549
|
return this.constructor.name;
|
|
16543
16550
|
}
|
|
16551
|
+
get size() {
|
|
16552
|
+
return this.indexToKey.length;
|
|
16553
|
+
}
|
|
16544
16554
|
*entries() {
|
|
16545
16555
|
for (let i = 0; i < this.indexToKey.length; i++) {
|
|
16546
16556
|
yield [
|
|
@@ -16637,6 +16647,10 @@ class TypedSparseSet {
|
|
|
16637
16647
|
this.indexToValue.internalTypedArray[index] = lastValue;
|
|
16638
16648
|
this.valueToIndex[lastValue] = index;
|
|
16639
16649
|
}
|
|
16650
|
+
return true;
|
|
16651
|
+
}
|
|
16652
|
+
else {
|
|
16653
|
+
return false;
|
|
16640
16654
|
}
|
|
16641
16655
|
}
|
|
16642
16656
|
}
|
|
@@ -16707,6 +16721,12 @@ class DynamicTypedArray {
|
|
|
16707
16721
|
return undefined;
|
|
16708
16722
|
}
|
|
16709
16723
|
}
|
|
16724
|
+
sort(compare) {
|
|
16725
|
+
const capacity = this.capacity;
|
|
16726
|
+
this.resize(this.length);
|
|
16727
|
+
this.array.sort(compare);
|
|
16728
|
+
this.resize(capacity);
|
|
16729
|
+
}
|
|
16710
16730
|
resize(newCapacity) {
|
|
16711
16731
|
if (this.array.length === newCapacity) {
|
|
16712
16732
|
return;
|