In the following code I want type A
to be true
, and not the union of both:
type isFalseAndNotAny<T> = T extends false ? 'false' : 'true';
// how do I get here only `true`?
type A = isFalseAndNotAny<any>;
// that's OK we get only `false`
type B = isFalseAndNotAny<false>;
Is there any way in Typescript to do something similar like in Javascript we use the triple equality ===
operator?