I am trying to use my environment variables in my nodejs server written in typescript. I am requiring type string but .env variables are of type string|undefined. Is there any way to fix type of .env variables.
i have type assertion on .env variables like this :
process.env.Variable as string
It didn’t work, and I am still getting this type as string|undefined.