Поделиться через


CommonProperties type

Возврат свойств пересечения 2 типов

type CommonProperties<A, B> = {
  [P in keyof A & keyof B]: A[P] extends B[P] ? P : never
}[keyof A & keyof B]