sporto/erl/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Erl

Library for parsing and constructing URLs

Definition

type alias Url =
{ host : Host
, fragment : List String
, password : String
, path : List String
, port_ : Int
, protocol : String
, query : Dict String String
, username : String
}

Url record that holds url attributes

Common Helpers

extractFragment : String -> String

Extract the fragment (hash) from the url

extractHost : String -> String

Extract the host from the url

extractPath : String -> String

Extract the path from the url

extractProtocol : String -> String

Extract the protocol from the url

extractPort : String -> Int

Extract the port from the url

extractQuery : String -> String

Extract the query string from the url

parse : String -> Url

Parse a Url an return a Erl.Url record

parse "http://api.example.com/users/1#x/1?a=1" == Erl.Url{...}