(filePath: fs.PathLike)
| 502 | } |
| 503 | |
| 504 | export async function fsStat(filePath: fs.PathLike): Promise<fs.Stats | undefined> { |
| 505 | let stats: fs.Stats | undefined; |
| 506 | try { |
| 507 | stats = await fs.promises.stat(filePath); |
| 508 | } catch { |
| 509 | // File doesn't exist |
| 510 | return undefined; |
| 511 | } |
| 512 | return stats; |
| 513 | } |
| 514 | |
| 515 | export async function checkPathExists(filePath: string): Promise<boolean> { |
| 516 | return !!await fsStat(filePath); |
no outgoing calls
no test coverage detected