(filePath: fs.PathLike)
| 9 | export const stat = promisify(fs.stat); |
| 10 | |
| 11 | export async function fileExists(filePath: fs.PathLike) { |
| 12 | try { |
| 13 | const res = await stat(filePath); |
| 14 | return res.isFile(); |
| 15 | } catch { |
| 16 | return false; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export async function resolveSymlink(path: fs.PathLike) { |
| 21 | return (await fileExists(path)) ? realpath(path) : path; |
no outgoing calls
no test coverage detected