Skip to content

Commit

Permalink
some stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jun 15, 2022
1 parent bac1385 commit 7e1d9e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/downloads-by-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ for (let [patch, downloads] of Object.entries(core)) {

function log(kind, map) {
echo(green(`downloads for 7 days by ${ cyan(kind) } releases:`));
console.table(Object.keys(map).sort((a, b) => cmp(coerce(a), '>', coerce(b)) ? 1 : -1).reduce((memo, version) => {
const downloads = map[version];
console.table(Object.entries(map).sort(([a], [b]) => {
return cmp(coerce(a), '>', coerce(b)) ? 1 : -1;
}).reduce((memo, [version, downloads]) => {
memo[version] = { downloads, '%': `${ (downloads / total * 100).toFixed(2).padStart(5) } %` };
return memo;
}, {}));
Expand Down

0 comments on commit 7e1d9e7

Please sign in to comment.