( name: string, from: string )
| 432 | } |
| 433 | |
| 434 | export const packageRootOf = ( |
| 435 | name: string, |
| 436 | from: string |
| 437 | ): string | undefined => { |
| 438 | for (let dir = from; ; dir = dirname(dir)) { |
| 439 | const root = join(dir, "node_modules", name) |
| 440 | if ( |
| 441 | basename(dir) !== "node_modules" && |
| 442 | existsSync(join(root, "package.json")) |
| 443 | ) |
| 444 | return realPathOf(root) |
| 445 | if (dir === dirname(dir)) return |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | // a host without a channel for source maps reads one from the code |
| 450 | export const appendSourceMap = ( |
no test coverage detected