Permalink
Browse files

make sure its str

  • Loading branch information...
azer committed Aug 15, 2014
1 parent 787b640 commit 7aa20d4289b7c706787adfcff7056f7bc0349e62
Showing with 2 additions and 1 deletion.
  1. +2 −1 index.js
@@ -1,12 +1,13 @@
module.exports = leftpad;

function leftpad (str, len, ch) {
str = String(str);

var i = -1;

ch || (ch = ' ');
len = len - str.length;

str = String(str);

while (++i < len) {
str = ch + str;

0 comments on commit 7aa20d4

Please sign in to comment.