mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-12 09:34:01 +01:00
26 lines
475 B
TypeScript
26 lines
475 B
TypeScript
export const getStoredItem = (key: string): string | null => {
|
|
try {
|
|
return localStorage.getItem(key);
|
|
} catch {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
export const setStoredItem = (key: string, value: string): boolean => {
|
|
try {
|
|
localStorage.setItem(key, value);
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
export const removeStoredItem = (key: string): boolean => {
|
|
try {
|
|
localStorage.removeItem(key);
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
};
|