X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Fmodules%2Fesnext.string.replace-all.js;h=574c6781ce98077e97fab1a3b08860773cc2409c;hp=22220eee158f649382714f64644cd7d44d23426b;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/esnext.string.replace-all.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/esnext.string.replace-all.js index 22220eee..574c6781 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/esnext.string.replace-all.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/esnext.string.replace-all.js @@ -1,50 +1,2 @@ -'use strict'; -var $ = require('../internals/export'); -var requireObjectCoercible = require('../internals/require-object-coercible'); -var isRegExp = require('../internals/is-regexp'); -var getRegExpFlags = require('../internals/regexp-flags'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var IS_PURE = require('../internals/is-pure'); - -var REPLACE = wellKnownSymbol('replace'); -var RegExpPrototype = RegExp.prototype; - -// `String.prototype.replaceAll` method -// https://github.com/tc39/proposal-string-replace-all -$({ target: 'String', proto: true }, { - replaceAll: function replaceAll(searchValue, replaceValue) { - var O = requireObjectCoercible(this); - var IS_REG_EXP, flags, replacer, string, searchString, template, result, position, index; - if (searchValue != null) { - IS_REG_EXP = isRegExp(searchValue); - if (IS_REG_EXP) { - flags = String(requireObjectCoercible('flags' in RegExpPrototype - ? searchValue.flags - : getRegExpFlags.call(searchValue) - )); - if (!~flags.indexOf('g')) throw TypeError('`.replaceAll` does not allow non-global regexes'); - } - replacer = searchValue[REPLACE]; - if (replacer !== undefined) { - return replacer.call(searchValue, O, replaceValue); - } else if (IS_PURE && IS_REG_EXP) { - return String(O).replace(searchValue, replaceValue); - } - } - string = String(O); - searchString = String(searchValue); - if (searchString === '') return replaceAll.call(string, /(?:)/g, replaceValue); - template = string.split(searchString); - if (typeof replaceValue !== 'function') { - return template.join(String(replaceValue)); - } - result = template[0]; - position = result.length; - for (index = 1; index < template.length; index++) { - result += String(replaceValue(searchString, position, string)); - position += searchString.length + template[index].length; - result += template[index]; - } - return result; - } -}); +// TODO: Remove from `core-js@4` +require('./es.string.replace-all');