function removeParamByKey(prefix, param = ALL, url) {
  const location = getLocation(url)
  const search = prefix + getString(url, prefix)
  const isPattern = isRegex(param)
  if (!isPattern && search.indexOf(param) === -1) {
    return url
  }
  const match = (isPattern) ? param.source : `\\b${param}\\b`
  const regex = new RegExp(`(\\&|\\${prefix})(${match})(=?[_A-Za-z0-9"+=.\\/\\-@%]+)?`, 'g')
  const cleanSearch = search.replace(regex, '').replace(/^&/, prefix)
  // replace search params with clean params
  const cleanUrl = location.href.replace(search, cleanSearch)
  if (isBrowser && !url && location.href !== cleanUrl) {
    const { history } = window
    if (!history && !history.replaceState) return
    /* replace URL with history API */
    history.replaceState({}, '', cleanUrl)
  }
  return cleanUrl
}
Removes params from url
@param {'?'|'#'} prefix - Type of location data
@param {string|RegExp} param - param key to remove from current URL