From 247c59165ad25848b53338cfdd7918f2fada815b Mon Sep 17 00:00:00 2001 From: Christopher Tran Date: Mon, 1 Jul 2024 16:40:22 -0700 Subject: [PATCH] allow only strings --- src/cookies.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cookies.ts b/src/cookies.ts index bde02a4..54cac5a 100644 --- a/src/cookies.ts +++ b/src/cookies.ts @@ -342,7 +342,7 @@ export function createStorageFromOptions( let decoded = chunkedCookie; - if (chunkedCookie !== null && chunkedCookie.startsWith(BASE64_PREFIX)) { + if (typeof chunkedCookie === 'string' && chunkedCookie.startsWith(BASE64_PREFIX)) { decoded = stringFromBase64URL( chunkedCookie.substring(BASE64_PREFIX.length), );