Merge branch 'fix-top-contributors' of github.com:DenverCoderOne/git-stats into new-version

This commit is contained in:
Ionică Bizău 2022-08-03 12:25:59 +03:00
commit 57f4088526
2 changed files with 6 additions and 4 deletions

View File

@ -560,15 +560,16 @@ class GitStats {
; ;
self.authors(options, function (err, authors) { self.authors(options, function (err, authors) {
const maxAuthors = 2 * options.radius;
if (err) { return callback(err); } if (err) { return callback(err); }
if (authors.length > 50) { if (authors.length > maxAuthors) {
let others = { let others = {
value: authors.slice(50).reduce(function (a, b) { value: authors.slice(maxAuthors).reduce(function (a, b) {
return a + b.value; return a + b.value;
}, 0) }, 0)
, label: "Others" , label: "Others"
}; };
authors = authors.slice(0, 50); authors = authors.slice(0, maxAuthors);
authors.push(others); authors.push(others);
} }

View File

@ -14,7 +14,8 @@
"contributors": [ "contributors": [
"Gnab <as0n@gnab.fr>", "Gnab <as0n@gnab.fr>",
"William Boman <william@redwill.se>", "William Boman <william@redwill.se>",
"Fabian Furger <mystyfly@gmail.com>" "Fabian Furger <mystyfly@gmail.com>",
"Jonah Lawrence <jonah@freshidea.com>"
], ],
"license": "MIT", "license": "MIT",
"repository": { "repository": {