jurl.core
Throughout this module, the empty string and nil are interchangeable.
Use str or seq wherever a concrete type is required.
decode
(decode string)
URL-decode `string`. Uses UTF-8 as the encoding if applicable.
encode
(encode string)
URL-encode `string`; other implementations sometimes convert '+' to '%20',
but this method does not. Uses UTF-8 as the encoding if applicable.
map->search
(map->search m)
(map->search m {:keys [separator]})
Serialize a map of name-vector tuples back into a string
(prefixed with '?' if non-empty)
search->map
(search->map search)
(search->map search {re :split})
Run search->seq then convert to a map with string keys and vector values
search->seq
(search->seq search)
Convert a query string, like that returned by window.location.search,
to a seq of key-value tuples.
| `search` input | result | description |
|:---------------|:-------|:------------|
| "" | nil | No querystring
| "?" | () | Empty querystring
| "?a=1&b=2" | (["a" "1"] ["b" "2"]) | Two normal query parameters
seq->search
(seq->search kvs)
Serialize a seq of key-value tuples back into a string