| 27 | import type { UserPreferences } from "@/common/config/schemas/userPreferences"; |
| 28 | |
| 29 | class MemoryStorage { |
| 30 | private values = new Map<string, string>(); |
| 31 | |
| 32 | get length() { |
| 33 | return this.values.size; |
| 34 | } |
| 35 | |
| 36 | key(index: number): string | null { |
| 37 | return Array.from(this.values.keys())[index] ?? null; |
| 38 | } |
| 39 | |
| 40 | getItem(key: string): string | null { |
| 41 | return this.values.get(key) ?? null; |
| 42 | } |
| 43 | |
| 44 | setJSON(key: string, value: unknown) { |
| 45 | this.values.set(key, JSON.stringify(value)); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | function collectForTest(storage: MemoryStorage) { |
| 50 | return getStoredUserPreferenceEntries(storage).reduce( |
nothing calls this directly
no outgoing calls
no test coverage detected