Current Path : /storage/v11800/leadideascloud/public_html/wp-content/plugins/leadin/scripts/utils/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/leadideascloud/public_html/wp-content/plugins/leadin/scripts/utils/queryParams.ts |
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);
}