Function: removeQueryParam()
ts
function removeQueryParam(url, key): string;Removes a query parameter from a URL string.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | The source URL. |
key | string | The query parameter name. |
Returns
string
The updated URL string.
Example
ts
removeQueryParam('https://example.com?a=1&b=2', 'a')
// => 'https://example.com/?b=2'Since
1.0.0