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;
}