function compressParams(search) {
  search = Object.assign({}, search)
  Object.keys(search).forEach((key) => {
    const val = search[key]
    if (isUndefined(val)) {
      delete search[key]
    } else if (val && typeof val === 'object' && val !== null) {
      try {
        search[key] = stringify(val)
      } catch (err) {}
    }
  })
  const searchStr = encode(search).toString()
  return searchStr ? `?${searchStr}` : ''
}
Compress search params object to string
@param {object} search 
@returns {string}