Packages
A web application in pursuit of meaning in life.
Retired package: Complete rewrite, scratch old versions
Current section
Files
Jump to
Current section
Files
assets/node_modules/mout/src/string/rpad.js
define(['../lang/toString', './repeat'], function (toString, repeat) {
/**
* Pad string with `char` if its' length is smaller than `minLen`
*/
function rpad(str, minLen, ch) {
str = toString(str);
ch = ch || ' ';
return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str;
}
return rpad;
});