| 252 | // XXX: This one works with array (e.g. for dust.transfer) |
| 253 | // XXX: I _guess_ we could use replace this function with the `qs` module |
| 254 | const makeQueryString = q => |
| 255 | Object.keys(q) |
| 256 | .reduce((a, k) => { |
| 257 | if (Array.isArray(q[k])) { |
| 258 | q[k].forEach(v => { |
| 259 | a.push(k + "=" + encodeURIComponent(v)) |
| 260 | }) |
| 261 | } else if (q[k] !== undefined) { |
| 262 | a.push(k + "=" + encodeURIComponent(q[k])); |
| 263 | } |
| 264 | return a; |
| 265 | }, []) |
| 266 | .join("&"); |
| 267 | |
| 268 | /** |
| 269 | * Create a http request to the public API |
no outgoing calls
no test coverage detected