(path: string)
| 7 | |
| 8 | |
| 9 | export const fileExists = async (path: string): Promise<boolean> => { |
| 10 | try { |
| 11 | await stat(path) |
| 12 | return true |
| 13 | } catch (error) { |
| 14 | if (error.code === 'ENOENT') { |
| 15 | return false |
| 16 | } |
| 17 | throw error |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export const isFile = async (path: string): Promise<boolean> => |
| 22 | await fileExists(path) && (await stat(path)).isFile() |
no outgoing calls
no test coverage detected