mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 13:22:11 +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) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
Loading…
Reference in a new issue