UNPKG

400 BJavaScriptView Raw
1'use strict';
2var isPrototypeOf = require('../../internals/object-is-prototype-of');
3var method = require('../string/virtual/starts-with');
4
5var StringPrototype = String.prototype;
6
7module.exports = function (it) {
8 var own = it.startsWith;
9 return typeof it == 'string' || it === StringPrototype
10 || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.startsWith) ? method : own;
11};