ditch old packages for native JS alternatives

This commit is contained in:
theofficialomega
2025-08-02 12:38:31 +02:00
parent 0158c80009
commit 048e663114
4 changed files with 14 additions and 13 deletions

View File

@@ -1,5 +1,8 @@
import validUrl from 'valid-url'
export function isURI(string: string) {
return validUrl.isUri(encodeURI(string))
export function isURI(string: string): boolean {
try {
new URL(string)
return true
} catch {
return false
}
}