1 var baseRepeat = require('./_baseRepeat'),
2 isIterateeCall = require('./_isIterateeCall'),
3 toInteger = require('./toInteger'),
4 toString = require('./toString');
7 * Repeats the given string `n` times.
13 * @param {string} [string=''] The string to repeat.
14 * @param {number} [n=1] The number of times to repeat the string.
15 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16 * @returns {string} Returns the repeated string.
28 function repeat(string, n, guard) {
29 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
34 return baseRepeat(toString(string), n);
37 module.exports = repeat;