()
| 37 | const hasInput = (): boolean => !!filename |
| 38 | |
| 39 | const read = async (): Promise<T> => { |
| 40 | if (!filename) { |
| 41 | throw ReferenceError('read called when hasInput returns false') |
| 42 | } |
| 43 | |
| 44 | return parseJSONOrYAML(await readFile(filename, 'utf-8'), filename) |
| 45 | } |
| 46 | |
| 47 | return { ioFormat, hasInput, read } |
| 48 | } |
nothing calls this directly
no test coverage detected