(path: string | URL)
| 25 | * @returns A promise that resolves to a {@linkcode FileInfo} for the specified `path`. |
| 26 | */ |
| 27 | export async function stat(path: string | URL): Promise<FileInfo> { |
| 28 | if (isDeno) { |
| 29 | return Deno.stat(path); |
| 30 | } else { |
| 31 | try { |
| 32 | return toFileInfo(await getNodeFs().promises.stat(path)); |
| 33 | } catch (error) { |
| 34 | throw mapError(error); |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Synchronously returns a {@linkcode FileInfo} for the specified |
no test coverage detected