MCPcopy
hub / github.com/webpack/webpack / getProtocol

Function getProtocol

lib/util/URLAbsoluteSpecifier.js:81–84  ·  view source on GitHub ↗

* Returns protocol if absolute URL specifier provided. * @param {string} specifier specifier * @returns {string | null | undefined} protocol if absolute URL specifier provided

(specifier)

Source from the content-addressed store, hash-verified

79 * @returns {string | null | undefined} protocol if absolute URL specifier provided
80 */
81function getProtocol(specifier) {
82 const scheme = getScheme(specifier);
83 return scheme === undefined ? undefined : `${scheme}:`;
84}
85
86module.exports.getProtocol = getProtocol;
87module.exports.getScheme = getScheme;

Calls 1

getSchemeFunction · 0.85

Tested by

no test coverage detected