From 77ff0d36b7c0c3929211e86a207cb2d0395a041d Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Tue, 10 Jan 2023 17:00:18 +0000 Subject: [PATCH] Refactor --- .../integration/RestQueryViewer.svelte | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/components/integration/RestQueryViewer.svelte b/packages/builder/src/components/integration/RestQueryViewer.svelte index cead197b30..2c381efa47 100644 --- a/packages/builder/src/components/integration/RestQueryViewer.svelte +++ b/packages/builder/src/components/integration/RestQueryViewer.svelte @@ -117,15 +117,13 @@ ) } - function cleanUrl(inputUrl) { - return ( - url - ?.replace(/(http)|(https)|[{}:]/g, "") - ?.replaceAll(".", "_") - ?.replaceAll("/", " ") - ?.trim() || inputUrl - ) - } + const cleanUrl = inputUrl => + url + ?.replace(/(http)|(https)|[{}:]/g, "") + ?.replaceAll(".", "_") + ?.replaceAll("/", " ") + ?.trim() || inputUrl + function checkQueryName(inputUrl = null) { if (query && (!query.name || query.flags.urlName)) { query.flags.urlName = true