(file: string)
| 6 | const { readFile } = promises; |
| 7 | |
| 8 | async function readFileOrNull(file: string) { |
| 9 | try { |
| 10 | const data = await readFile(file); |
| 11 | return data; |
| 12 | } catch (error: unknown) { |
| 13 | if (!isErrnoException(error)) { |
| 14 | throw error; |
| 15 | } |
| 16 | if (error.code !== 'ENOENT') { |
| 17 | throw error; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | return null; |
| 22 | } |
| 23 | |
| 24 | export async function readConfigFile<T>( |
| 25 | files: string | string[] |
no test coverage detected