We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fa5d9f commit 2802b9fCopy full SHA for 2802b9f
src/utils/storage.ts
@@ -3,8 +3,9 @@ const storage = window.localStorage;
3
export const setItem = (key: string, value: string) => {
4
try {
5
storage.setItem(key, value);
6
- } catch (error) {
7
- console.log(error);
+ }
+ catch (error: unknown) {
8
+ if (error instanceof Error) console.log(error);
9
}
10
};
11
@@ -14,7 +15,7 @@ export const getItem = <T>(key: string, defaultValue: T): T => {
14
15
if (data) return JSON.parse(data);
16
return defaultValue;
17
} catch (error) {
18
19
20
21
0 commit comments