MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getProtocol

Function getProtocol

src/utils/Url.js:262–264  ·  view source on GitHub ↗

* Returns protocol of a url e.g. 'ftp:' from 'ftp://localhost/foo/bar' * @param {string} url * @returns {"ftp:"|"sftp:"|"http:"|"https:"}

(url)

Source from the content-addressed store, hash-verified

260 * @returns {"ftp:"|"sftp:"|"http:"|"https:"}
261 */
262 getProtocol(url) {
263 return (/^([a-z]+:)\/\/\/?/i.exec(url) || [])[1] || "";
264 },
265 /**
266 *
267 * @param {string} url

Callers

nothing calls this directly

Calls 1

execMethod · 0.65

Tested by

no test coverage detected