Comparing version 1.6.1 to 1.6.2
@@ -307,3 +307,5 @@ const codecs = require('codecs') | ||
if (this.prefix && !this._checkout) this.keyEncoding = prefixEncoding(this.prefix, this.keyEncoding) | ||
if (this.prefix && opts._sub) { | ||
this.keyEncoding = prefixEncoding(this.prefix, this.keyEncoding) | ||
} | ||
} | ||
@@ -445,2 +447,3 @@ | ||
_ready: this.ready(), | ||
_sub: false, | ||
sep: this.sep, | ||
@@ -470,2 +473,3 @@ prefix: this.prefix, | ||
_ready: this.ready(), | ||
_sub: true, | ||
prefix, | ||
@@ -472,0 +476,0 @@ sep: this.sep, |
{ | ||
"name": "hyperbee", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "An append-only Btree running on a Hypercore.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -62,1 +62,31 @@ const test = require('tape') | ||
}) | ||
test('diff on multi-level sub db with parent checkout', async function (t) { | ||
const db = await create() | ||
const sub = db.sub('hello').sub('world') | ||
await sub.put('a', 'b') | ||
await sub.put('b', 'c') | ||
const v1 = sub.version | ||
await sub.put('c', 'd') | ||
await sub.del('a') | ||
const v2 = sub.version | ||
await sub.put('e', 'f') | ||
await sub.put('g', 'h') | ||
const c1 = db.checkout(v2).sub('hello').sub('world') | ||
const c2 = sub.checkout(v2) | ||
const entries = await collect(c1.createDiffStream(v1)) | ||
const entries2 = await collect(c2.createDiffStream(v1)) | ||
t.same(entries.length, 2) | ||
t.same(entries2.length, 2) | ||
t.same(entries[0].right.key, entries2[0].right.key) | ||
t.same(entries[1].left.key, entries2[1].left.key) | ||
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
100178
2996