helperStringRepeat.js 306 B

1234567891011
  1. var staticParseInt = require('./staticParseInt')
  2. function helperStringRepeat (str, count) {
  3. if (str.repeat) {
  4. return str.repeat(count)
  5. }
  6. var list = isNaN(count) ? [] : new Array(staticParseInt(count))
  7. return list.join(str) + (list.length > 0 ? str : '')
  8. }
  9. module.exports = helperStringRepeat