(rootDir: string, name: string)
| 24 | } |
| 25 | |
| 26 | async function findHubByName(rootDir: string, name: string): Promise<string | null> { |
| 27 | const hubs = await discoverHubs(rootDir); |
| 28 | const lower = name.toLowerCase(); |
| 29 | |
| 30 | const exact = hubs.find((h) => h.toLowerCase() === `${lower}.md` || h.toLowerCase().endsWith(`/${lower}.md`)); |
| 31 | if (exact) return exact; |
| 32 | |
| 33 | const partial = hubs.find((h) => h.toLowerCase().includes(lower)); |
| 34 | return partial ?? null; |
| 35 | } |
| 36 | |
| 37 | export async function getFeatureHub(options: FeatureHubOptions): Promise<string> { |
| 38 | const { rootDir, showOrphans } = options; |
no test coverage detected