Function
constructUrlWithParams
(url: string, params?: ParamObject)
Source from the content-addressed store, hash-verified
| 167 | }; |
| 168 | |
| 169 | function constructUrlWithParams(url: string, params?: ParamObject) { |
| 170 | if (params) { |
| 171 | const paramList = []; |
| 172 | for (const key in params) { |
| 173 | paramList.push(`${key}=${encodeURIComponent(params[key])}`); |
| 174 | } |
| 175 | if (paramList.length) { |
| 176 | url += `?${paramList.join('&')}`; |
| 177 | } |
| 178 | } |
| 179 | return url; |
| 180 | } |
| 181 | |
| 182 | async function constructRequestHeaders(headerConfig: HeaderConfig) { |
| 183 | const { token, headers } = headerConfig; |
Tested by
no test coverage detected