1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-10 07:50:05 +00:00

chore(web): refactor react code

This commit is contained in:
2022-09-08 21:49:35 +05:00
parent d6651bbdbe
commit 4560ef942f
26 changed files with 1534 additions and 1127 deletions

View File

@@ -0,0 +1,14 @@
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 ?? ''
}