mirror of https://github.com/iptv-org/iptv
ditch old packages for native JS alternatives
parent
756c9b2c96
commit
26a600cb76
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue