Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepts LevelDOWN root instance #4

Closed
cshum opened this issue Aug 26, 2015 · 1 comment
Closed

Accepts LevelDOWN root instance #4

cshum opened this issue Aug 26, 2015 · 1 comment

Comments

@cshum
Copy link
Owner

cshum commented Aug 26, 2015

prefixdown(db) should accept both LevelUP and LevelDOWN instance as db

@cshum
Copy link
Owner Author

cshum commented Aug 27, 2015

Wrap with levelup would do. prefixdown(levelup(down)).
Can detect and supply levelup wrapper, but that means prefixdown needs to be dependent on leveup, thus incompatibility with future levelup version.

var levelup = require('levelup')
module.exports = function (db) {
  db = db.toString() === 'LevelUP' ? db : levelup(db)
  ...
}

Would better off just require db to be levelup

@cshum cshum closed this as completed in e0d1037 Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant