mirror of
https://github.com/iptv-org/iptv
synced 2025-12-17 02:47:33 -05:00
ditch old packages for native JS alternatives
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user