From 98786606e00f53f96ceb8aa4e2fe01f06db1ed0e Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 22 Dec 2024 21:36:30 +0100 Subject: [PATCH] Fix `clear()` --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1387fba..332d930 100644 --- a/index.js +++ b/index.js @@ -349,7 +349,7 @@ class MemoryLevel extends AbstractLevel { } async _clear (options) { - if (options.limit === -1 && !Object.keys(options).some(isRangeOption)) { + if (options.limit === -1 && !Object.keys(options).some(isRangeOption) && !options.snapshot) { // Delete everything by creating a new empty tree. this[kTree] = createRBT(compare) return