withURIParams()function

withURIParams(uri: ImmutableURL | URLString, params: Nullish<PossibleURIParams>, caller?: AnyCaller): ImmutableURL
withURIParams(uri: PossibleURI, params: Nullish<PossibleURIParams>, caller?: AnyCaller): ImmutableURI
ParamType
uriImmutableURL
URLString
required
paramsNullish<PossibleURIParams>
A set of possible URI params.
- If params is null or undefined the same input URL will be returned. required
callerAnyCaller
Any calling function or constructor, usually referring to something that can call in the current scope that can appear in a stack trace.
uriPossibleURI
Values that can be converted to an ImmutableURI instance. required
paramsNullish<PossibleURIParams>
Nullish is the value or null or undefined. required
Return
ImmutableURL
Object that describes a valid URL, e.g. example.com/path/to/resource
ImmutableURI
Object that describes a valid URI, e.g. or example.com/path/to/resource
Throws
unknown
ValueError if any of the values could not be converted to strings.

Return a URI with several new params set (or same URI if no changes were made).

  • Any params with undefined value will be ignored.