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

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

- Page: https://pluginprobe.com/plugins/leadin/11.1.13/code/scripts/utils/queryParams.ts
- Raw: https://pluginprobe.com/plugins/leadin/11.1.13/raw/scripts/utils/queryParams.ts
- Modified: 2024-05-23T13:10:40+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.1.13/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);
}

```
