(obj: any)
| 355 | * @returns string |
| 356 | */ |
| 357 | export function serializeParams(obj: any) { |
| 358 | let result: any = []; |
| 359 | forEach(obj, (val: any, key: any) => { |
| 360 | if (val === null || val === undefined || val === '') { |
| 361 | return; |
| 362 | } |
| 363 | if (typeof val === 'object') { |
| 364 | result.push(`${key}=${encodeURIComponent(JSON.stringify(val))}`); |
| 365 | } else { |
| 366 | result.push(`${key}=${encodeURIComponent(val)}`); |
| 367 | } |
| 368 | }); |
| 369 | return result.join('&'); |
| 370 | } |
no test coverage detected
searching dependent graphs…