withURIParam()function

withURIParam(uri: ImmutableURL | URLString, key: string, value: unknown, caller?: AnyCaller): ImmutableURL
withURIParam(uri: PossibleURI, key: string, value: unknown, caller?: AnyCaller): ImmutableURI
ParamType
uriImmutableURL
URLString
required
keystring
required
valueunknown
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
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 the value could not be converted to a string.

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

  • Any params with undefined value will be ignored.