mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Revert createPadding behavior for chars that coerce to empty strings.
This commit is contained in:
@@ -4628,11 +4628,10 @@
|
||||
*/
|
||||
function createPadding(length, chars) {
|
||||
chars = chars === undefined ? ' ' : (chars + '');
|
||||
chars = chars == '' ? ' ' : chars;
|
||||
|
||||
var charsLength = chars.length;
|
||||
if (charsLength == 1) {
|
||||
return baseRepeat(chars, length);
|
||||
if (charsLength < 2) {
|
||||
return charsLength ? baseRepeat(chars, length) : chars;
|
||||
}
|
||||
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||
return reHasComplexSymbol.test(chars)
|
||||
|
||||
Reference in New Issue
Block a user