mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 15:12:27 +01:00
Satisfy lint
This commit is contained in:
parent
b65bd62345
commit
8bc67f542a
@ -90,14 +90,14 @@ export const sanitizeTheme = (theme: IScriptEditorTheme): void => {
|
||||
}
|
||||
|
||||
const block = theme[themeKey];
|
||||
function repairBlock<T extends Record<string, unknown>>(block: T) {
|
||||
const repairBlock = <T extends Record<string, unknown>>(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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user