shinnoske0727
9/14/2019 - 7:15 AM

queryString

type Params = {
  [key: string]: string
}

const queryString = (params: Params) =>
  Object.keys(params)
    .map(key => encodeURIComponent(key) + '=' + encodeURIComponent(params[key]))
    .join('&')