(path: string)
| 10 | |
| 11 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 12 | export async function readJSONFileContentsIfExists(path: string): Promise<any> { |
| 13 | try { |
| 14 | return JSON.parse(await readFileContents(path)); |
| 15 | } catch (e) { |
| 16 | if ((e as {code: string}).code === "ENOENT") { |
| 17 | return null; |
| 18 | } else { |
| 19 | throw e; |
| 20 | } |
| 21 | } |
| 22 | } |
no test coverage detected
searching dependent graphs…