(state: string)
| 1 | import { AppError } from '../kernel/errors.ts'; |
| 2 | |
| 3 | export function parseSettingState(state: string): boolean { |
| 4 | const normalized = state.toLowerCase(); |
| 5 | if (normalized === 'on' || normalized === 'true' || normalized === '1') return true; |
| 6 | if (normalized === 'off' || normalized === 'false' || normalized === '0') return false; |
| 7 | throw new AppError('INVALID_ARGS', `Invalid setting state: ${state}`); |
| 8 | } |
no outgoing calls
no test coverage detected