MCPcopy Create free account
hub / github.com/GitbookIO/gitbook / isExternal

Function isExternal

lib/utils/location.js:5–11  ·  view source on GitHub ↗
(href)

Source from the content-addressed store, hash-verified

3
4// Is the url an external url
5function isExternal(href) {
6 try {
7 return Boolean(url.parse(href).protocol) && !isDataURI(href);
8 } catch(err) {
9 return false;
10 }
11}
12
13// Is the url an iniline data-uri
14function isDataURI(href) {

Callers 2

isRelativeFunction · 0.85
toAbsoluteFunction · 0.85

Calls 1

isDataURIFunction · 0.85

Tested by

no test coverage detected