This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.

16 lines
344 B
TypeScript
Raw Normal View History

let regionNames = new Intl.DisplayNames(["en"], { type: "region" });
/**
* Returns the normalized region name
*
* @param region the region to normalize
* @returns the normalized region name
*/
export function normalizedRegionName(region: string) {
2024-10-14 11:29:00 +01:00
try {
return regionNames.of(region) || region;
} catch {
return region;
}
}