From ba7d6dd087899792a7a618c6f8d01b97b5f7c489 Mon Sep 17 00:00:00 2001 From: "Aidar Shaikhutdin @makeweb.space" Date: Fri, 19 May 2023 14:19:09 +0600 Subject: [PATCH] fix: unicode to ascii issue --- src/store/storageHelper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/storageHelper.ts b/src/store/storageHelper.ts index d3a4fee..767cf3c 100644 --- a/src/store/storageHelper.ts +++ b/src/store/storageHelper.ts @@ -34,10 +34,10 @@ export const loadStore = () => { } } -function serialize(data: string) { - return JSON.stringify(btoa(encodeURIComponent(data))) +function serialize(data: object): string { + return btoa(encodeURIComponent(JSON.stringify(data))) } -function deserialize(b64: string) { +function deserialize(b64: string): string { return JSON.parse(decodeURIComponent(atob(b64))) }