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

Method frameworkAppliesIn

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

Source from the content-addressed store, hash-verified

2386 }
2387
2388 private frameworkAppliesIn(dir: string, name: string): boolean {
2389 const deps = this.gatedFrameworks.get(name);
2390 if (!deps) return true;
2391 const key = `${dir}|${name}`;
2392 const memo = this.appFrameworkMemo.get(key);
2393 if (memo !== undefined) return memo;
2394 // The nearest manifest that names ANY gated framework decides: true-sheet's
2395 // root package.json declares expo-router for its example app, and its
2396 // `docs/` Next.js app — whose own package.json declares `next` — is not
2397 // an Expo app for it.
2398 let applies = false;
2399 for (let d: string | null = dir; d !== null; d = d === '' ? null : d.includes('/') ? d.slice(0, d.lastIndexOf('/')) : '') {
2400 const declared = this.dependenciesDeclaredIn(d);
2401 if (!declared) continue;
2402 if (deps.some((dep) => declared.has(dep))) {
2403 applies = true;
2404 break;
2405 }
2406 if ([...this.gatedFrameworks].some(([other, otherDeps]) => other !== name && otherDeps.some((dep) => declared.has(dep)))) break;
2407 }
2408 this.appFrameworkMemo.set(key, applies);
2409 return applies;
2410 }
2411
2412 private dependenciesDeclaredIn(dir: string): Set<string> | null {
2413 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