TypeScript Union type a deeper look