Skip to content

Commit

Permalink
Data propagator updated
Browse files Browse the repository at this point in the history
  • Loading branch information
darsan-in committed Jul 11, 2024
1 parent 5ed0415 commit 5a3a4aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion action/fetch-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ function getOverallDownloadCounts(ghMetas) {
var overallDownloadCounts = 0;
ghMetas.forEach(function (meta) {
var _a;
overallDownloadCounts += (_a = meta.downloadCount) !== null && _a !== void 0 ? _a : 0;
var downloadCount = (_a = meta.downloadCount) !== null && _a !== void 0 ? _a : 0;
if (!!downloadCount) {
overallDownloadCounts += downloadCount;
}
});
return overallDownloadCounts;
}
Expand Down
6 changes: 5 additions & 1 deletion action/fetch-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,11 @@ function getOverallDownloadCounts(ghMetas: GithubRepoMeta[]): number {
let overallDownloadCounts: number = 0;

ghMetas.forEach((meta) => {
overallDownloadCounts += meta.downloadCount ?? 0;
const downloadCount: number = meta.downloadCount ?? 0;

if (!!downloadCount) {
overallDownloadCounts += downloadCount;
}
});

return overallDownloadCounts;
Expand Down

0 comments on commit 5a3a4aa

Please sign in to comment.