Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

char is a reserved word. closes #48. thanks @tcjr

  • Loading branch information...
commit 6d39f84a7aec37c6eb1688688e351d3f1177c6ae 1 parent 3e1e0d7
Miller Medeiros authored
Showing with 8 additions and 8 deletions.
  1. +4 −4 src/string/lpad.js
  2. +4 −4 src/string/rpad.js
8 src/string/lpad.js
View
@@ -2,11 +2,11 @@ define(['./repeat'], function (repeat) {
/**
* 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) {
- char = char || ' ';
- return (str.length < minLen)? repeat(char, minLen - str.length) + str : str;
+ function lpad(str, minLen, ch) {
+ ch = ch || ' ';
+ return (str.length < minLen)? repeat(ch, minLen - str.length) + str : str;
}
return lpad;
8 src/string/rpad.js
View
@@ -2,11 +2,11 @@ define(['./repeat'], function (repeat) {
/**
* 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) {
- char = char || ' ';
- return (str.length < minLen)? str + repeat(char, minLen - str.length) : str;
+ function rpad(str, minLen, ch) {
+ ch = ch || ' ';
+ return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str;
}
return rpad;
Please sign in to comment.
Something went wrong with that request. Please try again.