MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / getLanguage

Function getLanguage

src/components/FilePreview.tsx:25–43  ·  view source on GitHub ↗
(ext: string)

Source from the content-addressed store, hash-verified

23}
24
25function getLanguage(ext: string): string {
26 const languageMap: Record<string, string> = {
27 ts: "typescript",
28 tsx: "typescript",
29 js: "javascript",
30 jsx: "javascript",
31 json: "json",
32 py: "python",
33 md: "markdown",
34 css: "css",
35 html: "html",
36 yaml: "yaml",
37 yml: "yaml",
38 sh: "bash",
39 bash: "bash",
40 sql: "sql",
41 };
42 return languageMap[ext] || "plaintext";
43}
44
45function isImageFile(ext: string): boolean {
46 return ["png", "jpg", "jpeg", "gif", "webp", "svg", "ico"].includes(ext);

Callers 1

FilePreviewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected