This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
|
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('.');
|
|
};
|