Skip to content

Commit fe142b0

Browse files
Merge pull request #1060 from anshumanv/ref/comp
chore(compiler): refactor emoji rendering logic in compiler
2 parents 7236e52 + d213809 commit fe142b0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/utils/compiler.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@ const fs = require('fs');
33
const chalk = require('chalk');
44
const Table = require('cli-table3');
55

6-
function showEmojiConditionally(emoji) {
7-
if (process.stdout.isTTY && process.platform === 'darwin') {
8-
return emoji;
9-
} else {
10-
return '';
11-
}
6+
function showEmojiConditionally() {
7+
return (process.stdout.isTTY && process.platform === 'darwin')
128
}
139

1410
function generateOutput(outputOptions, stats, statsErrors) {
1511
const statsObj = stats.toJson(outputOptions);
1612
const { assets, entrypoints, time, builtAt, warnings, outputPath } = statsObj;
1713

18-
const emojies = ['✅', '🌏', '⚒️ ', '⏱ ', '📂'];
19-
const visibleEmojies = emojies.map(e => showEmojiConditionally(e));
14+
const visibleEmojies = showEmojiConditionally() ? ['✅', '🌏', '⚒️ ', '⏱ ', '📂']: new Array(5).fill('');
2015

2116
process.stdout.write('\n');
2217
process.stdout.write(`${visibleEmojies[0]} ${chalk.underline.bold('Compilation Results')}\n`);

0 commit comments

Comments
 (0)