Skip to content

Instantly share code, notes, and snippets.

@NicolaeNMV
Last active August 29, 2015 14:15
Show Gist options
  • Save NicolaeNMV/efc9c1c4a0bff1c5782d to your computer and use it in GitHub Desktop.
Save NicolaeNMV/efc9c1c4a0bff1c5782d to your computer and use it in GitHub Desktop.
Flow type VS Typescript at detecting non existing JSON elements
/* @flow */
var a = {
"a":"a",
"b":"b"
}
var res = a.c;
// $ flow simple.js
// $ No errors!
// $ tsc simple.ts
// $ simple.ts(7,13): error TS2339: Property 'c' does not exist on type '{ "a": string; "b": string; }'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment