MCPcopy Create free account
hub / github.com/webpack/stylus-loader / getURLType

Function getURLType

src/utils.js:1005–1019  ·  view source on GitHub ↗

* @param {string} source source * @returns {"absolute" | "scheme-relative" | "path-absolute" | "path-relative"} a type of URL

(source)

Source from the content-addressed store, hash-verified

1003 * @returns {"absolute" | "scheme-relative" | "path-absolute" | "path-relative"} a type of URL
1004 */
1005function getURLType(source) {
1006 if (source[0] === "/") {
1007 if (source[1] === "/") {
1008 return "scheme-relative";
1009 }
1010
1011 return "path-absolute";
1012 }
1013
1014 if (IS_NATIVE_WIN32_PATH.test(source)) {
1015 return "path-absolute";
1016 }
1017
1018 return ABSOLUTE_SCHEME.test(source) ? "absolute" : "path-relative";
1019}
1020
1021/**
1022 * @param {RawSourceMap} map source map

Callers 1

normalizeSourceMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…