Skip to content

Commit 57f4088

Browse files
committed
Merge branch 'fix-top-contributors' of github.com:DenverCoderOne/git-stats into new-version
2 parents d8ef0ad + 89f05df commit 57f4088

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,15 +560,16 @@ class GitStats {
560560
;
561561

562562
self.authors(options, function (err, authors) {
563+
const maxAuthors = 2 * options.radius;
563564
if (err) { return callback(err); }
564-
if (authors.length > 50) {
565+
if (authors.length > maxAuthors) {
565566
let others = {
566-
value: authors.slice(50).reduce(function (a, b) {
567+
value: authors.slice(maxAuthors).reduce(function (a, b) {
567568
return a + b.value;
568569
}, 0)
569570
, label: "Others"
570571
};
571-
authors = authors.slice(0, 50);
572+
authors = authors.slice(0, maxAuthors);
572573
authors.push(others);
573574
}
574575

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"contributors": [
1515
1616
"William Boman <[email protected]>",
17-
"Fabian Furger <[email protected]>"
17+
"Fabian Furger <[email protected]>",
18+
"Jonah Lawrence <[email protected]>"
1819
],
1920
"license": "MIT",
2021
"repository": {

0 commit comments

Comments
 (0)