(q)
| 642 | // XXX: This one works with array (e.g. for dust.transfer) |
| 643 | // XXX: I _guess_ we could use replace this function with the `qs` module |
| 644 | makeQueryString(q) { |
| 645 | |
| 646 | const res = Object.keys(q) |
| 647 | .reduce((a, k) => { |
| 648 | if (Array.isArray(q[k])) { |
| 649 | q[k].forEach(v => { |
| 650 | a.push(k + "=" + encodeURIComponent(v)); |
| 651 | }); |
| 652 | } else if (q[k] !== undefined) { |
| 653 | a.push(k + "=" + encodeURIComponent(q[k])); |
| 654 | } |
| 655 | return a; |
| 656 | }, []) |
| 657 | .join("&"); |
| 658 | return res; |
| 659 | } |
| 660 | |
| 661 | /** |
| 662 | * Create a http request to the public API |
no outgoing calls
no test coverage detected