(theme: SQLEditorTheme)
| 58 | |
| 59 | /** Throws if any chrome token is missing. */ |
| 60 | export function validateTheme(theme: SQLEditorTheme): void { |
| 61 | for (const token of SQL_EDITOR_THEME_TOKENS) { |
| 62 | const value = theme.tokens[token]; |
| 63 | if (typeof value !== "string" || !isHexColor(value)) { |
| 64 | throw new TypeError(`theme "${theme.id}" missing chrome token ${token}`); |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * The 4 colors an admin picks (each a `#rrggbb` hex). We derive all 29 chrome |
no test coverage detected