function paramsClean(prefix, search, param) {
  const isPattern = isRegex(param)
  if (!isPattern && search.indexOf(param) === -1) {
    return url
  }
  // remove all matching params from URL
  const match = (isPattern) ? param.source : `\\b${param}\\b`
  const regex = new RegExp(`(\\&|\\${prefix})(${match})(=?[_A-Za-z0-9"+=.\\/\\-@%]+)?`, 'g')
  // console.log('regex', regex)
  const cleanSearch = search.replace(regex, '').replace(/^&/, prefix)
  // replace search params with clean params
  return url.replace(search, cleanSearch)
}
Strip a query parameter from a url string
@param  {string} url   - url with query parameters
@param  {string} param - parameter to strip
@return {string} cleaned url