(filePath: string)
| 84 | }; |
| 85 | |
| 86 | export function getLanguageFromPath(filePath: string): string { |
| 87 | const name = filePath.split("/").pop() ?? ""; |
| 88 | if (name.toLowerCase() === "dockerfile") return "dockerfile"; |
| 89 | const ext = name.split(".").pop()?.toLowerCase() ?? ""; |
| 90 | return EXT_TO_LANG[ext] ?? "text"; |
| 91 | } |
| 92 | |
| 93 | interface UseHighlightedCodeOptions { |
| 94 | code: string; |
no test coverage detected