I would like to write a type-safe utility function for comparison of properties of 2 given objects in Typescript 4.0. My initial attempt is as following: