mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
refactor: move functions
This commit is contained in:
12
assets/utils/functions/tldToEmoji.tsx
Normal file
12
assets/utils/functions/tldToEmoji.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
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))
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user