Consider the below code; its clear the TS is inferring the T generic from Array<{key: T}> and the return value of (input: Record
T
Array<{key: T}>
(input: Record