MCPcopy Create free account
hub / github.com/bytebase/bytebase / validateTheme

Function validateTheme

frontend/src/react/components/sql-editor/theme/derive.ts:60–67  ·  view source on GitHub ↗
(theme: SQLEditorTheme)

Source from the content-addressed store, hash-verified

58
59/** Throws if any chrome token is missing. */
60export 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

Callers 4

derive.test.tsFile · 0.90
resolveWorkspaceThemeFunction · 0.90
presets.test.tsFile · 0.90
deriveThemeFromAnchorsFunction · 0.85

Calls 1

isHexColorFunction · 0.85

Tested by

no test coverage detected