1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | /**
|
4 | * String.prototype.replaceAll() polyfill
|
5 | * https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/
|
6 | * @author Chris Ferdinandi
|
7 | * @license MIT
|
8 | */
|
9 | if (!String.prototype.replaceAll) {
|
10 | String.prototype.replaceAll = function (str, newStr) {
|
11 | // If a regex pattern
|
12 | if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") {
|
13 | return this.replace(str, newStr);
|
14 | }
|
15 | // If a string
|
16 | return this.replace(new RegExp(str, "g"), newStr);
|
17 | };
|
18 | }
|
19 | //# sourceMappingURL=_dnt.polyfills.js.map |
\ | No newline at end of file |