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

Function assertAbsoluteHttpOrHttpsUrl

src/url.js:339–346  ·  view source on GitHub ↗
(urlString)

Source from the content-addressed store, hash-verified

337 * @return {string}
338 */
339export function assertAbsoluteHttpOrHttpsUrl(urlString) {
340 userAssert(
341 /^https?\:/i.test(urlString),
342 'URL must start with "http://" or "https://". Invalid value: %s',
343 urlString
344 );
345 return parseUrlDeprecated(urlString).href;
346}
347
348/**
349 * Returns the URL without fragment. If URL doesn't contain fragment, the same

Callers 7

test-url.jsFile · 0.90
postbackOrRedirect_Method · 0.90
buildCallbackMethod · 0.90
getVideoIframeSrc_Method · 0.90
handleClickMethod · 0.90
getVideoIframeSrc_Method · 0.90

Calls 3

userAssertFunction · 0.90
parseUrlDeprecatedFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected