( path: string | URL, )
| 69 | * @returns The string of file content. |
| 70 | */ |
| 71 | export function readTextFileSync( |
| 72 | path: string | URL, |
| 73 | ): string { |
| 74 | if (isDeno) { |
| 75 | return Deno.readTextFileSync(path); |
| 76 | } else { |
| 77 | try { |
| 78 | return getNodeFs().readFileSync(path, "utf-8"); |
| 79 | } catch (error) { |
| 80 | throw mapError(error); |
| 81 | } |
| 82 | } |
| 83 | } |
no test coverage detected