fix: better commenting
This commit is contained in:
@@ -73,14 +73,18 @@ export function findLang(pathname: string) {
|
||||
)
|
||||
}
|
||||
|
||||
// Helper function to convert API's (e.g. the Hotel endpoint) capitalized values to Lang enum.
|
||||
/**
|
||||
* Helper function to convert API's (e.g. the Hotel endpoint) capitalized values to Lang enum.
|
||||
*/
|
||||
export function fromUppercaseToLangEnum(lang: string): Lang | undefined {
|
||||
const lowerCaseLang = lang.charAt(0).toLowerCase() + lang.slice(1)
|
||||
return Object.values(Lang).find((l) => l === lowerCaseLang)
|
||||
}
|
||||
|
||||
// Helper function to convert Lang enum to uppercase
|
||||
// Needed for certtain API (e.g. the Hotel endpoint).
|
||||
/**
|
||||
* Helper function to convert Lang enum to uppercase
|
||||
* Needed for certtain API (e.g. the Hotel endpoint).
|
||||
*/
|
||||
export const toUppercaseLang = (lang: Lang): string => {
|
||||
switch (lang) {
|
||||
case Lang.en:
|
||||
|
||||
Reference in New Issue
Block a user