Skip to content

Commit cb791bf

Browse files
committed
Eliminated unused colors export, refactored log export for readability
1 parent 00c8e6e commit cb791bf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

utils/bump/bump-utils.mjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ const colors = {
1717
bg: '\x1b[1;92m', // bright green
1818
br: '\x1b[1;91m' // bright red
1919
}
20-
21-
const log = {}, { nc, dg, bw, by, bg, br } = colors
20+
const { nc, dg, bw, by, bg, br } = colors
2221
const lvlColors = { hash: dg, info: bw, working: by, success: bg, error: br }
23-
Object.keys(lvlColors).forEach(lvl => log[lvl] = function(msg) {
24-
const formattedMsg = lvlColors[lvl] +( log.endedWithLineBreak ? msg.trimStart() : msg ) + nc
22+
23+
export const log = {} ; Object.keys(lvlColors).forEach(lvl => log[lvl] = function(msg) {
24+
const formattedMsg = lvlColors[lvl] + (log.endedWithLineBreak ? msg.trimStart() : msg) + nc
2525
console.log(formattedMsg) ; log.endedWithLineBreak = msg.toString().endsWith('\n')
2626
})
2727

28-
export { colors, log }
29-
3028
export function bumpUserJSver(userJSfilePath) {
3129
const date = new Date(),
3230
today = `${date.getFullYear()}.${ date.getMonth() +1 }.${date.getDate()}`, // YYYY.M.D format

0 commit comments

Comments
 (0)