daynitejs
Version:
A lightweight JavaScript library for toggling light and dark themes.
14 lines (13 loc) • 373 B
JavaScript
/**
* Validation utilities for DayniteJs.
* @module Validation
*/
/**
* Validates a theme name.
* @param {string} theme - Theme to validate.
* @param {string[]} validThemes - List of valid themes.
* @returns {boolean} True if theme is valid.
*/
export function isValidTheme(theme, validThemes) {
return typeof theme === 'string' && validThemes.includes(theme);
}