Comparing version 1.0.0 to 1.0.1
@@ -358,2 +358,3 @@ const codecs = require('codecs') | ||
...opts, | ||
sub: this._sub, | ||
active, | ||
@@ -374,3 +375,3 @@ onseq (seq) { | ||
} else { | ||
opts = encRange(this.keyEncoding, { ...opts, active }) | ||
opts = encRange(this.keyEncoding, { ...opts, sub: this._sub, active }) | ||
} | ||
@@ -395,3 +396,3 @@ | ||
if (typeof right === 'number') right = this.checkout(right) | ||
if (this.keyEncoding) opts = encRange(this.keyEncoding, { ...opts, active }) | ||
if (this.keyEncoding) opts = encRange(this.keyEncoding, { ...opts, sub: this._sub, active }) | ||
else opts = { ...opts, active } | ||
@@ -398,0 +399,0 @@ return iteratorToStream(new DiffIterator(new Batch(this, false, false, opts), new Batch(right, false, false, opts), opts), active) |
{ | ||
"name": "hyperbee", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "An append-only Btree running on a Hypercore.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -173,2 +173,3 @@ const tape = require('tape') | ||
await db.put(key, 'hello world') | ||
await parent.put(key, 'parent hello world') | ||
reference.push(key) | ||
@@ -240,1 +241,23 @@ } | ||
}) | ||
tape('multiple levels of sub, entries outside sub', async t => { | ||
const db = create({ sep: '!' }) | ||
const helloSub = db.sub('hello') | ||
const worldSub = helloSub.sub('world') | ||
await helloSub.put('a', 'b') | ||
await worldSub.put('b', 'c') | ||
const expected = [['b', 'c']] | ||
for await (const { key, value } of worldSub.createReadStream()) { | ||
const next = expected.shift() | ||
if (!next) { | ||
t.fail('iterated unexpected value') | ||
break | ||
} | ||
t.same(key, next[0]) | ||
t.same(value, next[1]) | ||
} | ||
t.same(expected.length, 0) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93058
2770