From 5a6bf84af6908f1a2f42099a62e4ddaa6086b479 Mon Sep 17 00:00:00 2001 From: spiral Date: Thu, 14 Jul 2022 19:46:50 +0200 Subject: [PATCH] feat(dashboard): add polyfill for String.prototype.replaceAll --- dashboard/package.json | 1 + dashboard/src/main.ts | 5 +++++ dashboard/yarn.lock | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/dashboard/package.json b/dashboard/package.json index 6ca8e164..22beaa00 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -25,6 +25,7 @@ "axios": "^0.24.0", "bootstrap": "^5.1.3", "bootstrap-dark-5": "^1.1.3", + "core-js-pure": "^3.23.4", "discord-markdown": "^2.5.1", "gh-pages": "^3.2.3", "import": "^0.0.6", diff --git a/dashboard/src/main.ts b/dashboard/src/main.ts index 50de4ff5..43d69f2c 100644 --- a/dashboard/src/main.ts +++ b/dashboard/src/main.ts @@ -1,6 +1,11 @@ import * as Sentry from "@sentry/browser"; import { Integrations } from "@sentry/tracing"; +// polyfill for replaceAll +import * as replaceAll from 'core-js-pure/es/string/virtual/replace-all.js'; +if (!String.prototype.replaceAll) + String.prototype.replaceAll = replaceAll; + Sentry.init({ dsn: "https://58109fec589f4c2bbfa190329acf679a@sentry.pluralkit.me/4", integrations: [new Integrations.BrowserTracing()], diff --git a/dashboard/yarn.lock b/dashboard/yarn.lock index 8a520a0d..48fbfbd6 100644 --- a/dashboard/yarn.lock +++ b/dashboard/yarn.lock @@ -315,6 +315,11 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +core-js-pure@^3.23.4: + version "3.23.4" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.23.4.tgz#aba5c7fb297063444f6bf93afb0362151679a012" + integrity sha512-lizxkcgj3XDmi7TUBFe+bQ1vNpD5E4t76BrBWI3HdUxdw/Mq1VF4CkiHzIKyieECKtcODK2asJttoofEeUKICQ== + csstype@^3.0.2: version "3.0.10" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5"