MCPcopy Index your code
hub / github.com/ampproject/amphtml / isHttpOrHttpsUrl

Function isHttpOrHttpsUrl

validator/js/nodejs/index.js:31–33  ·  view source on GitHub ↗

* Convenience function to detect whether an argument is a URL. If not, * it may be a local file. * @param {string} url * @return {boolean}

(url)

Source from the content-addressed store, hash-verified

29 * @return {boolean}
30 */
31function isHttpOrHttpsUrl(url) {
32 return hasPrefix(url, 'http://') || hasPrefix(url, 'https://');
33}
34
35/**
36 * Creates a promise which reads from a file.

Callers 2

getInstanceFunction · 0.85
mainFunction · 0.85

Calls 1

hasPrefixFunction · 0.85

Tested by

no test coverage detected