Files
web/apps/scandic-web/services/warmup/warmupKeys.ts
Joakim Jäderberg 196ea2994f Merged in fix/warmup-autocomplete-data (pull request #2212)
warmup autocomplete data

* warmup autocomplete data


Approved-by: Anton Gunnarsson
2025-05-26 08:23:20 +00:00

22 lines
652 B
TypeScript

import { Lang } from "@/constants/languages"
const langs = Object.keys(Lang) as Lang[]
/*
* Keys for warmup functions, the order of the keys is the order in which they will be executed
*/
export const warmupKeys = [
...langs.map((lang) => `countries_${lang}` as const),
"hotelsByCountry",
...langs.map((lang) => `hotelData_${lang}` as const),
...langs.map((lang) => `autoComplete_${lang}` as const),
] as const
export type WarmupFunctionsKey = (typeof warmupKeys)[number]
export function isWarmupKey(key: unknown): key is WarmupFunctionsKey {
return (
typeof key === "string" && warmupKeys.includes(key as WarmupFunctionsKey)
)
}