fix(SW-188): improve semantics, use hotel instead of attribute naming
This commit is contained in:
@@ -5,12 +5,3 @@ export function findLang(pathname: string) {
|
||||
(l) => pathname.startsWith(`/${l}/`) || pathname === `/${l}`
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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