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

There could be many return values that would satisfy the condition that the constructor be an inverse, and each has its use.  For example, a relative URL from https://example.com/full/ to https://example.com/full/path/resource could return a string in the form //example.com/full/path/resource, and such relative URLs are commonly used when the scheme of the base is important but everything else must be specified.  It could also return /full/path/resource if the full path is important, ../full/path/resource if the relative structure is important, or path/resource if only that part of the structure is important.  Many applications will want the shortest version, but some applications will want to specify which form they want.  This ambiguity would require a complicated API and specification, and I agree that if someone wants a particular form of this functionality they should write their own library.

-- 
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#issuecomment-445916341

Received on Monday, 10 December 2018 18:16:14 UTC