mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Remove semicolons.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import baseRepeat from './baseRepeat.js';
|
||||
import baseToString from './baseToString.js';
|
||||
import castSlice from './castSlice.js';
|
||||
import hasUnicode from './hasUnicode.js';
|
||||
import stringSize from './stringSize.js';
|
||||
import stringToArray from './stringToArray.js';
|
||||
import baseRepeat from './baseRepeat.js'
|
||||
import baseToString from './baseToString.js'
|
||||
import castSlice from './castSlice.js'
|
||||
import hasUnicode from './hasUnicode.js'
|
||||
import stringSize from './stringSize.js'
|
||||
import stringToArray from './stringToArray.js'
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
const nativeCeil = Math.ceil;
|
||||
const nativeCeil = Math.ceil
|
||||
|
||||
/**
|
||||
* Creates the padding for `string` based on `length`. The `chars` string
|
||||
@@ -18,16 +18,16 @@ const nativeCeil = Math.ceil;
|
||||
* @returns {string} Returns the padding for `string`.
|
||||
*/
|
||||
function createPadding(length, chars) {
|
||||
chars = chars === undefined ? ' ' : baseToString(chars);
|
||||
chars = chars === undefined ? ' ' : baseToString(chars)
|
||||
|
||||
const charsLength = chars.length;
|
||||
const charsLength = chars.length
|
||||
if (charsLength < 2) {
|
||||
return charsLength ? baseRepeat(chars, length) : chars;
|
||||
return charsLength ? baseRepeat(chars, length) : chars
|
||||
}
|
||||
const 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);
|
||||
: result.slice(0, length)
|
||||
}
|
||||
|
||||
export default createPadding;
|
||||
export default createPadding
|
||||
|
||||
Reference in New Issue
Block a user