Introduces a simple fix that allows the compiler to more easily recognize that both RequiredKeys and OptionalKeys for some type A are assignable to keyof A. This fix allows, for example, to easily define a generic type that contains all required keys of another:
type RequiredPart<A extends object> = Pick<A, RequiredKeys<A>>
Before this fix, the user would have had to give a further hint to the compiler by specifying the second type parameters of Pick in the example above as an intersection between RequiredKeys<A> and keyof<A> to obtain the same effect.
Introduces a simple fix that allows the compiler to more easily recognize that both
RequiredKeys
andOptionalKeys
for some type A are assignable tokeyof A
. This fix allows, for example, to easily define a generic type that contains all required keys of another:Before this fix, the user would have had to give a further hint to the compiler by specifying the second type parameters of
Pick
in the example above as an intersection betweenRequiredKeys<A>
andkeyof<A>
to obtain the same effect.