(domain, beStrict = false)
| 3933 | return host; |
| 3934 | } |
| 3935 | function domainToASCII(domain, beStrict = false) { |
| 3936 | const result = tr46.toASCII(domain, { |
| 3937 | checkHyphens: beStrict, |
| 3938 | checkBidi: true, |
| 3939 | checkJoiners: true, |
| 3940 | useSTD3ASCIIRules: beStrict, |
| 3941 | transitionalProcessing: false, |
| 3942 | verifyDNSLength: beStrict, |
| 3943 | ignoreInvalidPunycode: false |
| 3944 | }); |
| 3945 | if (result === null) { |
| 3946 | return failure; |
| 3947 | } |
| 3948 | if (!beStrict) { |
| 3949 | if (result === "") { |
| 3950 | return failure; |
| 3951 | } |
| 3952 | if (containsForbiddenDomainCodePoint(result)) { |
| 3953 | return failure; |
| 3954 | } |
| 3955 | } |
| 3956 | return result; |
| 3957 | } |
| 3958 | function trimControlChars(string) { |
| 3959 | let start = 0; |
| 3960 | let end = string.length; |
no test coverage detected