getURIParams()function
getURIParams(params: PossibleURIParams, caller: AnyCaller = getURIParams): URIParams
| Param | Type | |
|---|---|---|
params | PossibleURIParams | Possible URI params to convert. required |
caller | AnyCaller | 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
undefinedvalue will be ignored.
Examples
getURIParams("http://x.com?a=1&b=2") // { a: "1", b: "2" }