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