How do you prevent distribution over union types in a conditional type?

TypeScript Associate Hard

TypeScript Associate — Hard

How do you prevent distribution over union types in a conditional type?

Key points

  • Wrapping the type parameter in a tuple prevents distribution over union types
  • The correct syntax is

Ready to go further?

Related questions