TypeScript Cheatsheet
- Official cheatsheet https://www.typescriptlang.org/cheatsheets
Type Guard
Tell the compiler a variable's is verified to be a specific type
function isHiringEvent(s: object): s is HiringEvent {
return s.eventType === 'hiring';
}