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