From 99614e760f887b12a2de606cdb09a445cf3013ac Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 17 Feb 2015 15:24:13 +0700 Subject: [PATCH] ternarify --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index 511e2d7..4138a64 100644 --- a/index.js +++ b/index.js @@ -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