Skip to content

Commit

Permalink
fix: try-catch url parsing (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber authored Nov 6, 2024
1 parent 0aa28df commit 8166c5c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 8166c5c

Please sign in to comment.