diff --git a/index.js b/index.js index 47d60b7..00914a4 100644 --- a/index.js +++ b/index.js @@ -37,6 +37,7 @@ class MemoryLevel extends AbstractLevel { createIfMissing: false, errorIfExists: false, has: true, + getSync: true, encodings: { [storeEncoding]: true }, signals: { // Would have no value here because the operations are synchronous @@ -62,6 +63,11 @@ class MemoryLevel extends AbstractLevel { return tree.get(key) } + _getSync (key, options) { + const tree = options.snapshot?.[kTree] ?? this.#tree + return tree.get(key) + } + async _getMany (keys, options) { const tree = options.snapshot?.[kTree] ?? this.#tree return keys.map(get, tree) diff --git a/package.json b/package.json index cf2c098..4697818 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "CHANGELOG.md" ], "dependencies": { - "abstract-level": "^3.0.1", + "abstract-level": "^3.1.0", "functional-red-black-tree": "^1.0.1", "module-error": "^1.0.1" },