[whatwg/url] Consider adding a constructor to make a URL from parts (#354)

I'd love to have an api to make an API from parts of an url, like you can do when calling a node `http.request`. Something like: 


```js
const url = new URL({
  protocol: 'http:',
  hostname: 'example.com'
});
```

Would be very helpful to allow people getting for example just the `hash` from there, or making conditional URLs without needing to concatenate strings (and accidentally adding a `/` too little or too many). 

Hope that makes sense!

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

Received on Monday, 27 November 2017 14:22:51 UTC