getURIParams()function

getURIParams(params: PossibleURIParams, caller: AnyCaller = getURIParams): URIParams
ParamType
paramsPossibleURIParams
Possible URI params to convert. required
callerAnyCaller
Function to attribute a thrown error to (defaults to getURIParams itself). Defaults to getURIParams
Return
URIParams
Dictionary of string params keyed by name.
Throws
RequiredError
If params is a string or URL that cannot be converted to a valid URI.
ValueError
If any param value cannot be converted to a string.

Get a set of params for a URI as a dictionary.

  • Any params with undefined value will be ignored.

Examples

getURIParams("http://x.com?a=1&b=2") // { a: "1", b: "2" }