feat: added "exclude_repo" option to Top Langs (#493)

* 🚀 Added "exclude_repo" option to Top Langs

* chore: code style update

Co-authored-by: Anurag <hazru.anurag@gmail.com>
This commit is contained in:
Bas950
2020-09-27 09:09:44 +02:00
committed by GitHub
parent 3443b37904
commit d4e2a1b395
3 changed files with 33 additions and 2 deletions
+6 -1
View File
@@ -24,6 +24,7 @@ module.exports = async (req, res) => {
cache_seconds,
layout,
langs_count,
exclude_repo,
} = req.query;
let topLangs;
@@ -34,7 +35,11 @@ module.exports = async (req, res) => {
}
try {
topLangs = await fetchTopLanguages(username, langs_count);
topLangs = await fetchTopLanguages(
username,
langs_count,
parseArray(exclude_repo),
);
const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),