Comparing version 2.3.0 to 2.4.0
@@ -275,3 +275,5 @@ const codecs = require('codecs') | ||
constructor (feed, opts = {}) { | ||
// this.feed is now deprecated, and will be this.core going forward | ||
this.feed = feed | ||
this.core = feed | ||
@@ -448,3 +450,5 @@ this.keyEncoding = opts.keyEncoding ? codecs(opts.keyEncoding) : null | ||
this.tree = tree | ||
// this.feed is now deprecated, and will be this.core going forward | ||
this.feed = feed | ||
this.core = feed | ||
this.blocks = cache ? new Map() : null | ||
@@ -451,0 +455,0 @@ this.autoFlush = !batchLock |
{ | ||
"name": "hyperbee", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "An append-only B-tree running on a Hypercore.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,3 +16,3 @@ # Hyperbee 🐝 | ||
const Hyperbee = require('hyperbee') | ||
const db = new Hyperbee(feed, { | ||
const db = new Hyperbee(core, { | ||
keyEncoding: 'utf-8', // can be set to undefined (binary), utf-8, ascii or and abstract-encoding | ||
@@ -52,3 +52,3 @@ valueEncoding: 'binary' // same options as above | ||
#### `const db = new Hyperbee(feed, [options])` | ||
#### `const db = new Hyperbee(core, [options])` | ||
@@ -87,3 +87,3 @@ Make a new Hyperbee instance. `feed` should be a [Hypercore](https://github.com/holepunchto/hypercore). | ||
const cas = (prev, next) => prev.value !== next.value | ||
const db = new Hyperbee(feed, { keyEncoding: 'utf8', valueEncoding: 'utf8' }) | ||
const db = new Hyperbee(core, { keyEncoding: 'utf8', valueEncoding: 'utf8' }) | ||
await db.put('key', 'value') | ||
@@ -119,3 +119,3 @@ console.log(await db.get('key')) // { seq: 1, key: 'key', value: 'value' } | ||
const cas = (prev) => prev.value === 'value*' | ||
const db = new Hyperbee(feed, { keyEncoding: 'utf8', valueEncoding: 'utf8' }) | ||
const db = new Hyperbee(core, { keyEncoding: 'utf8', valueEncoding: 'utf8' }) | ||
await db.put('key', 'value') | ||
@@ -122,0 +122,0 @@ console.log(await db.get('key')) // { seq: 1, key: 'key', value: 'value' } |
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
78007
2195