export const Qs = {
  stringify(jsonData = {}) {
    return Object.keys(jsonData)
      .map((x) => `${encodeURIComponent(x)}=${encodeURIComponent(jsonData[x])}`)
      .join('&')
  },
  parse(url) {
    const params = url.split('?')[1] || url
    const obj = {}
    params.split('&').forEach((item) => {
      const [key, value] = item.split('=')
      obj[key] = value
    })
    return obj
  }
}
