MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / findHubByName

Function findHubByName

src/tools/feature-hub.ts:26–35  ·  view source on GitHub ↗
(rootDir: string, name: string)

Source from the content-addressed store, hash-verified

24}
25
26async 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
37export async function getFeatureHub(options: FeatureHubOptions): Promise<string> {
38 const { rootDir, showOrphans } = options;

Callers 1

getFeatureHubFunction · 0.85

Calls 1

discoverHubsFunction · 0.85

Tested by

no test coverage detected