MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getLanguageFromPath

Function getLanguageFromPath

webview-ui/src/utils/getLanguageFromPath.ts:86–89  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

84// console.log(getLanguageFromPath('/path/to/file.js')); // Output: javascript
85
86export function getLanguageFromPath(path: string): string | undefined {
87 const extension = path.split(".").pop()?.toLowerCase() || ""
88 return extensionToLanguage[extension]
89}

Callers 2

DiffView.tsxFile · 0.90
CodeAccordionFunction · 0.90

Calls 1

popMethod · 0.80

Tested by

no test coverage detected