Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
#32: Replace colors.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nbarikipoulos committed Jul 10, 2022
1 parent f1e9bef commit e2d84d3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
21 changes: 9 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -31,7 +31,7 @@
],
"dependencies": {
"axios": "^0.24.0",
"colors": "1.4.0",
"colorette": "^2.0.19",
"jimp": "^0.16.1",
"mustache": "^4.0.1",
"pkg": "^5.5.2",
Expand Down
15 changes: 10 additions & 5 deletions util/validate.js
@@ -1,6 +1,11 @@
'use strict'

const colors = require('colors')
const {
bgGreen: bgOK,
bgRed: bgKO,
bgYellow: bgWarning,
bgBlue: bgInfo
} = require('colorette')

class ValidationMsg {
constructor (level, message) {
Expand Down Expand Up @@ -97,10 +102,10 @@ const _prettify = (errMsg, showDetails = true) => {
let result = ''

switch (errMsg.level) {
case 'ok': result += colors.green.inverse('OK'); break
case 'info': result += colors.blue.inverse('INFO'); break
case 'warning': result += colors.yellow.inverse('WARNING'); break
case 'error': result += colors.red.inverse('ERROR'); break
case 'ok': result += bgOK('OK'); break
case 'info': result += bgInfo('INFO'); break
case 'warning': result += bgWarning('WARNING'); break
case 'error': result += bgKO('ERROR'); break
default: /* Do nothing */
}

Expand Down

0 comments on commit e2d84d3

Please sign in to comment.