()
| 170 | * by the caller (newest first). |
| 171 | */ |
| 172 | export function loadWorkspaceOrder(): string[] { |
| 173 | const parsed = safeGetJson<unknown>(STORAGE_KEYS.workspaceOrder); |
| 174 | if (!Array.isArray(parsed)) return []; |
| 175 | return parsed.filter((id): id is string => typeof id === 'string'); |
| 176 | } |
| 177 | |
| 178 | export function saveWorkspaceOrder(ids: Iterable<string>): void { |
| 179 | safeSetJson(STORAGE_KEYS.workspaceOrder, Array.from(ids)); |
no test coverage detected