/** * Check if a type is a union, and return true if so, otherwise false. */ export type IsUnion = U extends any ? ([T] extends [U] ? false : true) : never; /** * Extracts an inner type if T has a single key K, otherwise it returns T. */ export type ExtractSingleKey> = IsUnion extends true ? T : T[KWithoutTypename];