domain-watchdog/assets/utils/functions/getCountryCode.tsx
2024-12-30 23:50:15 +01:00

6 lines
219 B
TypeScript

export const getCountryCode = (tld: string): string => {
const exceptions = {uk: 'gb', su: 'ru', tp: 'tl'}
if (tld in exceptions) return exceptions[tld as keyof typeof exceptions]
return tld.toUpperCase()
}