Fixed docstring for trimTopLanguages function (#2833)

* Fixed docstring for trimTopLanguages function

* dev
This commit is contained in:
Alexandr Garbuzov
2023-06-16 09:25:46 +02:00
committed by GitHub
parent 4db78d7796
commit 99aca1b6d5
2 changed files with 8 additions and 10 deletions
+4 -4
View File
@@ -163,11 +163,11 @@ const donutCenterTranslation = (totalLangs) => {
* Trim top languages to lang_count while also hiding certain languages.
*
* @param {Record<string, Lang>} topLangs Top languages.
* @param {string[]} hide Languages to hide.
* @param {string} langs_count Number of languages to show.
* @returns {{topLangs: Record<string, Lang>, totalSize: number}} Trimmed top languages and total size.
* @param {string[]=} hide Languages to hide.
* @returns {{ langs: Lang[], totalLanguageSize: number }} Trimmed top languages and total size.
*/
const trimTopLanguages = (topLangs, hide, langs_count) => {
const trimTopLanguages = (topLangs, langs_count, hide) => {
let langs = Object.values(topLangs);
let langsToHide = {};
let langsCount = clampValue(parseInt(langs_count), 1, 10);
@@ -733,8 +733,8 @@ const renderTopLanguages = (topLangs, options = {}) => {
const { langs, totalLanguageSize } = trimTopLanguages(
topLangs,
hide,
String(langs_count),
hide,
);
let width = isNaN(card_width)