DrainOuterGeneric: [T] extends [unknown] ? T : never

Functionally, this type helper is equivalent to the identity type — i.e. type Identity<T> = T. However, wrapping generic object mappings in this type significantly reduces the number of instantiation expressions processed, which increases TypeScript performance and prevents "Type instantiation is excessively deep and possibly infinite" errors.

This works because TypeScript doesn't create a new level of nesting when encountering conditional generic types.

Type Parameters

  • T