mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +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))
|
|
)
|
|
} |