Suppose we have the following object:
o {a : 1, b : 2}
and this interface defined as:
interface MyInterface {
a : number
}
We are now looking to create a new object that represents the "intersection" of o and the MyInterface:
o2 : {a : 1}
The main objective is to send only relevant data to a REST service that expects a MyInterface object.
Is there a built-in function in Typescript to achieve this intersection?