diff --git a/src/04-advanced-props/31-as-const.solution.ts b/src/04-advanced-props/31-as-const.solution.ts index 1dfcd79..92507b2 100644 --- a/src/04-advanced-props/31-as-const.solution.ts +++ b/src/04-advanced-props/31-as-const.solution.ts @@ -6,10 +6,12 @@ const BACKEND_TO_FRONTEND_STATUS_MAP = { 2: "error", } as const; -type BackendStatus = keyof typeof BACKEND_TO_FRONTEND_STATUS_MAP; -type FrontendStatus = (typeof BACKEND_TO_FRONTEND_STATUS_MAP)[BackendStatus]; +type BackendStatusMap = typeof BACKEND_TO_FRONTEND_STATUS_MAP; + +type BackendStatus = keyof BackendStatusMap; +type FrontendStatus = BackendStatusMap[BackendStatus]; type test = [ Expect>, - Expect>, + Expect> ];