You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
306 B

2 years ago
var repeat = require('./repeat');
var toStr = require('./toStr');
exports = function(str, len, chars) {
str = toStr(str);
var strLen = str.length;
chars = chars || ' ';
if (strLen < len) str = (str + repeat(chars, len - strLen)).slice(0, len);
return str;
};
module.exports = exports;