diff --git a/src/ScriptEditor/ui/themes.ts b/src/ScriptEditor/ui/themes.ts index b8751c6d6..d3ccadd1d 100644 --- a/src/ScriptEditor/ui/themes.ts +++ b/src/ScriptEditor/ui/themes.ts @@ -90,14 +90,14 @@ export const sanitizeTheme = (theme: IScriptEditorTheme): void => { } const block = theme[themeKey]; - function repairBlock>(block: T) { + const repairBlock = >(block: T) => { for (const [blockKey, blockValue] of Object.entries(block) as [keyof T, unknown][]) { if (!blockValue || (typeof blockValue !== "string" && typeof blockValue !== "object")) (block[blockKey] as string) = "FF0000"; else if (typeof blockValue === "object") repairBlock(block); else if (!blockValue.match(colorRegExp)) (block[blockKey] as string) = "FF0000"; } - } + }; // Type assertion is to something less specific. repairBlock(block); }