diff --git a/src/common/utils.js b/src/common/utils.js index 4b5dced..ac3ecc8 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -198,12 +198,12 @@ const flexLayout = ({ items, gap, direction, sizes = [] }) => { /** * Object containing card colors. * @typedef {{ - * titleColor: string | string[]; - * iconColor: string | string[]; - * textColor: string | string[]; + * titleColor: string; + * iconColor: string; + * textColor: string; * bgColor: string | string[]; - * borderColor: string | string[]; - * ringColor: string | string[]; + * borderColor: string; + * ringColor: string; * }} CardColors */ @@ -267,6 +267,18 @@ const getCardColors = ({ "#" + defaultBorderColor, ); + if ( + typeof titleColor !== "string" || + typeof textColor !== "string" || + typeof ringColor !== "string" || + typeof iconColor !== "string" || + typeof borderColor !== "string" + ) { + throw new Error( + "Unexpected behavior, all colors except background should be string.", + ); + } + return { titleColor, iconColor, textColor, bgColor, borderColor, ringColor }; };