From fbd4287c8cf403ec6174a31b20ebffb41a256d1f Mon Sep 17 00:00:00 2001 From: Pedro Guerreiro Date: Mon, 4 Dec 2023 16:29:39 +0000 Subject: [PATCH] refactor(typescript): apply pull request feedback --- src/components/IFrame.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/IFrame.tsx b/src/components/IFrame.tsx index c8de672da800..7520ad869507 100644 --- a/src/components/IFrame.tsx +++ b/src/components/IFrame.tsx @@ -9,14 +9,12 @@ type OldDotIFrameOnyxProps = { type OldDotIFrameProps = OldDotIFrameOnyxProps; -type Url = string | URL; - -function getNewDotURL(url: Url): string { +function getNewDotURL(url: string): string { const urlObj = new URL(url); const paramString = urlObj.searchParams.get('param') ?? ''; const pathname = urlObj.pathname.slice(1); - let params; + let params: Record; try { params = JSON.parse(paramString); } catch { @@ -55,7 +53,7 @@ function getNewDotURL(url: Url): string { return pathname; } -function getOldDotURL(url: Url): string { +function getOldDotURL(url: string): string { const urlObj = new URL(url); const pathname = urlObj.pathname; const paths = pathname.slice(1).split('/');