You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import punycode from 'punycode';
|
|
|
|
const IDNA_PREFIX = 'xn--';
|
|
|
|
export const decode = domain => {
|
|
return domain
|
|
.split('.')
|
|
.map(part => part.indexOf(IDNA_PREFIX) === 0 ? punycode.decode(part.slice(IDNA_PREFIX.length)) : part)
|
|
.join('.');
|
|
};
|
|
|