repeat.js 289 B

123456789
  1. var repeat = require('../string/virtual/repeat');
  2. var StringPrototype = String.prototype;
  3. module.exports = function (it) {
  4. var own = it.repeat;
  5. return typeof it === 'string' || it === StringPrototype
  6. || (it instanceof String && own === StringPrototype.repeat) ? repeat : own;
  7. };