Say I have an object with an indeterminate set of key-value pairs and an Interface that has a specific set of key-type pairs.
Is there an operation I can invoke that will get all key-value pairs from the object that match a key in the Interface?
i.e.
const foo = {a: 1, b:2, c:3, d: 4}
interface Bar {
a: number;
d: number;
}
const res = // is there an operation I can perform that will make this equal {a:1, d:4}