export const schedules = [
{ unit: "hour", quantity: 6 },
{ unit: "day", quantity: 1 },
] as const;
const getOffsetName = (schedule: (typeof schedules)[number]) =>
`${schedule.quantity}_${schedule.unit}`
Why is the return type of getOffsetName "6_hour" | "6_day" | "1_hour" | "1_day"
instead of "6_hour" | "1_day"
?
Is there any way to make typescript more specific in this case?