Remove isIterateeCall.

This commit is contained in:
John-David Dalton
2017-03-03 23:32:24 -08:00
parent ba52c744ae
commit 17f7069d07
11 changed files with 11 additions and 93 deletions

View File

@@ -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)
}