mirror of
https://github.com/System-End/github-readme-stats.git
synced 2026-04-20 00:35:23 +00:00
refactor: fix card colors type and function to resolve vscode type errors (#3191)
This commit is contained in:
parent
b0e15fb17c
commit
b55aaa4cff
1 changed files with 17 additions and 5 deletions
|
|
@ -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 };
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue