fix(SW-188): improve semantics, use hotel instead of attribute naming
This commit is contained in:
@@ -26,3 +26,12 @@ const toApiLangMap: { [key in Lang]: string } = {
|
||||
[Lang.da]: "Da",
|
||||
[Lang.de]: "De",
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to convert langs in uppercase or capitalized format (e.g. the Hotel endpoint)
|
||||
* to to Lang enum.
|
||||
*/
|
||||
export function fromUppercaseToLangEnum(lang: string): Lang | undefined {
|
||||
const lowerCaseLang = lang.toLowerCase()
|
||||
return Object.values(Lang).find((l) => l === lowerCaseLang)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user