Merge branch 'master' into public-dashboard

This commit is contained in:
LouisLam
2021-09-21 21:25:16 +08:00
3 changed files with 29 additions and 3 deletions

View File

@@ -64,7 +64,6 @@ export function polyfill() {
*/
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function (str: string, newStr: string) {
// If a regex pattern
if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") {
return this.replace(str, newStr);
@@ -72,7 +71,6 @@ export function polyfill() {
// If a string
return this.replace(new RegExp(str, "g"), newStr);
};
}
}