* @param {string} urlString * @returns {string}
(urlString)
| 924 | * @returns {string} |
| 925 | */ |
| 926 | function getProtocolFromUrlString (urlString) { |
| 927 | if ( |
| 928 | urlString[0] === 'h' && |
| 929 | urlString[1] === 't' && |
| 930 | urlString[2] === 't' && |
| 931 | urlString[3] === 'p' |
| 932 | ) { |
| 933 | switch (urlString[4]) { |
| 934 | case ':': |
| 935 | return 'http:' |
| 936 | case 's': |
| 937 | if (urlString[5] === ':') { |
| 938 | return 'https:' |
| 939 | } |
| 940 | } |
| 941 | } |
| 942 | // fallback if none of the usual suspects |
| 943 | return urlString.slice(0, urlString.indexOf(':') + 1) |
| 944 | } |
| 945 | |
| 946 | const kEnumerableProperty = { |
| 947 | __proto__: null, |
no outgoing calls
no test coverage detected
searching dependent graphs…