aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/es.string.replace-all.js
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2020-12-22 17:50:12 +0530
committerPriyansh <[email protected]>2020-12-22 17:50:12 +0530
commit22dc033f4938d6a19e086a1cbd36ec5cade5eaab (patch)
tree9feb963ccd5c1581e676e41004801abc67db3357 /node_modules/core-js/modules/es.string.replace-all.js
parente93da8b04da86773247aadb1cbb1912e4f4526b2 (diff)
downloadstyx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.tar.xz
styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.zip
Remove node_modules
Diffstat (limited to 'node_modules/core-js/modules/es.string.replace-all.js')
-rw-r--r--node_modules/core-js/modules/es.string.replace-all.js50
1 files changed, 0 insertions, 50 deletions
diff --git a/node_modules/core-js/modules/es.string.replace-all.js b/node_modules/core-js/modules/es.string.replace-all.js
deleted file mode 100644
index 22220ee..0000000
--- a/node_modules/core-js/modules/es.string.replace-all.js
+++ /dev/null
@@ -1,50 +0,0 @@
-'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;
- }
-});