mirror of
https://github.com/System-End/github-readme-stats.git
synced 2026-04-19 19:55:16 +00:00
refactor: fix createProgressNode function jsdoc and enable ts-check (#3211)
This commit is contained in:
parent
47e6e56eb3
commit
8879c7fe2e
3 changed files with 8 additions and 4 deletions
|
|
@ -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,
|
||||
});
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue