Skip to content

Commit

Permalink
Added support for uppercase labels. Fixes #16
Browse files Browse the repository at this point in the history
  • Loading branch information
klaudiosinani committed May 24, 2018
1 parent 8372dbd commit ad92362
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"underlineLabel": true,
"underlineMessage": false,
"underlinePrefix": false,
"underlineSuffix": false
"underlineSuffix": false,
"uppercaseLabel": false
}
},
"xo": {
Expand Down
5 changes: 3 additions & 2 deletions signale.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ class Signale {
}

if (this._config.displayLabel && type.label) {
const label = this._config.uppercaseLabel ? type.label.toUpperCase() : type.label;
if (this._config.underlineLabel) {
signale.push(chalk[type.color].underline(type.label).padEnd(this._longestLabel + 20));
signale.push(chalk[type.color].underline(label).padEnd(this._longestLabel + 20));
} else {
signale.push(chalk[type.color](type.label.padEnd(this._longestLabel + 1)));
signale.push(chalk[type.color](label.padEnd(this._longestLabel + 1)));
}
}

Expand Down

0 comments on commit ad92362

Please sign in to comment.