hyperbee2 2.4.3 → 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.
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/lib/write.js CHANGED
@@ -5,7 +5,7 @@ const { encodeBlock, TYPE_COMPAT, TYPE_LATEST } = require('./encoding.js')
5
5
  const { Pointer, KeyPointer, ValuePointer, TreeNode, INSERTED, NEEDS_SPLIT } = require('./tree.js')
6
6
 
7
7
  const PREFERRED_BLOCK_SIZE = 4096
8
- const INLINE_VALUE_SIZE = 4096
8
+ const INLINE_VALUE_SIZE = 1024
9
9
  const ESTIMATED_POINTER_SIZE = 12 // conversative, seq=8b, offset=2b, core=2b
10
10
 
11
11
  module.exports = class WriteBatch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperbee2",
3
- "version": "2.4.3",
3
+ "version": "2.5.0",
4
4
  "description": "btree",
5
5
  "main": "index.js",
6
6
  "files": [