From 837ff8df9f54e7c30e8bd1c4479880a2d24ed8bd Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Thu, 26 May 2016 00:54:02 +0200 Subject: [PATCH] strip ansi under production --- lib/Default.coffee | 5 +++-- package.json | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Default.coffee b/lib/Default.coffee index b1a0486..bde3c3e 100644 --- a/lib/Default.coffee +++ b/lib/Default.coffee @@ -3,6 +3,7 @@ humanizeMs = require 'ms' chalk = require 'chalk' formatUtil = require './Format' +stripAnsi = require 'strip-ansi' CONST = require './Constants' repeat = require 'repeat-string' @@ -91,7 +92,7 @@ module.exports = this colorizeMessage: (type, message) -> - return message if not @color or CONST.ENV is 'production' + return stripAnsi message if not @color or CONST.ENV is 'production' lineColor = CONST.LINE_COLOR typeColor = @types[type].color @@ -107,7 +108,7 @@ module.exports = ).join(' ') colorize: (colors, message) -> - return message if not @color or CONST.ENV is 'production' + return stripAnsi message if not @color or CONST.ENV is 'production' colors = colors.split ' ' stylize = chalk stylize = stylize[color] for color in colors diff --git a/package.json b/package.json index a5a0a62..c149116 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,11 @@ "coffee-script": "~1.10.0", "lodash.defaults": "~4.0.1", "ms": "~0.7.1", - "repeat-string": "~1.5.4" + "repeat-string": "~1.5.4", + "strip-ansi": "~3.0.1" }, "devDependencies": { - "acho-skin-cli": "~1.0.0", + "acho-skin-cli": "latest", "browserify": "latest", "coffeeify": "latest", "date-utils": "latest",