mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Remove isIterateeCall.
This commit is contained in:
10
repeat.js
10
repeat.js
@@ -1,5 +1,4 @@
|
||||
import baseRepeat from './.internal/baseRepeat.js'
|
||||
import isIterateeCall from './.internal/isIterateeCall.js'
|
||||
import toInteger from './toInteger.js'
|
||||
import toString from './toString.js'
|
||||
|
||||
@@ -10,7 +9,6 @@ import toString from './toString.js'
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to repeat.
|
||||
* @param {number} [n=1] The number of times to repeat the string.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
|
||||
* @returns {string} Returns the repeated string.
|
||||
* @example
|
||||
*
|
||||
@@ -23,12 +21,8 @@ import toString from './toString.js'
|
||||
* repeat('abc', 0)
|
||||
* // => ''
|
||||
*/
|
||||
function repeat(string, n, guard) {
|
||||
if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
|
||||
n = 1
|
||||
} else {
|
||||
n = toInteger(n)
|
||||
}
|
||||
function repeat(string, n) {
|
||||
n = toInteger(n)
|
||||
return baseRepeat(toString(string), n)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user