mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
15 lines
402 B
TypeScript
15 lines
402 B
TypeScript
export const getLanguageFromExtension = (extension: string) => {
|
|
if (extension === 'js') return 'javascript'
|
|
|
|
if (extension === 'ts') return 'typescript'
|
|
|
|
if (extension === 'md' || extension === 'mdx') return 'markdown'
|
|
|
|
return extension
|
|
}
|
|
|
|
export const getSelection = (editor: any) => {
|
|
const selection = editor?.getModel().getValueInRange(editor?.getSelection())
|
|
return selection ?? ''
|
|
}
|