hyperbee2 2.5.0 → 2.6.1

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 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
  }
@@ -51,7 +51,7 @@ class CompressedArray {
51
51
  c.delta = this.delta
52
52
  c.entries = this.uentries || this.entries.slice(0)
53
53
 
54
- this.delta = this.delta.slice(0, this.updates)
54
+ this.delta = this.delta.slice(0, -this.updates)
55
55
  this.uentries = null
56
56
  this.updates = 0
57
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperbee2",
3
- "version": "2.5.0",
3
+ "version": "2.6.1",
4
4
  "description": "btree",
5
5
  "main": "index.js",
6
6
  "files": [