[whatwg/url] Proposal of .toString({ concise: true }) for nicer output with empty values (#469)

Consider the following example:
```js
const p = new URLSearchParams([['a', ''], ['b', 'non-empty', ['c', '']]);
p.toString();
```

It will output:
`a=&b=non-empty&c=`


I propose we introduce
```js
.toString({ concise: true });
```

That would output a pretty and concise query string without unnecessary `=`:
`a&b=non-empty&c`

Note that based on https://url.spec.whatwg.org/#urlencoded-parsing both outputs are semantically equalivent


-- 
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/469

Received on Wednesday, 18 March 2020 11:07:39 UTC