join-uris
Join together a URI path to a base.
joinURIs(base, href)
Provides a convenient way to join together URIs handling relative paths.
import joinURIs from "can-util/js/join-uris";
const base = "http://example.com/some/long/path";
const href = "../../images/foo.png";
const res = joinURIs( base, href );
console.log( res ); // -> http://example.com/images/foo.png
Parameters
- base
{String}
: - href
{String}
:
Returns
{String}
:
The result of joining the two parts.