MCPcopy Create free account
hub / github.com/Nutlope/llamacoder / getLanguageOfFile

Function getLanguageOfFile

lib/utils.ts:228–246  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

226}
227
228export function getLanguageOfFile(filePath: string): string {
229 const extension = filePath.split(".").pop()?.toLowerCase();
230 const languages: Record<string, string> = {
231 js: "javascript",
232 ts: "typescript",
233 tsx: "typescript",
234 jsx: "javascript",
235 py: "python",
236 html: "html",
237 css: "css",
238 json: "json",
239 md: "markdown",
240 sql: "sql",
241 sh: "shell",
242 yaml: "yaml",
243 yml: "yaml",
244 };
245 return languages[extension || ""] || "plaintext";
246}
247
248export function getMonacoLanguage(language: string): string {
249 const map: Record<string, string> = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected