(path: string | URL)
| 52 | * @returns A {@linkcode FsFile} instance. |
| 53 | */ |
| 54 | export function createSync(path: string | URL): FsFile { |
| 55 | if (isDeno) { |
| 56 | return Deno.createSync(path); |
| 57 | } else { |
| 58 | try { |
| 59 | return openSync(path, { create: true, write: true, truncate: true }); |
| 60 | } catch (error) { |
| 61 | throw mapError(error); |
| 62 | } |
| 63 | } |
| 64 | } |
no test coverage detected