Skip to content

Commit

Permalink
use ?? operator
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Nov 28, 2023
1 parent 7068bc9 commit 6c41d1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/downloads-by-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ for (let [patch, downloads] of Object.entries(core)) {
const version = coerce(patch);
const { major } = version;
const minor = `${ major }.${ version.minor }`;
if (ALL) downloads += (pure[patch] || 0) + (bundle[patch] || 0);
if (ALL) downloads += (pure[patch] ?? 0) + (bundle[patch] ?? 0);
downloadsByPatch[patch] = downloads;
downloadsByMinor[minor] = (downloadsByMinor[minor] || 0) + downloads;
downloadsByMajor[major] = (downloadsByMajor[major] || 0) + downloads;
downloadsByMinor[minor] = (downloadsByMinor[minor] ?? 0) + downloads;
downloadsByMajor[major] = (downloadsByMajor[major] ?? 0) + downloads;
total += downloads;
}

Expand Down

0 comments on commit 6c41d1d

Please sign in to comment.