(state: string)
| 3 | export type AppearanceAction = 'light' | 'dark' | 'toggle'; |
| 4 | |
| 5 | export function parseAppearanceAction(state: string): AppearanceAction { |
| 6 | const normalized = state.trim().toLowerCase(); |
| 7 | if (normalized === 'light') return 'light'; |
| 8 | if (normalized === 'dark') return 'dark'; |
| 9 | if (normalized === 'toggle') return 'toggle'; |
| 10 | throw new AppError('INVALID_ARGS', `Invalid appearance state: ${state}. Use light|dark|toggle.`); |
| 11 | } |
no outgoing calls
no test coverage detected