Conditional helper: exactly N true values.
true
Tuple of boolean conditions
Exact number of true values required
Result if the condition matches
Result otherwise
Resolves to Then if the tuple contains exactly N occurrences of true, otherwise Else.
Then
N
Else
type A = IfExactly< [ true, false, true ], 2, 'yes', 'no' >; // 'yes'type B = IfExactly< [ true, true ], 1, 'yes', 'no' >; // 'no' Copy
type A = IfExactly< [ true, false, true ], 2, 'yes', 'no' >; // 'yes'type B = IfExactly< [ true, true ], 1, 'yes', 'no' >; // 'no'
Conditional helper: exactly N
truevalues.