1 export const getItem = (key: string, defaultValue?: string) => {
3 const value = window.localStorage.getItem(key);
4 return value === undefined ? defaultValue : value;
10 export const setItem = (key: string, value: string) => {
12 window.localStorage.setItem(key, value);
18 export const removeItem = (key: string) => {
20 window.localStorage.removeItem(key);
26 export const hasStorage = (key = 'test') => {
28 window.localStorage.setItem(key, key);
29 window.localStorage.removeItem(key);