MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / isCodeFile

Function isCodeFile

src/utils/language-detection.ts:193–205  ·  view source on GitHub ↗
(
  filePath: string,
  extensions?: Iterable<string> | ReadonlySet<string>
)

Source from the content-addressed store, hash-verified

191 * Check if a file is a code file
192 */
193export function isCodeFile(
194 filePath: string,
195 extensions?: Iterable<string> | ReadonlySet<string>
196): boolean {
197 const ext = path.extname(filePath).toLowerCase();
198 const supportedExtensions =
199 extensions instanceof Set
200 ? extensions
201 : extensions
202 ? buildCodeExtensions(extensions)
203 : defaultCodeExtensions;
204 return supportedExtensions.has(ext);
205}
206
207/**
208 * Check if a file is binary

Callers 1

scanFilesMethod · 0.85

Calls 2

buildCodeExtensionsFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected