How to handle optional params
I'm using BetterAuth + Drizzle, and I have for instance session defined as
so when I do
I have Session with
but in BetterAuth API I do
but here
so I guess it tries to type it as an optional field, instead of just saying that it can be string | null, or instead of just "coercing" null to undefined
is that expected? can we use something cleaner?
can I always assume that ipAddress will be
so when I do
I have Session with
ipAddress: string | nullbut in BetterAuth API I do
but here
session has a typeso I guess it tries to type it as an optional field, instead of just saying that it can be string | null, or instead of just "coercing" null to undefined
is that expected? can we use something cleaner?
can I always assume that ipAddress will be
string | null and therefore cast it as a Session ?