tooling
tooling copied to clipboard
url.relative
Would this fall under the considerations of this group?
See https://github.com/nodejs/node/issues/616#issuecomment-438221181.
relateurl. URL-compatible version is in the repo and has been in the works for a while ~~at 99% completion. Should be finishing it in a few weeks~~. It's "done" now and will be released soon.
As discussed at the meeting - it might be nice to start by seeing if progress can be made on the WhatWG side of things here.
So perhaps we can come up with something we think might work for Node and propose it to WhatWG in an issue there?
I will start with a complete and utter strawman:
URL.relative(fromURL: URL | string, toURL: URL | string) -> string
Returns the relative url with fragment string of toURL from fromURL such that new URL(result, fromURL) would be the reverse operation.
//cc @nex3 who brought this one up in the first place!
If that sounds sensible... let's see what WhatWG think, as it seems like it wouldn't be "unuseful" in browsers.
I've created a WhatWG proposal issue at https://github.com/whatwg/url/issues/421.