Bump to v4.7.0.

This commit is contained in:
John-David Dalton
2016-03-26 00:00:36 -07:00
parent a83b4ebd53
commit ce0b51888c
394 changed files with 1789 additions and 841 deletions

View File

@@ -1,4 +1,6 @@
import createPadding from './_createPadding';
import stringSize from './_stringSize';
import toInteger from './toInteger';
import toString from './toString';
/**
@@ -7,6 +9,7 @@ import toString from './toString';
*
* @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 @@ import toString from './toString';
*/
function padStart(string, length, chars) {
string = toString(string);
return createPadding(string, length, chars) + string;
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (createPadding(length - strLength, chars) + string)
: string;
}
export default padStart;