mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
12 lines
190 B
TypeScript
12 lines
190 B
TypeScript
export const GetLocalStorage = <T>(key: string) =>
|
|
{
|
|
try
|
|
{
|
|
JSON.parse(window.localStorage.getItem(key)) as T ?? null;
|
|
}
|
|
catch (e)
|
|
{
|
|
return null;
|
|
}
|
|
};
|