Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ampproject/amphtml
/ isProtocolValid
Function
isProtocolValid
src/url.js:424–426 ·
view source on GitHub ↗
(url)
Source
from the content-addressed store, hash-verified
422
* @
return
{boolean}
423
*/
424
export
function
isProtocolValid(url) {
425
return
!(url && INVALID_PROTOCOLS.includes(urlAsLocation(url).protocol));
426
}
427
428
/**
429
* Returns a URL without AMP JS parameters.
Callers
1
testProtocolValid
Function · 0.90
Calls
1
urlAsLocation
Function · 0.85
Tested by
no test coverage detected