-
Notifications
You must be signed in to change notification settings - Fork 428
Get continent code by name #133
Copy link
Copy link
Open
Labels
Description
this feature is a need i think not only on my project;
what i did :
function getCodeFromName(name: string): keyof typeof continents | boolean {
const entry = Object.entries(continents).find(([_, continentName]) => continentName === name);
return entry ? (entry[0] as keyof typeof continents) : false;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog