code: function multiUpdateInLocation(queryReplacements, location) {
    location = getLocation(location);
  
    // if a query is there, use it, otherwise parse the search string
    const currQuery = location.query || parseQueryString(location.search);
  
    const newQuery = {
      ...currQuery,
      ...queryReplacements,
    };
  
    // remove if it is nully or an empty string when encoded
    Object.keys(queryReplacements).forEach(queryParam => {
      const encodedValue = queryReplacements[queryParam];
      if (encodedValue == null || encodedValue === '') {
        delete newQuery[queryParam];
      }
    });
  
    const newLocation = mergeLocationQueryOrSearch(location, newQuery);
  
    // remove the key from the location
    delete newLocation.key;
  
    return newLocation;
  }
docs: Update multiple parts of the location at once