I have an interface:
interface User {
name: string,
age: number
}
function:
function test(user: User): void {
}
and empty object created with the interface:
const user1 = <User>{};
test(user1);
So I don't understand why my code is compiling, because my empty object hasn't the interface keys. How can I prevent compiling if my object is empty and hasn't the interface keys?