Merge pull request #131 from anuraghazra/fix-sort-langcard

fix: fixed sorting of languages by percentage
This commit is contained in:
Anurag Hazra 2020-07-21 20:00:56 +05:30 committed by GitHub
commit 6c16020c53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,9 @@ const renderTopLanguages = (topLangs, options = {}) => {
}, 0);
// hide langs
langs = langs.filter((lang) => {
langs = langs
.sort((a, b) => b.size - a.size)
.filter((lang) => {
if (!hide_langs_below) return true;
return (lang.size / totalSize) * 100 > hide_langs_below;
});