From 5a3a4aab7cc7747ce532be9d5042474814f6c58f Mon Sep 17 00:00:00 2001 From: PRIYADARSAN S Date: Fri, 12 Jul 2024 04:32:01 +0530 Subject: [PATCH] Data propagator updated --- action/fetch-data.js | 5 ++++- action/fetch-data.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/action/fetch-data.js b/action/fetch-data.js index 22c3784..ad3c7dc 100644 --- a/action/fetch-data.js +++ b/action/fetch-data.js @@ -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; } diff --git a/action/fetch-data.ts b/action/fetch-data.ts index 3937b54..5947e12 100644 --- a/action/fetch-data.ts +++ b/action/fetch-data.ts @@ -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;