12345678910111213141516171819202122232425262728293031323334353637 |
- var baseRepeat = require('./_baseRepeat'),
- isIterateeCall = require('./_isIterateeCall'),
- toInteger = require('./toInteger'),
- toString = require('./toString');
- function repeat(string, n, guard) {
- if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- return baseRepeat(toString(string), n);
- }
- module.exports = repeat;
|