I hope the topic is not too confusing, but I don't know how to say it better. Let's say I have an object like this in Typescript:
type TypeA = {a : number, b: number, c : {d: number, e: number}}
const ObjA = {a: 1, b: 2, c : {d : 3, e: 4}}
Now I have a second Type which is always a part of TypeA
:
type TypeB = {a: number, c: {e: number}}
how would I generate an ObjB
from ObjA
but instead of all the information in the object it should only have these from TypeB
.
Is there a quick and easy way to do that?
Thanks a lot!
Cheers