* Resolve path to a module. * @param id The module to require * @param [from] Location to start the node resolution
(id: string, from = process.cwd())
| 275 | * @param [from] Location to start the node resolution |
| 276 | */ |
| 277 | private static resolveModulePath(id: string, from = process.cwd()): string { |
| 278 | if (!extname(from)) { |
| 279 | from = join(from, '__fake.js'); |
| 280 | } |
| 281 | |
| 282 | const path = fs.normalizePath(import.meta.resolve(id, pathToFileURL(from))); |
| 283 | const parts = path.split('/'); |
| 284 | const idx = parts.lastIndexOf(id) + 1; |
| 285 | parts.splice(idx, parts.length - idx); |
| 286 | |
| 287 | return parts.join('/'); |
| 288 | } |
| 289 | |
| 290 | static dumpTable(options: { columns: string[]; rows: string[][]; empty: string }): void { |
| 291 | if (options.rows.length === 0) { |
no test coverage detected