feat: hide specific languages in "Top languages" card (#150)

* add new query param to hide specific languages in top languages card

* [top-langs] add function to clean out the provided lang name

* [top-langs] rename 'hide_lang' => 'hide', refactor logic for parsing the list of provided languages to hide

* [top-langs] take list of languages to hide, as a json array

* chore: minor changes

* docs: added docs for hide lang

Co-authored-by: anuraghazra <hazru.anurag@gmail.com>
This commit is contained in:
Arjun Mahishi
2020-07-23 19:47:04 +05:30
committed by GitHub
parent 17c33cd322
commit c2adcfd6fe
6 changed files with 67 additions and 37 deletions

View File

@@ -2,6 +2,7 @@ require("dotenv").config();
const {
renderError,
parseBoolean,
parseJSON,
clampValue,
CONSTANTS,
} = require("../src/utils");
@@ -44,7 +45,7 @@ module.exports = async (req, res) => {
res.send(
renderStatsCard(stats, {
hide: JSON.parse(hide || "[]"),
hide: parseJSON(hide),
show_icons: parseBoolean(show_icons),
hide_title: parseBoolean(hide_title),
hide_border: parseBoolean(hide_border),