(file: string, target: string, ws: WorkspacePackages | null | undefined)
| 760 | |
| 761 | /** Whether `target`, a project path, lies outside the nested root `file` is under, if it is under one. */ |
| 762 | export function leavesWorkspaceRoot(file: string, target: string, ws: WorkspacePackages | null | undefined): boolean { |
| 763 | const roots = ws?.nestedRoots; |
| 764 | if (!roots) return false; |
| 765 | const root = workspaceRootOf(file.replace(/\\/g, '/'), roots); |
| 766 | return root !== '' && !target.replace(/\\/g, '/').startsWith(root + '/'); |
| 767 | } |
| 768 | |
| 769 | /** The path dependency the nearest declaring manifest above `fromFile` maps `importPath` to. */ |
| 770 | function scopedPackage(importPath: string, ws: WorkspacePackages, fromFile?: string): { name: string; dir: string } | null { |
no test coverage detected