CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
repeat.js38 linesDownload Raw Back to lodash-es
1import baseRepeat from './_baseRepeat.js';2import isIterateeCall from './_isIterateeCall.js';3import toInteger from './toInteger.js';4import toString from './toString.js';5 6/**7 * Repeats the given string `n` times.8 *9 * @static10 * @memberOf _11 * @since 3.0.012 * @category String13 * @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.17 * @example18 *19 * _.repeat('*', 3);20 * // => '***'21 *22 * _.repeat('abc', 2);23 * // => 'abcabc'24 *25 * _.repeat('abc', 0);26 * // => ''27 */28function repeat(string, n, guard) {29  if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {30    n = 1;31  } else {32    n = toInteger(n);33  }34  return baseRepeat(toString(string), n);35}36 37export default repeat;38 
basant307/AI_Governance_Project · CoolFace