Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options.db = txdown(db._levelup, options.createLock)
location = db.location
} else if (isFunction(db.sublevel) && isFunction(db.levelup)) {
// db is sublevelup, get its levelup
this._levelup = db.levelup()
options.db = txdown(db.levelup(), options.createLock)
location = db.location
} else {
// db is LevelUP, wrap txdown
this._levelup = db
options.db = txdown(db)
location = ''
}
// LevelUP.call(this, options.db(location), options)
LevelUP.call(this, location, options)
var self = this
this.once('closed', function () {
self.emit('end', self.db._error)
self.emit('release', self.db._error)
})
}
function Db (location) {
// Initialize necessary methods/properties from levelup in this instance
levelup.call(this, location)
}