sub-encoder
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -19,7 +19,3 @@ const isOptions = require('is-options') | ||
} | ||
this.userEncoding = codecs(opts && opts.keyEncoding) | ||
if (prefix && this.userEncoding) { | ||
prefix = this.userEncoding.encode(prefix) | ||
} | ||
@@ -26,0 +22,0 @@ const parent = opts && opts._parent |
{ | ||
"name": "sub-encoder", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Generate sub encodings for key/value stores", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -126,15 +126,2 @@ const test = require('brittle') | ||
test('can create subs with dynamic keys/encodings', async t => { | ||
const bee = new Hyperbee(new Hypercore(ram)) | ||
const enc = new SubEncoder() | ||
const sub1 = enc.sub({ name: 's1' }, { keyEncoding: 'json' }) | ||
const sub2 = sub1.sub({ name: 'key1' }, { keyEncoding: 'json' }) | ||
await bee.put({ name: 'key' }, b.from('hello'), { keyEncoding: sub2 }) | ||
const n2 = await collect(bee.createReadStream(sub2.range())) | ||
t.is(n2.length, 1) | ||
}) | ||
async function collect (ite) { | ||
@@ -141,0 +128,0 @@ const res = [] |
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
7720
160