diff --git a/lib/Default.coffee b/lib/Default.coffee index 23878b4..b1a0486 100644 --- a/lib/Default.coffee +++ b/lib/Default.coffee @@ -4,6 +4,7 @@ humanizeMs = require 'ms' chalk = require 'chalk' formatUtil = require './Format' CONST = require './Constants' +repeat = require 'repeat-string' module.exports = print: -> @@ -13,7 +14,7 @@ module.exports = decorateCounter: (counter) -> str = '' + counter n = CONST.DECORATE_COUNTER_ZERO_N - str.length - return '0'.repeat(n) + str if n > 0 + return repeat('0', n) + str if n > 0 str outputMessage: (message) -> message diff --git a/package.json b/package.json index 08c3e82..caa7dd2 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "chalk": "~1.1.1", "coffee-script": "~1.10.0", "existential-default": "~1.1.1", - "ms": "~0.7.1" + "ms": "~0.7.1", + "repeat-string": "~1.5.4" }, "devDependencies": { "browserify": "latest",