Bump to v4.7.0.

This commit is contained in:
John-David Dalton
2016-03-25 23:47:49 -07:00
parent 501d6b1d41
commit 18d0f1d873
419 changed files with 4042 additions and 2066 deletions

View File

@@ -1,4 +1,6 @@
var createPadding = require('./_createPadding'),
stringSize = require('./_stringSize'),
toInteger = require('./toInteger'),
toString = require('./toString');
/**
@@ -7,6 +9,7 @@ var createPadding = require('./_createPadding'),
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
@@ -25,7 +28,12 @@ var createPadding = require('./_createPadding'),
*/
function padEnd(string, length, chars) {
string = toString(string);
return string + createPadding(string, length, chars);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (string + createPadding(length - strLength, chars))
: string;
}
module.exports = padEnd;