Closed dcrystalj closed 4 years ago
I agree, this can be improved. Infact, we have plans to allow you to define validations for environment variables and then have more accurate types vs type casting manually as string
.
I will do an RFC on it in the coming week and will share the link here.
Here's the RFC https://github.com/adonisjs/rfcs/issues/24
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Why this feature is required (specific use-cases will be appreciated)?
It would be nice to have simple way of parsing integer from env. For example having env variable
COUNT=10
will give you string. Currently this is a bit too much work to parse to int because of need to handle undefined and boolean values to satisfy typescriptHave you tried any other work arounds?
parseInt(Env.get('COUNT', 60) as string)
but it is just ignoring undefined which is destroying purpose of typescript