Add frontend unit tests (Part 2)

This commit is contained in:
acx10
2026-01-06 15:16:26 -07:00
parent 81442a1e5c
commit f63a8641d8
47 changed files with 3994 additions and 97 deletions
@@ -0,0 +1,25 @@
import {Injectable} from '@angular/core';
@Injectable({providedIn: 'root'})
export class LocalStorageService {
get<T>(key: string): T | null {
try {
const value = localStorage.getItem(key);
return value ? JSON.parse(value) as T : null;
} catch {
return null;
}
}
set<T>(key: string, value: T): void {
try {
localStorage.setItem(key, JSON.stringify(value));
} catch {
}
}
remove(key: string): void {
localStorage.removeItem(key);
}
}