fix: jsx.tolowercase error

This commit is contained in:
Akhileshrangani4 2024-10-27 14:20:39 -04:00
parent 684ee20a03
commit f6077ed516

View File

@ -73,7 +73,11 @@ function mapModule(module: string): monaco.languages.typescript.ModuleKind {
) )
} }
function mapJSX(jsx: string): monaco.languages.typescript.JsxEmit { function mapJSX(jsx: string | undefined): monaco.languages.typescript.JsxEmit {
if (!jsx || typeof jsx !== 'string') {
return monaco.languages.typescript.JsxEmit.React // Default value
}
const jsxMap: { [key: string]: monaco.languages.typescript.JsxEmit } = { const jsxMap: { [key: string]: monaco.languages.typescript.JsxEmit } = {
preserve: monaco.languages.typescript.JsxEmit.Preserve, preserve: monaco.languages.typescript.JsxEmit.Preserve,
react: monaco.languages.typescript.JsxEmit.React, react: monaco.languages.typescript.JsxEmit.React,