mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 02:05:36 +00:00
12 lines
316 B
TypeScript
12 lines
316 B
TypeScript
|
|
import {getCountryCode} from "./getCountryCode";
|
||
|
|
|
||
|
|
export const tldToEmoji = (tld: string) => {
|
||
|
|
if (tld.startsWith('xn--')) return '-'
|
||
|
|
|
||
|
|
return String.fromCodePoint(
|
||
|
|
...getCountryCode(tld)
|
||
|
|
.toUpperCase()
|
||
|
|
.split('')
|
||
|
|
.map((char) => 127397 + char.charCodeAt(0))
|
||
|
|
)
|
||
|
|
}
|