repeat.js 349 B

12345678910111213141516
  1. var toValueString = require('./toValueString')
  2. var helperStringRepeat = require('./helperStringRepeat')
  3. /**
  4. * 将字符串重复 n 次
  5. *
  6. * @param {String} str 字符串
  7. * @param {Number} count 次数
  8. * @return {String}
  9. */
  10. function repeat (str, count) {
  11. return helperStringRepeat(toValueString(str), count)
  12. }
  13. module.exports = repeat