Re: [whatwg/url] Convenience method to return an `Object` (#143)

In code:

```
class URLSearchParams {  
  toObject() {
    const o = {};
    for(const [k,v] of this.values()) {
        const currentValue = o[k];
        if(currentValue != null) {
           if(typeof currentValue === 'string') {
             o[k] = [currentValue, v];
           } else {
             currentValue.push(v);
           }
        } else {
            o[k] = v;
        }
    }
    return o;
  }
}
```

-- 
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/143#issuecomment-239762007

Received on Monday, 15 August 2016 09:24:19 UTC