From ee694050c71d47a7188d4aed46d55efedeee496c Mon Sep 17 00:00:00 2001 From: Alexandr Date: Sat, 18 Oct 2025 21:16:13 +0300 Subject: [PATCH] fix: resolve vscode type errors inside color module --- src/common/color.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/color.js b/src/common/color.js index 759a07ca25c7b..a372f24401a9a 100644 --- a/src/common/color.js +++ b/src/common/color.js @@ -1,3 +1,5 @@ +// @ts-check + import { themes } from "../../themes/index.js"; /** @@ -69,7 +71,6 @@ const fallbackColor = (color, fallbackColor) => { * @param {string=} args.border_color Card border color. * @param {string=} args.ring_color Card ring color. * @param {string=} args.theme Card theme. - * @param {string=} args.fallbackTheme Fallback theme. * @returns {CardColors} Card colors. */ const getCardColors = ({ @@ -80,11 +81,13 @@ const getCardColors = ({ border_color, ring_color, theme, - fallbackTheme = "default", }) => { - const defaultTheme = themes[fallbackTheme]; + const defaultTheme = themes["default"]; const isThemeProvided = theme !== null && theme !== undefined; + + // @ts-ignore const selectedTheme = isThemeProvided ? themes[theme] : defaultTheme; + const defaultBorderColor = "border_color" in selectedTheme ? selectedTheme.border_color