I'm working with an interface that looks like this
interface Cat {
color: string,
weight: number,
cute: Boolean, // even though all cats are cute!
}
Currently, I need to accomplish something similar to this
const kitten: Cat = ...
Object.keys(kitten).some(prop => ['weight', 'color'].includes(prop)
Is there a method to ensure that the strings provided in the array
(['weight', 'color']
) are part of the interface
Cat
?