From 42e2ad24e08f783d68dcd465de49bae078106953 Mon Sep 17 00:00:00 2001 From: bibhuty-did-this Date: Thu, 21 Mar 2024 12:03:32 +0530 Subject: [PATCH 1/2] fix: weak key mapping due to empty object --- src/core/shift.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/shift.js b/src/core/shift.js index 94890fb..7a8f1cc 100644 --- a/src/core/shift.js +++ b/src/core/shift.js @@ -28,7 +28,7 @@ function memoizeDecode(origDecode) { return (payload) => { if (decodeCache.has(payload)) return decodeCache.get(payload); const decoded = origDecode(payload); - decodeCache.set(payload, decoded); + if(!!payload) decodeCache.set(payload, decoded); return decoded; }; } From 3609f95b2098d35a2193e8cef1092034c6f28ffe Mon Sep 17 00:00:00 2001 From: bibhuty-did-this Date: Thu, 21 Mar 2024 13:31:59 +0530 Subject: [PATCH 2/2] fix: comment resolution --- src/core/shift.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/shift.js b/src/core/shift.js index 7a8f1cc..a8b594d 100644 --- a/src/core/shift.js +++ b/src/core/shift.js @@ -28,7 +28,7 @@ function memoizeDecode(origDecode) { return (payload) => { if (decodeCache.has(payload)) return decodeCache.get(payload); const decoded = origDecode(payload); - if(!!payload) decodeCache.set(payload, decoded); + if(payload.type === 'object' && payload) decodeCache.set(payload, decoded); return decoded; }; }