( record: Record<string, unknown>, key: string, parse: (value: unknown) => T | undefined, )
| 16 | } |
| 17 | |
| 18 | function readOptional<T>( |
| 19 | record: Record<string, unknown>, |
| 20 | key: string, |
| 21 | parse: (value: unknown) => T | undefined, |
| 22 | ): T | undefined { |
| 23 | return parse(record[key]); |
| 24 | } |
| 25 | |
| 26 | function readNullable<T>( |
| 27 | record: Record<string, unknown>, |
no test coverage detected