mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 02:50:10 +00:00
[minor] Add none mode, which doesn't change string
See nodejitsu/jitsu#101 - we need an easy way to strip all colors from output.
This commit is contained in:
parent
4a63717497
commit
50264b9238
@ -107,8 +107,10 @@ function stylize(str, style) {
|
||||
'red' : ['<span style="color:red;">', '</span>'],
|
||||
'yellow' : ['<span style="color:yellow;">', '</span>']
|
||||
};
|
||||
} else if (exports.mode == 'none') {
|
||||
return str;
|
||||
} else {
|
||||
console.log('unsupported mode, try "browser" or "console"');
|
||||
console.log('unsupported mode, try "browser", "console" or "none"');
|
||||
}
|
||||
|
||||
return styles[style][0] + str + styles[style][1];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user