Function: url()
url(
errorMessage?):Validator<string,string,string>
Defined in: validation/validators/index.ts:148
Validates URL format.
Parameters
errorMessage?
string
Custom error message (optional)
Returns
Validator<string, string, string>
Validator that checks URL format
Example
url()('https://example.com') // => Valid('https://example.com')
url()('not-a-url') // => Invalid(['Invalid URL'])