isValidUrl
Check whether a string is a parseable URL, returning a boolean so you can validate user input before building links or fetching.
Usage
isValidUrl checks whether a string is a valid URL.
import { isValidUrl } from '@movk/core'
isValidUrl('https://example.com') // true
isValidUrl('not a url') // false
isValidUrl('ftp://files.example.com') // true
API
isValidUrl(url)
Check whether a string is a valid URL.
Parameters
url
string required
The string to check.
Returns
returns
boolean
Whether the string is a valid URL.
Changelog
No recent changes