add validate method
This commit is contained in:
parent
afc755f44c
commit
1ee914d7eb
9
index.ts
9
index.ts
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user