massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / es / instance / ends-with.js
index 532d6f7ea313004904bd3117c588fcdb4bd92c8c..58e8225050a71758b778c2a94054f48de1667017 100644 (file)
@@ -1,9 +1,10 @@
-var endsWith = require('../string/virtual/ends-with');
+var isPrototypeOf = require('../../internals/object-is-prototype-of');
+var method = require('../string/virtual/ends-with');
 
 var StringPrototype = String.prototype;
 
 module.exports = function (it) {
   var own = it.endsWith;
-  return typeof it === 'string' || it === StringPrototype
-    || (it instanceof String && own === StringPrototype.endsWith) ? endsWith : own;
+  return typeof it == 'string' || it === StringPrototype
+    || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.endsWith) ? method : own;
 };