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

Method frameworksForFile

src/extraction/index.ts:2380–2386  ·  view source on GitHub ↗

* The detected frameworks whose extractors apply to `filePath`: all of them, * except one with `appDependencies` when neither the file's package.json nor * an enclosing one declares any of them.

(filePath: string, names: string[])

Source from the content-addressed store, hash-verified

2378 * an enclosing one declares any of them.
2379 */
2380 private frameworksForFile(filePath: string, names: string[]): string[] {
2381 if (this.gatedFrameworks.size === 0) return names;
2382 const slash = filePath.lastIndexOf('/');
2383 const dir = slash < 0 ? '' : filePath.slice(0, slash);
2384 const kept = names.filter((name) => this.frameworkAppliesIn(dir, name));
2385 return kept.length === names.length ? names : kept;
2386 }
2387
2388 private frameworkAppliesIn(dir: string, name: string): boolean {
2389 const deps = this.gatedFrameworks.get(name);

Callers 2

parseFileMethod · 0.95
indexFileWithContentMethod · 0.95

Calls 1

frameworkAppliesInMethod · 0.95

Tested by

no test coverage detected