(packageRoot: string)
| 55 | * fall through to npm-prefix comparison). |
| 56 | */ |
| 57 | export function classifyByPathHeuristic(packageRoot: string): InstallSource | null { |
| 58 | const normalized = normalizeForHeuristic(packageRoot); |
| 59 | if (normalized.includes(PNPM_PATH_SEGMENT)) return 'pnpm-global'; |
| 60 | for (const seg of YARN_PATH_SEGMENTS) { |
| 61 | if (normalized.includes(seg)) return 'yarn-global'; |
| 62 | } |
| 63 | if (normalized.includes(BUN_PATH_SEGMENT)) return 'bun-global'; |
| 64 | if (normalized.includes(HOMEBREW_PATH_SEGMENT)) return 'homebrew'; |
| 65 | return null; |
| 66 | } |
| 67 | |
| 68 | export interface DetectInstallSourceDeps { |
| 69 | readonly getPackageRoot: () => string; |
no test coverage detected