(record: Record<string, unknown>, key: string)
| 410 | } |
| 411 | |
| 412 | function optionalBoolean(record: Record<string, unknown>, key: string): boolean | undefined { |
| 413 | const value = record[key]; |
| 414 | if (value === undefined) return undefined; |
| 415 | if (typeof value !== 'boolean') { |
| 416 | throw new Error(`Expected ${key} to be a boolean.`); |
| 417 | } |
| 418 | return value; |
| 419 | } |
| 420 | |
| 421 | export function requiredEnum<const T extends readonly string[]>( |
| 422 | record: Record<string, unknown>, |
no outgoing calls
no test coverage detected
searching dependent graphs…