# leadin/11.0.54/scripts/utils/queryParams.ts

HubSpot All-In-One Marketing – Forms, Popups, Live Chat, version 11.0.54. 15 lines.

- Page: https://pluginprobe.com/plugins/leadin/11.0.54/code/scripts/utils/queryParams.ts
- Raw: https://pluginprobe.com/plugins/leadin/11.0.54/raw/scripts/utils/queryParams.ts
- Modified: 2024-04-12T13:24:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/leadin/11.0.54/code/scripts/utils/queryParams.ts#L10-L20`.

```typescript
export function addQueryObjectToUrl(
  urlObject: URL,
  queryParams: { [key: string]: any }
) {
  Object.keys(queryParams).forEach(key => {
    urlObject.searchParams.append(key, queryParams[key]);
  });
}

export function removeQueryParamFromLocation(key: string) {
  const location = new URL(window.location.href);
  location.searchParams.delete(key);
  window.history.replaceState(null, '', location.href);
}

```
