(p: string)
| 4 | import { isNoEntError } from "~/core/errors.js"; |
| 5 | |
| 6 | export async function pathExists(p: string): Promise<boolean> { |
| 7 | try { |
| 8 | await fs.promises.stat(p); |
| 9 | return true; |
| 10 | } catch (err) { |
| 11 | if (isNoEntError(err)) return false; |
| 12 | throw err; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | type FsStat = Pick< |
| 17 | fs.Stats, |
no test coverage detected