Closed targos closed 3 years ago
Yup, it should not be undefined
. Can you please create a PR to fix the behaviour?
Additionally, I think the typings should only allow to pass a default value if the key was declared as optional.
Agree, but this may require users to change a lot of their existing config after updating the package.
Closed by https://github.com/adonisjs/env/pull/22
Package version
v2.0.5
Node.js and npm version
Node.js 14, npm 6
Sample Code (to reproduce the issue)
ValueType
should bestring
because of the default value. This is important to avoid errors when passing the value returned byEnv.get()
to a function that requires a string. Additionally, I think the typings should only allow to pass a default value if the key was declared as optional.