add validate method
This commit is contained in:
9
index.ts
9
index.ts
@@ -10,7 +10,14 @@ export function load_theme(name: string) {
|
|||||||
return null;
|
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
|
export type ColorThemeLabel
|
||||||
|
Reference in New Issue
Block a user