[whatwg/url] Convenience method for serializing (#142)

It'd be great to have a simple static method to go from key-value data to a formatted string in a single step:

```
// the idiomatic way to express kv data in JS
type dict = { [key: string]: string };

class URLSearchParams {
  static toQueryString(params: URLSearchParams | dict): string;
}
```

This'd allow for idiomatic composition with other core JS APIs, matching the pleasant developer experience that people expect:

```
// creating
const queries = [{ k1: "v1"}, { k1: "v2" }]
const results = queries
  .map(URLSearchParams.toQueryString)
  .map(qs => fetch(someUrl + "?" + qs))
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/142

Received on Friday, 12 August 2016 13:54:31 UTC