MCPcopy
hub / github.com/ampproject/amphtml / removeSearch

Function removeSearch

src/url.js:444–451  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

442 * @return {string}
443 */
444export function removeSearch(url) {
445 const index = url.indexOf('?');
446 if (index == -1) {
447 return url;
448 }
449 const fragment = getFragment(url);
450 return url.substring(0, index) + fragment;
451}
452
453/**
454 * Removes parameters that start with amp js parameter pattern and returns the

Callers 3

test-url.jsFile · 0.90

Calls 1

getFragmentFunction · 0.85

Tested by

no test coverage detected