diff --git a/src/universal/utils/common.ts b/src/universal/utils/common.ts index 6604b04..bc5d00e 100644 --- a/src/universal/utils/common.ts +++ b/src/universal/utils/common.ts @@ -1,4 +1,12 @@ -export const isUrl = (url: string): boolean => (/^https?:\/\//.test(url)) +export const isUrl = (url: string): boolean => { + try { + new URL(url) + return true + } catch { + return false + } +} + export const isUrlEncode = (url: string): boolean => { url = url || '' try {