Created
March 31, 2024 09:26
-
-
Save afrieirham/f017d8d7155799f1db33051f7ccac904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const isValidUrl = (url: string) => { | |
try { | |
new URL(url); | |
return true; | |
} catch { | |
return false; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment