[whatwg/url] Splicing URLSearchParams? (#183)

Is there an official proposed way of doing this? So far, I'm doing this:
```js
const url = new URL("http://domain?var=1&var=2&var=3");
const params = Array.from(url.searchParams);

// There is no `.clear()`
for (let param of url.searchParams) {
  url.searchParams.delete( param[0] );
}

params.forEach( function(param) {
  if (someFilter(param)) {
    url.searchParams.append( param[0], param[1] );
  }
});
```

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

Received on Wednesday, 28 December 2016 03:48:36 UTC