Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit 43cfceb

Browse files
committed
fix: fixed score calculation for usage
1 parent 4f3e453 commit 43cfceb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/score.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function calculatePackageScore(pkg, weights, includeUsage) {
1919
score += weightPercentage * pkg.score.detail.maintenance
2020
score += weightPercentage * pkg.score.detail.quality
2121
} else {
22-
if (includeUsage) {
22+
if (includeUsage && pkg.internalUsage) {
2323
score += usageWeight / weightSums * pkg.internalUsage.usage
2424
}
2525
score += popularityWeight / weightSums * pkg.score.detail.popularity

0 commit comments

Comments
 (0)