From 8711a94c9119449800248a3922d98085e60313f8 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 11 Dec 2024 20:47:24 +0100 Subject: [PATCH] fix(upstash): drop `base` prefix from `keyKeys` --- src/drivers/upstash.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/drivers/upstash.ts b/src/drivers/upstash.ts index 249358bf..dfac5cea 100644 --- a/src/drivers/upstash.ts +++ b/src/drivers/upstash.ts @@ -52,8 +52,12 @@ export default defineDriver( .del(r(key)) .then(() => {}); }, - getKeys(base) { - return getClient().keys(r(base, "*")); + getKeys(_base) { + return getClient() + .keys(r(_base, "*")) + .then((keys) => + base ? keys.map((key) => key.slice(base.length + 1)) : keys + ); }, async clear(base) { const keys = await getClient().keys(r(base, "*"));