The absolute base identifier
The reference to relativize
A relative reference from base to reference, or the normalized absolute reference if not relativizable
RangeError If base is not a valid absolute identifier or reference is not a valid
relative reference, for instance because it carries an isolated UTF-16 surrogate or opens with //
Creates a relative reference from base to reference.
base, yieldsreferenceapp:/…,file:///…): Returns the root-relative pathThe returned reference always resolves back to
referenceunder RFC 3986 § 5 and under any conforming URL parser: a first segment carrying a colon is prefixed with a./dot segment so it cannot read as a scheme, and where an empty first segment would read as an authority the absolute reference is returned instead. Callers may therefore resolve the result againstbasewithout further escaping.