TypeScript type narrowing

Narrowing types in TS, a quick tour