5ee4a0c3001baf036753c206f9cd3b383dee2ad0ac65c0bbc4d9d25de65e518bf1f34b3c409527ed233ce9e4ff4416fc50df09d5a9e68bfa3f7050a18126e0 637 B

123456789101112131415
  1. 'use strict';
  2. var isPrototypeOf = require('../../internals/object-is-prototype-of');
  3. var arrayMethod = require('../array/virtual/includes');
  4. var stringMethod = require('../string/virtual/includes');
  5. var ArrayPrototype = Array.prototype;
  6. var StringPrototype = String.prototype;
  7. module.exports = function (it) {
  8. var own = it.includes;
  9. if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.includes)) return arrayMethod;
  10. if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.includes)) {
  11. return stringMethod;
  12. } return own;
  13. };