MCPcopy Index your code
hub / github.com/21st-dev/1code / detectLanguage

Function detectLanguage

src/shared/detect-language.ts:46–49  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

44};
45
46export function detectLanguage(filePath: string): string {
47 const ext = filePath.toLowerCase().match(/\.[^.]+$/)?.[0] || "";
48 return extensionMap[ext] || "plaintext";
49}

Callers 1

createFileContentsRouterFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected