MCPcopy Create free account
hub / github.com/anus-dev/ANUS / validateCustomTheme

Function validateCustomTheme

packages/cli/src/ui/themes/theme.ts:426–442  ·  view source on GitHub ↗
(customTheme: Partial<CustomTheme>)

Source from the content-addressed store, hash-verified

424 * @returns An object with isValid boolean and error message if invalid.
425 */
426export function validateCustomTheme(customTheme: Partial<CustomTheme>): {
427 isValid: boolean;
428 error?: string;
429 warning?: string;
430} {
431 // Since all fields are optional, we only need to validate the name.
432 if (customTheme.name && !isValidThemeName(customTheme.name)) {
433 return {
434 isValid: false,
435 error: `Invalid theme name: ${customTheme.name}`,
436 };
437 }
438
439 return {
440 isValid: true,
441 };
442}
443
444/**
445 * Checks if a theme name is valid.

Callers 2

loadCustomThemesMethod · 0.85
theme.test.tsFile · 0.85

Calls 1

isValidThemeNameFunction · 0.85

Tested by

no test coverage detected