projectRoot
The namespace a codebase's own code is in: its one top-level namespace, or none if it has several.
export function projectRoot(paths: string[]): string { const tops = new Set(paths.map((p) => p.split(".")[0]!)); return tops.size === 1 && paths.some((p) => p.includes(".")) ? [...tops][0]! : ""; }