From bba4264298923f1d54f02955ff99296265378524 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Thu, 7 Nov 2024 06:59:16 +0900 Subject: [PATCH] fix: try-catch url parsing --- src/utils.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 581d916..bfa6e44 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -4,7 +4,12 @@ export function normalizeUrl(url: string | undefined): string | undefined { if (!url) return undefined - return _normalizeUrl(url, { - defaultProtocol: 'https', - }) + try { + return _normalizeUrl(url, { + defaultProtocol: 'https', + }) + } + catch { + return url + } }