We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98fb2ca commit ba41784Copy full SHA for ba41784
punycode.js
@@ -70,13 +70,13 @@ function map(array, fn) {
70
* function.
71
*/
72
function mapDomain(string, fn) {
73
- const parts = string.split('@');
+ const atPos = string.lastIndexOf('@');
74
let result = '';
75
- if (parts.length > 1) {
+ if (atPos > -1) {
76
// In email addresses, only the domain name should be punycoded. Leave
77
// the local part (i.e. everything up to `@`) intact.
78
- result = parts[0] + '@';
79
- string = parts[1];
+ result = string.substring(0, atPos + 1);
+ string = string.substring(atPos + 1);
80
}
81
// Avoid `split(regex)` for IE8 compatibility. See #17.
82
string = string.replace(regexSeparators, '\x2E');
0 commit comments