I want to check if a type is nullable or not, and if it has a conditional type on the value.
I tried implementing
type IsNullable<T> = T extends null ? true : false;
However, it does not seem to work
type test = IsNullable<number> // Returns false as it should
type test = IsNullable<number | null> // Returns false when it should be true
What's the proper way of checking if a type is nullable? I tried with T extends null | T and did not work either.