23 lines
598 B
JavaScript
Raw Permalink Normal View History

2024-01-29 09:26:07 +08:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
2024-08-02 18:19:39 +08:00
exports.createTheme = createTheme;
2024-01-29 09:26:07 +08:00
function createTheme(name, componentThemes) {
const nameIsString = typeof name === 'string';
const theme = {
name: nameIsString ? name : 'customized-theme'
};
if (nameIsString) {
if (componentThemes) {
for (const cTheme of componentThemes) {
theme[cTheme.name] = cTheme;
}
}
}
else {
for (const cTheme of name) {
theme[cTheme.name] = cTheme;
}
}
return theme;
}