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

Method frameworksForFile

src/extraction/index.ts:2417–2423  ·  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

2415 * an enclosing one declares any of them.
2416 */
2417 private frameworksForFile(filePath: string, names: string[]): string[] {
2418 if (this.gatedFrameworks.size === 0) return names;
2419 const slash = filePath.lastIndexOf('/');
2420 const dir = slash < 0 ? '' : filePath.slice(0, slash);
2421 const kept = names.filter((name) => this.frameworkAppliesIn(dir, name));
2422 return kept.length === names.length ? names : kept;
2423 }
2424
2425 private frameworkAppliesIn(dir: string, name: string): boolean {
2426 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