mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-05-30 06:21:10 +00:00
fix: adding docstrings to the files where it was missing (#2101)
* fix: adding docstrings to missing files * style: format code * style: improve formatting Co-authored-by: Jagruti Tiwari <jagrutit@cdac.in> Co-authored-by: rickstaa <rick.staa@outlook.com>
This commit is contained in:
+14
-5
@@ -74,7 +74,10 @@ function parseBoolean(value) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} str
|
||||
* Parse string to array of strings.
|
||||
*
|
||||
* @param {string} str The string to parse.
|
||||
* @returns {string[]} The array of strings.
|
||||
*/
|
||||
function parseArray(str) {
|
||||
if (!str) return [];
|
||||
@@ -82,9 +85,12 @@ function parseArray(str) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} number
|
||||
* @param {number} min
|
||||
* @param {number} max
|
||||
* Clamp the given number between the given range.
|
||||
*
|
||||
* @param {number} number The number to clamp.
|
||||
* @param {number} min The minimum value.
|
||||
* @param {number} max The maximum value.
|
||||
* returns {number} The clamped number.
|
||||
*/
|
||||
function clampValue(number, min, max) {
|
||||
// @ts-ignore
|
||||
@@ -93,7 +99,10 @@ function clampValue(number, min, max) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string[]} colors
|
||||
* Check if the given string is a valid gradient.
|
||||
*
|
||||
* @param {string[]} colors Array of colors.
|
||||
* returns {boolean} True if the given string is a valid gradient.
|
||||
*/
|
||||
function isValidGradient(colors) {
|
||||
return isValidHexColor(colors[1]) && isValidHexColor(colors[2]);
|
||||
|
||||
Reference in New Issue
Block a user