diff --git a/lib/extendStringPrototype.js b/lib/extendStringPrototype.js index b6b5b031..bb9d2619 100644 --- a/lib/extendStringPrototype.js +++ b/lib/extendStringPrototype.js @@ -18,10 +18,14 @@ module['exports'] = function () { } }; - var stylize = function stylize (str, style) { - return styles[style].open + str + styles[style].close; - } + var stylize = function stylize (str, style) { return str.valueOf(); }; + if (colors.enabled) { + stylize = function stylize (str, style) { + return styles[style].open + str + styles[style].close; + } + } + addProperty('strip', function () { return colors.strip(this); }); @@ -115,4 +119,4 @@ module['exports'] = function () { } }; -}; \ No newline at end of file +};