serializable-bptree 4.0.2 → 4.0.4
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/dist/cjs/index.cjs +6 -0
- package/dist/esm/index.mjs +6 -0
- package/dist/{typings → types}/base/BPTree.d.ts +3 -3
- package/package.json +5 -4
- /package/dist/{typings → types}/BPTreeAsync.d.ts +0 -0
- /package/dist/{typings → types}/BPTreeSync.d.ts +0 -0
- /package/dist/{typings → types}/SerializeStrategyAsync.d.ts +0 -0
- /package/dist/{typings → types}/SerializeStrategySync.d.ts +0 -0
- /package/dist/{typings → types}/base/SerializeStrategy.d.ts +0 -0
- /package/dist/{typings → types}/base/ValueComparator.d.ts +0 -0
- /package/dist/{typings → types}/index.d.ts +0 -0
- /package/dist/{typings → types}/utils/InvertedWeakMap.d.ts +0 -0
- /package/dist/{typings → types}/utils/types.d.ts +0 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -328,6 +328,9 @@ var BPTreeSync = class extends BPTree {
|
|
|
328
328
|
} else if (this.root === node) {
|
|
329
329
|
return;
|
|
330
330
|
} else if (node.keys.length < Math.ceil(this.order / 2) && !node.leaf || node.values.length < Math.ceil((this.order - 1) / 2) && node.leaf) {
|
|
331
|
+
if (node.parent === null) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
331
334
|
let isPredecessor = false;
|
|
332
335
|
let parentNode = this.getNode(node.parent);
|
|
333
336
|
let prevNode = null;
|
|
@@ -879,6 +882,9 @@ var BPTreeAsync = class extends BPTree {
|
|
|
879
882
|
} else if (this.root === node) {
|
|
880
883
|
return;
|
|
881
884
|
} else if (node.keys.length < Math.ceil(this.order / 2) && !node.leaf || node.values.length < Math.ceil((this.order - 1) / 2) && node.leaf) {
|
|
885
|
+
if (node.parent === null) {
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
882
888
|
let isPredecessor = false;
|
|
883
889
|
let parentNode = await this.getNode(node.parent);
|
|
884
890
|
let prevNode = null;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -294,6 +294,9 @@ var BPTreeSync = class extends BPTree {
|
|
|
294
294
|
} else if (this.root === node) {
|
|
295
295
|
return;
|
|
296
296
|
} else if (node.keys.length < Math.ceil(this.order / 2) && !node.leaf || node.values.length < Math.ceil((this.order - 1) / 2) && node.leaf) {
|
|
297
|
+
if (node.parent === null) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
297
300
|
let isPredecessor = false;
|
|
298
301
|
let parentNode = this.getNode(node.parent);
|
|
299
302
|
let prevNode = null;
|
|
@@ -845,6 +848,9 @@ var BPTreeAsync = class extends BPTree {
|
|
|
845
848
|
} else if (this.root === node) {
|
|
846
849
|
return;
|
|
847
850
|
} else if (node.keys.length < Math.ceil(this.order / 2) && !node.leaf || node.values.length < Math.ceil((this.order - 1) / 2) && node.leaf) {
|
|
851
|
+
if (node.parent === null) {
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
848
854
|
let isPredecessor = false;
|
|
849
855
|
let parentNode = await this.getNode(node.parent);
|
|
850
856
|
let prevNode = null;
|
|
@@ -96,19 +96,19 @@ export declare abstract class BPTree<K, V> {
|
|
|
96
96
|
/**
|
|
97
97
|
* You enter the key and value as a pair. You can later search for the pair by value.
|
|
98
98
|
* This data is stored in the tree, sorted in ascending order of value.
|
|
99
|
-
* @param key The key of the pair.
|
|
99
|
+
* @param key The key of the pair. This key must be unique.
|
|
100
100
|
* @param value The value of the pair.
|
|
101
101
|
*/
|
|
102
102
|
abstract insert(key: K, value: V): Deferred<void>;
|
|
103
103
|
/**
|
|
104
104
|
* Deletes the pair that matches the key and value.
|
|
105
|
-
* @param key The key of the pair.
|
|
105
|
+
* @param key The key of the pair. This key must be unique.
|
|
106
106
|
* @param value The value of the pair.
|
|
107
107
|
*/
|
|
108
108
|
abstract delete(key: K, value: V): Deferred<void>;
|
|
109
109
|
/**
|
|
110
110
|
* It returns whether there is a value in the tree.
|
|
111
|
-
* @param key The key value to search for.
|
|
111
|
+
* @param key The key value to search for. This key must be unique.
|
|
112
112
|
* @param value The value to search for.
|
|
113
113
|
*/
|
|
114
114
|
abstract exists(key: K, value: V): Deferred<boolean>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "serializable-bptree",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Store the B+tree flexibly, not only in-memory.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"types": "./dist/types/index.d.ts",
|
|
6
|
+
"main": "./dist/cjs/index.cjs",
|
|
7
|
+
"module": "./dist/esm/index.mjs",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
10
11
|
"import": "./dist/esm/index.mjs",
|
|
11
12
|
"require": "./dist/cjs/index.cjs"
|
|
12
13
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|