Skip to content

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

@vweevers

Description

@vweevers

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupHousekeepingsemver-patchBug fixes that are backward compatible

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions