Get the relative path to url from baseUrl, only if url is a subpath to baseUrl.
url
baseUrl
Example:
const url = new URL('http://a.com/basePath/images/cover.jpg');const baseUrl = new URL('http://a.com/basePath/');const subpath = URLUtils.getSubpath(url, baseUrl);// subpath is: 'images/cover.jpg' Copy
const url = new URL('http://a.com/basePath/images/cover.jpg');const baseUrl = new URL('http://a.com/basePath/');const subpath = URLUtils.getSubpath(url, baseUrl);// subpath is: 'images/cover.jpg'
Get the relative path to
urlfrombaseUrl, only if url is a subpath to baseUrl.Example: