isNotNull TypeScript automatic type Narrowing
Hey guys! I'm having some trouble with the typing of my DB.
Basically I have this select that gets reservations from my DB. The reserveTotal is nullable, but I added in the where the condition isNotNull to it. The problem is that typescript is not recognizing that the reservationTotal is not null and I'm being forced to make a type assertion:
Is there a way to do this without using type assertion? If not, is there a better way to do this?
Basically I have this select that gets reservations from my DB. The reserveTotal is nullable, but I added in the where the condition isNotNull to it. The problem is that typescript is not recognizing that the reservationTotal is not null and I'm being forced to make a type assertion:
Is there a way to do this without using type assertion? If not, is there a better way to do this?