(raw: string)
| 137 | * validates against known levels. Returns null for unrecognized values. |
| 138 | */ |
| 139 | export function normalizeLogLevel(raw: string): LogLevel | null { |
| 140 | const lower = raw.trim().toLowerCase(); |
| 141 | const mapped = lower === 'warning' ? 'warn' : lower; |
| 142 | if (mapped in LOG_LEVELS) { |
| 143 | return mapped as LogLevel; |
| 144 | } |
| 145 | return null; |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Yargs coerce function for log-level options. |
no outgoing calls
no test coverage detected