MCPcopy Create free account
hub / github.com/ampproject/amphtml / hasPrefix

Function hasPrefix

validator/js/nodejs/index.js:21–23  ·  view source on GitHub ↗

* Determines if str begins with prefix. * @param {string} str * @param {string} prefix * @return {boolean}

(str, prefix)

Source from the content-addressed store, hash-verified

19 * @return {boolean}
20 */
21function hasPrefix(str, prefix) {
22 return str.indexOf(prefix) == 0;
23}
24
25/**
26 * Convenience function to detect whether an argument is a URL. If not,

Callers 2

isHttpOrHttpsUrlFunction · 0.85
readFromUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected