Skip to content

Commit

Permalink
fix(npm): allow undefined downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Jan 17, 2019
1 parent 080788a commit a0d9c5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export async function getDownloads(pkgs) {
: 0;
const downloadsRatio = (downloadsLast30Days / totalNpmDownloads) * 100;
const popular = downloadsRatio > c.popularDownloadsRatio;
const downloadsMagnitude = downloadsLast30Days.toString().length;
const downloadsMagnitude = downloadsLast30Days
? downloadsLast30Days.toString().length
: 0;

return {
downloadsLast30Days,
Expand Down

0 comments on commit a0d9c5a

Please sign in to comment.