fix: unicode to ascii issue

This commit is contained in:
Aidar Shaikhutdin @makeweb.space 2023-05-19 14:19:09 +06:00
parent b4fe8acb42
commit ba7d6dd087

View File

@ -34,10 +34,10 @@ export const loadStore = () => {
} }
} }
function serialize(data: string) { function serialize(data: object): string {
return JSON.stringify(btoa(encodeURIComponent(data))) return btoa(encodeURIComponent(JSON.stringify(data)))
} }
function deserialize(b64: string) { function deserialize(b64: string): string {
return JSON.parse(decodeURIComponent(atob(b64))) return JSON.parse(decodeURIComponent(atob(b64)))
} }