MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / frameworkAppliesIn

Method frameworkAppliesIn

src/extraction/index.ts:2425–2447  ·  view source on GitHub ↗
(dir: string, name: string)

Source from the content-addressed store, hash-verified

2423 }
2424
2425 private frameworkAppliesIn(dir: string, name: string): boolean {
2426 const deps = this.gatedFrameworks.get(name);
2427 if (!deps) return true;
2428 const key = `${dir}|${name}`;
2429 const memo = this.appFrameworkMemo.get(key);
2430 if (memo !== undefined) return memo;
2431 // The nearest manifest that names ANY gated framework decides: true-sheet's
2432 // root package.json declares expo-router for its example app, and its
2433 // `docs/` Next.js app — whose own package.json declares `next` — is not
2434 // an Expo app for it.
2435 let applies = false;
2436 for (let d: string | null = dir; d !== null; d = d === '' ? null : d.includes('/') ? d.slice(0, d.lastIndexOf('/')) : '') {
2437 const declared = this.dependenciesDeclaredIn(d);
2438 if (!declared) continue;
2439 if (deps.some((dep) => declared.has(dep))) {
2440 applies = true;
2441 break;
2442 }
2443 if ([...this.gatedFrameworks].some(([other, otherDeps]) => other !== name && otherDeps.some((dep) => declared.has(dep)))) break;
2444 }
2445 this.appFrameworkMemo.set(key, applies);
2446 return applies;
2447 }
2448
2449 private dependenciesDeclaredIn(dir: string): Set<string> | null {
2450 if (this.manifestDependencies.has(dir)) return this.manifestDependencies.get(dir)!;

Callers 1

frameworksForFileMethod · 0.95

Calls 4

hasMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected