* Computes the absolute path to for the given path relative to the provided base directory. * If either `path` or `baseDir` are `file:` URLs, they are converted to local paths.
(path: string, baseDir = process.cwd())
| 236 | * If either `path` or `baseDir` are `file:` URLs, they are converted to local paths. |
| 237 | */ |
| 238 | absolutePath(path: string, baseDir = process.cwd()): string { |
| 239 | if (!path) { |
| 240 | return this.normalizePath(baseDir); |
| 241 | } |
| 242 | |
| 243 | if (!isAbsolute(path) && !path.startsWith('file://')) { |
| 244 | path = baseDir + '/' + path; |
| 245 | } |
| 246 | |
| 247 | return this.normalizePath(path); |
| 248 | }, |
| 249 | |
| 250 | async readFile(path: string): Promise<string> { |
| 251 | return nodeReadFile(path, 'utf-8'); |
nothing calls this directly
no test coverage detected