Try Install Learn Blog API Packages GitHub
Pages

SearchParams

Module for manipulating search parameters.

Functions

append
(
key
:
String
value
:
String
params
:
SearchParams
)
:
SearchParams

Appends a specified key/value pair as a new search parameter.

delete
(
key
:
String
params
:
SearchParams
)
:
SearchParams

Deletes the given search parameter, and its associated value, from the list of all search parameters.

empty
:
SearchParams

Returns an empty search parameters object.

fromString
(
value
:
String
)
:
SearchParams

Parses a string into a search parameters object.

get
(
key
:
String
params
:
SearchParams
)
:
Maybe(String)

Returns the first value associated to the given search parameter.

has
(
key
:
String
params
:
SearchParams
)
:
Bool

Returns a Bool indicating if such a search parameter exists.

set
(
key
:
String
value
:
String
params
:
SearchParams
)
:
SearchParams

Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.

toString
(
params
:
SearchParams
)
:
String

Returns a string containing a query string suitable for use in a URL.