add validate method

This commit is contained in:
James Brumond 2023-05-06 16:36:35 -07:00
parent afc755f44c
commit 1ee914d7eb
Signed by: james
GPG Key ID: E8F2FC44BAA3357A

View File

@ -10,7 +10,14 @@ export function load_theme(name: string) {
return null;
}
return structuredClone(require(`./themes/${name}/theme.json`));
const theme = require(`./themes/${name}/theme.json`);
validate_theme(theme);
return structuredClone(theme);
}
export function validate_theme(theme: unknown) : asserts theme is ColorTheme {
// todo: validate
}
export type ColorThemeLabel