Skip to content

Commit

Permalink
char is a reserved word. closes #48. thanks @tcjr
Browse files Browse the repository at this point in the history
  • Loading branch information
millermedeiros committed May 3, 2012
1 parent 3e1e0d7 commit 6d39f84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/string/lpad.js
Expand Up @@ -2,11 +2,11 @@ define(['./repeat'], function (repeat) {


/** /**
* Pad string with `char` if its' length is smaller than `minLen` * Pad string with `char` if its' length is smaller than `minLen`
* @version 0.1.0 (2011/12/07) * @version 0.1.1 (2012/05/03)
*/ */
function lpad(str, minLen, char) { function lpad(str, minLen, ch) {
char = char || ' '; ch = ch || ' ';
return (str.length < minLen)? repeat(char, minLen - str.length) + str : str; return (str.length < minLen)? repeat(ch, minLen - str.length) + str : str;
} }


return lpad; return lpad;
Expand Down
8 changes: 4 additions & 4 deletions src/string/rpad.js
Expand Up @@ -2,11 +2,11 @@ define(['./repeat'], function (repeat) {


/** /**
* Pad string with `char` if its' length is smaller than `minLen` * Pad string with `char` if its' length is smaller than `minLen`
* @version 0.1.0 (2011/12/07) * @version 0.1.1 (2012/05/03)
*/ */
function rpad(str, minLen, char) { function rpad(str, minLen, ch) {
char = char || ' '; ch = ch || ' ';
return (str.length < minLen)? str + repeat(char, minLen - str.length) : str; return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str;
} }


return rpad; return rpad;
Expand Down

0 comments on commit 6d39f84

Please sign in to comment.