mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-23 00:06:15 -04:00
chore(lint): switched to a better lint config
This commit is contained in:
parent
4d2b037dbe
commit
33c9b6643f
178 changed files with 4105 additions and 3371 deletions
|
@ -18,13 +18,17 @@ const typeToLabel: Record<NonNullable<NumberType>, string> = {
|
|||
};
|
||||
|
||||
function formatTypeToHumanReadable(type: NumberType): string | undefined {
|
||||
if (!type) return undefined;
|
||||
if (!type) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return typeToLabel[type];
|
||||
}
|
||||
|
||||
function getFullCountryName(countryCode: string | undefined) {
|
||||
if (!countryCode) return undefined;
|
||||
if (!countryCode) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return lookup.byIso(countryCode)?.country;
|
||||
}
|
||||
|
@ -35,7 +39,9 @@ function getDefaultCountryCode({
|
|||
}: { locale?: string; defaultCode?: CountryCode } = {}): CountryCode {
|
||||
const countryCode = locale.split('-')[1]?.toUpperCase();
|
||||
|
||||
if (!countryCode) return defaultCode;
|
||||
if (!countryCode) {
|
||||
return defaultCode;
|
||||
}
|
||||
|
||||
return (lookup.byIso(countryCode)?.iso2 ?? defaultCode) as CountryCode;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue