Share your code.
Opinionated URL validator.
- Does not support raw domains like
github.com, though I wish there was a smart way to do so
- Defaults protocol-less URLs like
//github.com/to HTTPs like
- Domains will always have trailing slashes
- Encode components
var url = validate(url)
var validate =var url =// => ''
If the url is invalid, then
url will be