Skip to content

Commit

Permalink
Refactor prettifySize (#883)
Browse files Browse the repository at this point in the history
Untangles if/else in favor of returns.
  • Loading branch information
Glinkis authored and devongovett committed Feb 24, 2018
1 parent 69f7c6d commit f897bf7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/utils/bundleReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,9 @@ function* iterateBundles(bundle) {
function prettifySize(size, isLarge) {
let res = filesize(size);
if (isLarge) {
res = logger.chalk.yellow(emoji.warning + ' ' + res);
} else {
res = logger.chalk.magenta(res);
return logger.chalk.yellow(emoji.warning + ' ' + res);
}

return res;
return logger.chalk.magenta(res);
}

function formatFilename(filename, color = logger.chalk.reset) {
Expand Down

0 comments on commit f897bf7

Please sign in to comment.