[whatwg/url] Is there a handy way to stringify with a leading '?' only if not empty? (#329)

Currently I'd have to do `sp.toString() && '?'+sp.toString()`

ideally, .toString() would behave like this: but it's too late
```js
var sp = new URLSearchParams('');
sp+'' == '' // like now

var sp = new URLSearchParams('?x');
sp+'' == '?x=' // with a leading ?

var sp = new URLSearchParams('?');
sp+'' == '' // like now
```


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

Received on Thursday, 29 June 2017 14:28:49 UTC