domain-watchdog/assets/utils/functions/getCountryCode.tsx

6 lines
219 B
TypeScript
Raw Normal View History

2024-08-22 01:44:50 +02:00
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()
2024-12-30 23:50:15 +01:00
}