mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
16 lines
302 B
TypeScript
16 lines
302 B
TypeScript
export function readStoredValue(key: string): string | null {
|
|
try {
|
|
return localStorage.getItem(key)
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|
|
|
|
export function writeStoredValue(key: string, value: unknown): void {
|
|
try {
|
|
localStorage.setItem(key, JSON.stringify(value))
|
|
} catch {
|
|
return
|
|
}
|
|
}
|