diff --git a/lib/index.js b/lib/index.js index 353fcf8..70cf452 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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); } diff --git a/package.json b/package.json index 0efe318..869527c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "contributors": [ "Gnab ", "William Boman ", - "Fabian Furger " + "Fabian Furger ", + "Jonah Lawrence " ], "license": "MIT", "repository": {