CommonProperties type
Return intersect properties of 2 types
type CommonProperties<A, B> = {
[P in keyof A & keyof B]: A[P] extends B[P] ? P : never
}[keyof A & keyof B]
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Return intersect properties of 2 types
type CommonProperties<A, B> = {
[P in keyof A & keyof B]: A[P] extends B[P] ? P : never
}[keyof A & keyof B]