(params: any)
| 21 | |
| 22 | /** this function will parse an object into query string params */ |
| 23 | export const qs = (params: any) => { |
| 24 | return Object.entries(params) |
| 25 | .filter(([key, value]) => !!key && !!value) |
| 26 | .map( |
| 27 | ([key, value]) => |
| 28 | `${key}=${encodeURIComponent( |
| 29 | (Array.isArray(value) ? value.join() : value) as string |
| 30 | )}` |
| 31 | ) |
| 32 | .join('&'); |
| 33 | }; |
| 34 | |
| 35 | export function cleanUpUrl(reqUrl?: string) { |
| 36 | if (!reqUrl) return; |
no test coverage detected