fix(SW-188): more semantic name for tolang transformer function

This commit is contained in:
Chuma McPhoy
2024-08-14 10:01:04 +02:00
parent 400c0b48e4
commit 96d3f68ad3
2 changed files with 5 additions and 6 deletions
+2 -3
View File
@@ -28,10 +28,9 @@ const toApiLangMap: { [key in Lang]: string } = {
}
/**
* Helper function to convert langs in uppercase or capitalized format (e.g. the Hotel endpoint)
* to to Lang enum.
* Helper function to convert lang string to Lang enum.
*/
export function fromUppercaseToLangEnum(lang: string): Lang | undefined {
export function toLang(lang: string): Lang | undefined {
const lowerCaseLang = lang.toLowerCase()
return Object.values(Lang).find((l) => l === lowerCaseLang)
}