Skip to content

Commit

Permalink
Use default options in static bee constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewosh committed Oct 24, 2024
1 parent 32f6cef commit 03a98a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ class HyperDB {
return new HyperDB(new RocksEngine(storage), definition, options)
}

static bee (core, definition, options) {
const extension = !options || (options.extension !== false)
static bee (core, definition, options = {}) {
const extension = options.extension !== false
return new HyperDB(new BeeEngine(core, { extension }), definition, options)
}

Expand Down
4 changes: 2 additions & 2 deletions lib/engine/bee.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class BeeSnapshot {
}

module.exports = class BeeEngine {
constructor (core, options) {
constructor (core, { extension = true } = {}) {
this.asap = true
this.clock = 0
this.refs = 0
this.db = new HyperBee(core, {
extension: options.extension,
extension,
keyEncoding: 'binary',
valueEncoding: 'binary'
})
Expand Down

0 comments on commit 03a98a8

Please sign in to comment.