diff --git a/lib/formatter.js b/lib/formatter.js index e6e2726..04719e5 100644 --- a/lib/formatter.js +++ b/lib/formatter.js @@ -13,6 +13,7 @@ var formatter = (function () { function repeat(s, count) { + count = count < 0 ? 0 : count; return new Array(count + 1).join(s); } @@ -89,4 +90,4 @@ var formatter = (function () { if (typeof require !== 'undefined' && typeof exports !== 'undefined') { exports.formatter = formatter; -} \ No newline at end of file +}