Re: [whatwg/url] new URLSearchParams(entries) (#256)

ah nice, I was doing that too
```
function QS(data) {
 if (typeof data=='string') {
  return /^\w+:\/\//.test(data) ? new URL(data).searchParams : new URLSearchParams(data);
 }
 var qs = new URLSearchParams();
 for (var i in data) { // null and undefined are filtered
  if (typeof data[i] == 'string' || typeof data[i] == 'number') {
   qs.append(i, data[i]);
  } else if (Array.isArray(data[i])) {
   data[i].forEach(v => qs.append(i, v));
  }
 }
 return 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/256#issuecomment-281523548

Received on Wednesday, 22 February 2017 00:04:48 UTC