Skip to content

Inline assertions

Compare
Choose a tag to compare
@danvk danvk released this 21 Jan 21:15
· 27 commits to master since this release

These are helpful for testing the types of parameters in callbacks, e.g.

mapObject({a: 1, b: 2}, (
  val,  // $ExpectType number
  key,  // $ExpectType "a" | "b"
  c,  // $ExpectType { a: number; b: number; }
) => '' + val);