(headers: FileParserInput['headers'])
| 36 | typeof value.binary === 'boolean' |
| 37 | |
| 38 | const normalizeHeaders = (headers: FileParserInput['headers']): Record<string, string> => { |
| 39 | const transformed = transformTable(headers ?? null) |
| 40 | return Object.entries(transformed).reduce( |
| 41 | (acc, [key, value]) => { |
| 42 | const headerName = key.trim() |
| 43 | if (headerName && value !== undefined && value !== null) { |
| 44 | acc[headerName] = String(value) |
| 45 | } |
| 46 | return acc |
| 47 | }, |
| 48 | {} as Record<string, string> |
| 49 | ) |
| 50 | } |
| 51 | |
| 52 | const normalizeFileParseResult = (value: unknown): FileParseResult => { |
| 53 | if (isRecord(value) && isFileParseResult(value.output)) { |
no test coverage detected