hyperbee2 2.4.4 → 2.5.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.
Files changed (2) hide show
  1. package/lib/changes.js +5 -3
  2. package/package.json +1 -1
package/lib/changes.js CHANGED
@@ -26,6 +26,7 @@ class ChangesStream extends Readable {
26
26
 
27
27
  const data = {
28
28
  head: this.head,
29
+ tail: null,
29
30
  batch: []
30
31
  }
31
32
 
@@ -41,16 +42,17 @@ class ChangesStream extends Readable {
41
42
  for (const blk of await Promise.all(remaining)) data.batch.push(blk)
42
43
  data.batch.push(blk)
43
44
 
44
- this.push(data)
45
-
46
45
  if (!blk.previous) {
47
46
  this.head = null
48
47
  this.context = null
48
+ this.push(data)
49
49
  return
50
50
  }
51
51
 
52
52
  this.context = await this.context.getContext(blk.previous.core, this.config)
53
- this.head = { key: this.context.core.key, length: blk.previous.seq + 1 }
53
+ this.head = data.tail = { key: this.context.core.key, length: blk.previous.seq + 1 }
54
+
55
+ this.push(data)
54
56
  }
55
57
 
56
58
  async _open(cb) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperbee2",
3
- "version": "2.4.4",
3
+ "version": "2.5.0",
4
4
  "description": "btree",
5
5
  "main": "index.js",
6
6
  "files": [