(filename: string)
| 25 | }; |
| 26 | |
| 27 | export const getCodeParserByFilename = async (filename: string): Promise<Parser> => { |
| 28 | const found = LanguageDescription.matchFilename(builtinLanguages, filename); |
| 29 | if (!found) { |
| 30 | return plainTextLanguage.parser; |
| 31 | } |
| 32 | if (!found.support) { |
| 33 | await found.load(); |
| 34 | } |
| 35 | return found.support ? found.support.language.parser : plainTextLanguage.parser; |
| 36 | }; |
| 37 | |
| 38 | export async function highlightCode<Output>( |
| 39 | languageName: string, |
no outgoing calls
no test coverage detected