[whatwg/url] URL.relative proposal (#421)

As Node.js has moved to embrace the URL spec over the legacy url API, there is still an API gap for handling relative URLs as discussed in https://github.com/nodejs/node/issues/616.

To follow on from that discussion, and discussion in the Node.js tooling group, it would be worth seeing if a proposal for a `URL.relative` might be considered here.

The API might look something like the following:

```js
URL.relative(fromURL: URL | string, toURL: URL | string) -> string
```

where it returns the relative url with fragment string of toURL from fromURL, such that `new URL(result, fromURL)` would be the inverse operation.

Node.js certainly can go its own way here too, but we thought it would just be good to find out first if WhatWG would consider something along these lines.

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

Received on Friday, 7 December 2018 14:55:04 UTC