MCPcopy Create free account
hub / github.com/ampproject/amphtml / appendPathToUrl

Function appendPathToUrl

src/url.js:634–637  ·  view source on GitHub ↗
(url, path)

Source from the content-addressed store, hash-verified

632 * @return {string}
633 */
634export function appendPathToUrl(url, path) {
635 const pathname = url.pathname.replace(/\/?$/, '/') + path.replace(/^\//, '');
636 return url.origin + pathname + url.search + url.hash;
637}

Callers 2

test-url.jsFile · 0.90

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected