(input, isOpaque = false)
| 3856 | return output; |
| 3857 | } |
| 3858 | function parseHost(input, isOpaque = false) { |
| 3859 | if (input[0] === "[") { |
| 3860 | if (input[input.length - 1] !== "]") { |
| 3861 | return failure; |
| 3862 | } |
| 3863 | return parseIPv6(input.substring(1, input.length - 1)); |
| 3864 | } |
| 3865 | if (isOpaque) { |
| 3866 | return parseOpaqueHost(input); |
| 3867 | } |
| 3868 | const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); |
| 3869 | const asciiDomain = domainToASCII(domain); |
| 3870 | if (asciiDomain === failure) { |
| 3871 | return failure; |
| 3872 | } |
| 3873 | if (endsInANumber(asciiDomain)) { |
| 3874 | return parseIPv4(asciiDomain); |
| 3875 | } |
| 3876 | return asciiDomain; |
| 3877 | } |
| 3878 | function endsInANumber(input) { |
| 3879 | const parts = input.split("."); |
| 3880 | if (parts[parts.length - 1] === "") { |
no test coverage detected
searching dependent graphs…