ternarify

This commit is contained in:
Sindre Sorhus 2015-02-17 15:24:13 +07:00
parent eb7a5db36a
commit 99614e760f

View file

@ -8,11 +8,7 @@ var defineProps = Object.defineProperties;
function Chalk(options) {
// detect mode if not set manually
if (!options || options.enabled === undefined) {
this.enabled = supportsColor;
} else {
this.enabled = options.enabled;
}
this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
}
// use bright blue on Windows as the normal blue color is illegible