Ian Yates
Member since May 15, 2017
- Profile: /members/13513-ian-yates.htm
- Comments: 2
Recent Blog Comments By Ian Yates
-
Inverse Type Guards Work In TypeScript
Posted on May 15, 2017 at 8:30 AM
Good post. I use this sort of thing with union types quite frequently. A contrived example const myFunc = (p1: number | number[]) => { if (!_.isArray(p1)) { //here p1 must be number because of type definition for _ being similar to // function isArray(x: T | T[]) : x is Array<T&g... read more »