openreplay/frontend/app/player/player/localStorage.ts
Andrey Babushkin fd5c0c9747
Add lokalisation (#3092)
* applied eslint

* add locales and lint the project

* removed error boundary

* updated locales

* fix min files

* fix locales
2025-03-06 17:43:15 +01:00

18 lines
445 B
TypeScript

export function number(key: string, dflt = 0): number {
const stVal = localStorage.getItem(key);
if (stVal === null) {
return dflt;
}
const val = parseInt(stVal);
if (isNaN(val)) {
return dflt;
}
return val;
}
export function boolean(key: string, dflt = false): boolean {
return localStorage.getItem(key) === 'true';
}
export function string(key: string, dflt = ''): string {
return localStorage.getItem(key) || '';
}