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

Move "level-du" and "reachdown" to their own packages #3

Closed
vweevers opened this issue May 25, 2019 · 1 comment
Closed

Move "level-du" and "reachdown" to their own packages #3

vweevers opened this issue May 25, 2019 · 1 comment
Labels
cleanup Housekeeping semver-patch Bug fixes that are backward compatible

Comments

@vweevers
Copy link
Member

vweevers commented May 25, 2019

bench/lib/level-du.js

Lines 6 to 15 in 1225047

// TODO: move to package
module.exports = function ldu (db, callback) {
const location = reachdown(db).location
if (!location) {
return process.nextTick(callback, null, null)
}
du(location, callback)
}

bench/lib/reachdown.js

Lines 3 to 10 in 1225047

// TODO: move to package (shared with subleveldown, level-test)
module.exports = function reachdown (db, type) {
if (typeof db.down === 'function') return db.down(type)
if (type && db.type === type) return db
if (isLooseAbstract(db.db)) return reachdown(db.db, type)
if (isLooseAbstract(db._db)) return reachdown(db._db, type)
return type ? null : db
}

And incorporate Level/subleveldown@fbbf525

@vweevers vweevers added semver-patch Bug fixes that are backward compatible cleanup Housekeeping labels May 25, 2019
vweevers added a commit that referenced this issue Sep 14, 2019
@vweevers
Copy link
Member Author

vweevers commented Oct 5, 2019

Can't think of another use case for level-du, and there's no complexity that's worth hiding in a module.

@vweevers vweevers closed this as completed Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Housekeeping semver-patch Bug fixes that are backward compatible
Projects
None yet
Development

No branches or pull requests

1 participant