From d25c3c1919326de0ec6915ba8e96038563fc02a3 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Tue, 24 Aug 2021 08:51:38 +0200 Subject: [PATCH] replace 'replaceAll' with 'replace' and a regular expression --- .../src/components/design/AppPreview/CurrentItemPreview.svelte | 2 +- .../src/components/design/NavigationPanel/NewScreenModal.svelte | 2 +- .../design/PropertiesPanel/ScreenSettingsSection.svelte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte index 607061013d..38441d4323 100644 --- a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte @@ -58,7 +58,7 @@ // By deleting all _rev properties we can avoid this and increase // performance. $: json = JSON.stringify(previewData) - $: strippedJson = json.replaceAll(/"_rev":\s*"[^"]+"/g, `"_rev":""`) + $: strippedJson = json.replace(/"_rev":\s*"[^"]+"/g, `"_rev":""`) // Update the iframe with the builder info to render the correct preview const refreshContent = message => { diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index fb6b1c5ffa..ed0c764956 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -84,7 +84,7 @@ if (!event.detail.startsWith("/")) { route = "/" + event.detail } - route = route.replaceAll(" ", "-") + route = route.replace(/ +/g, "-") } diff --git a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte index cfe225e0f6..d782d1cd44 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte @@ -37,7 +37,7 @@ key: "routing.route", label: "Route", control: Input, - parser: val => val.replaceAll(" ", "-"), + parser: val => val.replace(/ +/g, "-"), }, { key: "routing.roleId", label: "Access", control: RoleSelect }, { key: "layoutId", label: "Layout", control: LayoutSelect },