Files
PodTui/src/utils/theme-loader.ts
2026-08-09 09:54:52 -04:00

12 lines
400 B
TypeScript

import type { ThemeJson } from "../types/theme-schema"
export function validateTheme(theme: ThemeJson, source?: string) {
if (!theme || typeof theme !== "object") {
throw new Error(`Invalid theme${source ? ` (${source})` : ""}`)
}
if (!theme.theme || typeof theme.theme !== "object") {
throw new Error(`Theme missing 'theme' object${source ? ` (${source})` : ""}`)
}
return true
}