mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 02:50:10 +00:00
fix --no-color is not work
This commit is contained in:
parent
e9e6557cc0
commit
f6ebbfe14c
@ -48,6 +48,9 @@ colors.stripColors = colors.strip = function(str){
|
||||
|
||||
|
||||
var stylize = colors.stylize = function stylize (str, style) {
|
||||
if (!colors.enabled) {
|
||||
return str+'';
|
||||
}
|
||||
return ansiStyles[style].open + str + ansiStyles[style].close;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
var colors = require('./colors'),
|
||||
styles = require('./styles');
|
||||
var colors = require('./colors');
|
||||
|
||||
module['exports'] = function () {
|
||||
|
||||
@ -18,10 +17,6 @@ module['exports'] = function () {
|
||||
}
|
||||
};
|
||||
|
||||
var stylize = function stylize (str, style) {
|
||||
return styles[style].open + str + styles[style].close;
|
||||
}
|
||||
|
||||
addProperty('strip', function () {
|
||||
return colors.strip(this);
|
||||
});
|
||||
@ -60,7 +55,7 @@ module['exports'] = function () {
|
||||
var x = Object.keys(colors.styles);
|
||||
x.forEach(function (style) {
|
||||
addProperty(style, function () {
|
||||
return stylize(this, style);
|
||||
return colors.stylize(this, style);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user