(path: string)
| 80 | } |
| 81 | |
| 82 | export function readGraph(path: string): WorkspaceGraphFile { |
| 83 | const graph = readJsonFile(path) |
| 84 | if ( |
| 85 | !graph || |
| 86 | typeof graph !== 'object' || |
| 87 | !Array.isArray((graph as {packages?: unknown}).packages) |
| 88 | ) { |
| 89 | throw new Error(`${path} must contain a packages array`) |
| 90 | } |
| 91 | return { |
| 92 | packages: (graph as {packages: unknown[]}).packages.map(normalizePackage), |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | export function dependencyNames( |
| 97 | pkg: PackageWithDependencies, |
no test coverage detected