mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-21 21:02:10 +01:00
Merge branch 'fix-top-contributors' of github.com:DenverCoderOne/git-stats into new-version
This commit is contained in:
commit
57f4088526
2 changed files with 6 additions and 4 deletions
|
@ -560,15 +560,16 @@ class GitStats {
|
|||
;
|
||||
|
||||
self.authors(options, function (err, authors) {
|
||||
const maxAuthors = 2 * options.radius;
|
||||
if (err) { return callback(err); }
|
||||
if (authors.length > 50) {
|
||||
if (authors.length > maxAuthors) {
|
||||
let others = {
|
||||
value: authors.slice(50).reduce(function (a, b) {
|
||||
value: authors.slice(maxAuthors).reduce(function (a, b) {
|
||||
return a + b.value;
|
||||
}, 0)
|
||||
, label: "Others"
|
||||
};
|
||||
authors = authors.slice(0, 50);
|
||||
authors = authors.slice(0, maxAuthors);
|
||||
authors.push(others);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
"contributors": [
|
||||
"Gnab <as0n@gnab.fr>",
|
||||
"William Boman <william@redwill.se>",
|
||||
"Fabian Furger <mystyfly@gmail.com>"
|
||||
"Fabian Furger <mystyfly@gmail.com>",
|
||||
"Jonah Lawrence <jonah@freshidea.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
|
Loading…
Reference in a new issue