I have the following situation:
interface SomeType {
a: //doesn't matter,
b: //doesn't matter,
c: //doesn't matter,
}
const someType: SomeType = //doesn't matter
Object.keys(someType).map(key => {
switch(key){
case 'some key that doesnt exist in SomeType': //how do I make typescript complain about this?
}
});
As the question in the comment asks, how do I go about this so that typescript can know that the only valid cases are a
, b
, and c
, and complain that I'm adding a case which isn't possible given SomeType
?