If I have a link that is being changed with the function history.pushState({}, \"\", link); where my link is for example page.php?value=1&
history.pushState({}, \"\", link);
link
page.php?value=1&
If what you're trying to do is change the URL without adding an additional entry to the history object, you might try replaceState.
replaceState
history.replaceState({value: 1, value2: X}, "title", "page.php");