summaryrefslogtreecommitdiff
path: root/packages/frontend/src/theme.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/theme.ts')
-rw-r--r--packages/frontend/src/theme.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/frontend/src/theme.ts b/packages/frontend/src/theme.ts
index e001bed8f3..af47402bd6 100644
--- a/packages/frontend/src/theme.ts
+++ b/packages/frontend/src/theme.ts
@@ -204,7 +204,7 @@ export function compile(theme: Theme): Record<string, string> {
return tinycolor(val);
}
- const props = {};
+ const props = {} as Record<string, string>;
for (const [k, v] of Object.entries(theme.props)) {
if (k.startsWith('$')) continue; // ignore const
@@ -232,7 +232,7 @@ export function parseThemeCode(code: string): Theme {
try {
theme = JSON5.parse(code);
- } catch (err) {
+ } catch (_) {
throw new Error('Failed to parse theme json');
}
if (!validateTheme(theme)) {
@@ -247,12 +247,12 @@ export function parseThemeCode(code: string): Theme {
export function previewTheme(code: string): void {
const theme = parseThemeCode(code);
- if (theme) applyTheme(theme, false);
+ if (theme != null) applyTheme(theme, false);
}
export async function installTheme(code: string): Promise<void> {
const theme = parseThemeCode(code);
- if (!theme) return;
+ if (theme == null) return;
await addTheme(theme);
}