Is there a way to force an error in TypeScript if an object passed into a function contains a property that doesn’t exist on the set interface?
interface ITest {
id: number
name: string
}
const testFunc = (data: ITest) => {
console.log(data)
}
const test = {id: 1, name: 'hello', test: ''}
testFunc(test) // is there a way to get this to throw an error to say that test does not belong to ITest?