import "ace-builds"; import { themesByName } from "ace-builds/src-noconflict/ext-themelist"; import { getTheme } from "./theme"; export const getEditorTheme = (themeName: string) => { const key = themeName.replace(/^ace\/theme\//, ""); if (themesByName[key] !== undefined) return `ace/theme/${key}`; return getTheme() === "dark" ? "ace/theme/twilight" : "ace/theme/chrome"; };