diff --git a/src/cards/top-languages-card.js b/src/cards/top-languages-card.js index f2fda70ece155..7ff100710bc93 100644 --- a/src/cards/top-languages-card.js +++ b/src/cards/top-languages-card.js @@ -201,7 +201,7 @@ const trimTopLanguages = (topLangs, langs_count, hide) => { * @param {number} props.width The card width * @param {string} props.color Color of the programming language. * @param {string} props.name Name of the programming language. - * @param {string} props.progress Usage of the programming language in percentage. + * @param {number} props.progress Usage of the programming language in percentage. * @param {number} props.index Index of the programming language. * @returns {string} Programming language SVG node. */ @@ -329,7 +329,9 @@ const renderNormalLayout = (langs, width, totalLanguageSize) => { width, name: lang.name, color: lang.color || DEFAULT_LANG_COLOR, - progress: ((lang.size / totalLanguageSize) * 100).toFixed(2), + progress: parseFloat( + ((lang.size / totalLanguageSize) * 100).toFixed(2), + ), index, }); }), diff --git a/src/cards/wakatime-card.js b/src/cards/wakatime-card.js index e3f5433c4cb72..187af7ed87c34 100644 --- a/src/cards/wakatime-card.js +++ b/src/cards/wakatime-card.js @@ -95,7 +95,7 @@ const createLanguageTextNode = ({ langs, y }) => { * @param {string} args.label The label of the text node item. * @param {string} args.value The value of the text node item. * @param {number} args.index The index of the text node item. - * @param {string} args.percent Percentage of the text node item. + * @param {number} args.percent Percentage of the text node item. * @param {boolean=} args.hideProgress Whether to hide the progress bar. * @param {string} args.progressBarColor The color of the progress bar. * @param {string} args.progressBarBackgroundColor The color of the progress bar background. diff --git a/src/common/createProgressNode.js b/src/common/createProgressNode.js index 2825583c7406a..2d7303a5a78ef 100644 --- a/src/common/createProgressNode.js +++ b/src/common/createProgressNode.js @@ -1,3 +1,5 @@ +// @ts-check + import { clampValue } from "./utils.js"; /** @@ -8,7 +10,7 @@ import { clampValue } from "./utils.js"; * @param {number} createProgressNodeParams.y Y-axis position. * @param {number} createProgressNodeParams.width Width of progress bar. * @param {string} createProgressNodeParams.color Progress color. - * @param {string} createProgressNodeParams.progress Progress value. + * @param {number} createProgressNodeParams.progress Progress value. * @param {string} createProgressNodeParams.progressBarBackgroundColor Progress bar bg color. * @param {number} createProgressNodeParams.delay Delay before animation starts. * @returns {string} Progress node.