Say the database returned an object e.g
foo: {bar: 1, baz: 2, quux: 3}
Then I have this interface that only allows the keys:
bar: number;
quux: number;
I want the object foo
to transform itself to only have the key/values that the interface allows and get rid of the rest of the key/values. How can I achieve this?