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:
5
assets/utils/functions/getCountryCode.tsx
Normal file
5
assets/utils/functions/getCountryCode.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user