We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ac61d77 + da752a1 commit 62175b8Copy full SHA for 62175b8
1 file changed
index.js
@@ -20,15 +20,14 @@ const PassThrough = stream.PassThrough
20
function Graph (storage, key, opts) {
21
if (!(this instanceof Graph)) return new Graph(storage, key, opts)
22
events.EventEmitter.call(this)
23
-
24
if (typeof key === 'string') key = Buffer.from(key, 'hex')
25
26
if (!Buffer.isBuffer(key) && !opts) {
27
opts = key
28
key = null
29
}
30
31
- if (!opts) opts = {}
+ opts = opts || {}
32
this.db = hyperdb(storage, key, opts)
33
this._prefixes = Object.assign({}, opts.prefixes || constants.DEFAULT_PREFIXES)
34
this._basename = opts.name || constants.DEFAULT_BASE
0 commit comments