X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;ds=sidebyside;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Fmodules%2Fes.string.ends-with.js;h=9133e8649694066ce74f6cc2a1072ceebe79a164;hb=3be0a9efc698a9570a44456009afc6014812625a;hp=74d6a278e014e357422fe3e4dff978c125161f8d;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.ends-with.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.ends-with.js index 74d6a278..9133e864 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.ends-with.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.ends-with.js @@ -1,13 +1,17 @@ 'use strict'; var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var IS_PURE = require('../internals/is-pure'); -var nativeEndsWith = ''.endsWith; +// eslint-disable-next-line es/no-string-prototype-endswith -- safe +var un$EndsWith = uncurryThis(''.endsWith); +var slice = uncurryThis(''.slice); var min = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); @@ -21,14 +25,14 @@ var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { // https://tc39.es/ecma262/#sec-string.prototype.endswith $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = String(requireObjectCoercible(this)); + var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); + var len = that.length; var end = endPosition === undefined ? len : min(toLength(endPosition), len); - var search = String(searchString); - return nativeEndsWith - ? nativeEndsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; + var search = toString(searchString); + return un$EndsWith + ? un$EndsWith(that, search, end) + : slice(that, end - search.length, end) === search; } });