Helpers.validate_url

You're seeing just the function validate_url, go back to Helpers module for more information.

Specs

validate_url(String.t()) :: :ok | {:error, String.t()}

validate_url/1: validates field is a valid url.

Examples

iex> "https:://www.url.com"
...> |> Helpers.validate_url()
{:error, "invalid URI path"}

iex> "https://github.com/"
...> |> Helpers.validate_url()
:ok

iex> '"https://"https://www.google.com"'
...> |> Helpers.validate_url()
{:error, "invalid URI"}

iex> "zipbooks.com"
...> |> Helpers.validate_url()
{:error, "invalid URI"}

iex> "https://zipbooks..com"
...> |> Helpers.validate_url()
{:error, "invalid URI host"}