mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Apply let/const transform.
This commit is contained in:
@@ -6,7 +6,7 @@ import stringSize from './_stringSize.js';
|
||||
import stringToArray from './_stringToArray.js';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeCeil = Math.ceil;
|
||||
const nativeCeil = Math.ceil;
|
||||
|
||||
/**
|
||||
* Creates the padding for `string` based on `length`. The `chars` string
|
||||
@@ -20,11 +20,11 @@ var nativeCeil = Math.ceil;
|
||||
function createPadding(length, chars) {
|
||||
chars = chars === undefined ? ' ' : baseToString(chars);
|
||||
|
||||
var charsLength = chars.length;
|
||||
const charsLength = chars.length;
|
||||
if (charsLength < 2) {
|
||||
return charsLength ? baseRepeat(chars, length) : chars;
|
||||
}
|
||||
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||
const result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||
return hasUnicode(chars)
|
||||
? castSlice(stringToArray(result), 0, length).join('')
|
||||
: result.slice(0, length);
|
||||
|
||||
Reference in New Issue
Block a user