given this simple object: { id: 'x', value: 1 }, in TypeScript if you try to do:
type foo = {
id: string,
v: number,
};
const bar: foo = { id: 'something', v: 1111 };
// refrencing non existent key
if (bar.xyz) {
console.log('xyz');
}
you would get an error saying xyz does not exist on foo. How do you get the same result on Flowjs?
I've tried the following but flowjs isn't throwing any errors:
type foo = {|
id: string,
v: number,
|};
const bar: foo = { id: 'something', v: 1111 };
if (bar.xyz) { // no errors
console.log('xyz');
}