hyperbee2 2.5.0 → 2.6.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.
- package/index.js +8 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -99,6 +99,14 @@ class Hyperbee {
|
|
|
99
99
|
return this._makeView(context, root, writable, 0)
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
move({ length = this.core.length, key = null, writable = this.writable } = {}) {
|
|
103
|
+
const context = key ? this.context.getContextByKey(key) : this.context
|
|
104
|
+
const root = length === 0 ? EMPTY : context.createTreeNode(0, length - 1, 0, false, null)
|
|
105
|
+
this.context = context
|
|
106
|
+
this.writable = writable
|
|
107
|
+
this.root = root
|
|
108
|
+
}
|
|
109
|
+
|
|
102
110
|
snapshot() {
|
|
103
111
|
return this._makeView(this.context, this.root, false, 0)
|
|
104
112
|
}
|