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

Function isSourceFile

src/extraction/grammars.ts:184–192  ·  view source on GitHub ↗
(filePath: string, overrides?: Record<string, Language>)

Source from the content-addressed store, hash-verified

182 * to the built-ins. Omitting it is byte-identical to the zero-config behavior.
183 */
184export function isSourceFile(filePath: string, overrides?: Record<string, Language>): boolean {
185 if (isPlayRoutesFile(filePath)) return true; // Play `conf/routes` is extensionless
186 if (isShopifyLiquidJson(filePath)) return true; // Shopify OS 2.0 JSON templates / section groups
187 if (isErlangAppFile(filePath)) return true; // OTP `.app`/`.app.src` resource files
188 const dot = filePath.lastIndexOf('.');
189 if (dot < 0) return false;
190 const ext = filePath.slice(dot).toLowerCase();
191 return ext in EXTENSION_MAP || (!!overrides && ext in overrides);
192}
193
194/**
195 * Shopify OS 2.0 JSON template (`templates/*.json`) or section group

Callers 10

considerFunction · 0.90
collectGitStatusFunction · 0.90
scanDirectoryFunction · 0.90
scanDirectoryAsyncFunction · 0.90
walkFunction · 0.90
handleChangeMethod · 0.90
security.test.tsFile · 0.90
frameworks.test.tsFile · 0.90
extraction.test.tsFile · 0.90

Calls 3

isPlayRoutesFileFunction · 0.85
isShopifyLiquidJsonFunction · 0.85
isErlangAppFileFunction · 0.85

Tested by

no test coverage detected