Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.
/ memdown Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion memdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ function MemDOWN () {
snapshots: true,
permanence: false,
seek: true,
clear: true
clear: true,
getMany: true
})

this._store = createRBT(ltgt.compare)
Expand Down Expand Up @@ -211,6 +212,13 @@ MemDOWN.prototype._get = function (key, options, callback) {
})
}

MemDOWN.prototype._getMany = function (keys, options, callback) {
this._nextTick(callback, null, keys.map((key) => {
const value = this._store.get(key)
return value === undefined || options.asBuffer ? value : value.toString()
}))
}

MemDOWN.prototype._del = function (key, options, callback) {
this._store = this._store.remove(key)
this._nextTick(callback)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"CONTRIBUTORS.md"
],
"dependencies": {
"abstract-leveldown": "^7.0.0",
"abstract-leveldown": "^7.2.0",
"buffer": "^6.0.3",
"functional-red-black-tree": "^1.0.1",
"inherits": "^2.0.1",
Expand Down
3 changes: 2 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ const testCommon = suite.common({
return memdown()
},

// Opt-in to new clear() tests
// Opt-in to new tests
clear: true,
getMany: true,

// Opt-out of unsupported features
createIfMissing: false,
Expand Down