-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
env() removes capitalization from camel case variable names #345
Comments
We got the same problem in our CI after updating to v16. environmentVariable:
Took me a while to find this issue as the cause for the failing CI. We have reverted to v15. |
@bcoe can you give me a code pointer? I tried to find the PR, which introduced this bug, but gave up after 10min search. :-/ |
@pitgrap I implemented camel-case, and de-camel-case here: https://github.com/yargs/yargs-parser/blob/master/lib/string-utils.ts#L26 When I ported the library to ESM. |
@bcoe I have fix in my local branch, how can I open PR for to review? |
…inue which is redundun fot the last loop statement
this should be fixed in the latest release. |
In the update to v16, it looks like the behavior of env() changed to convert all env variable names to lowercase. Here's an example to illustrate:
Running this on v15.4.0 prints
While in v16.0.0 and later, the same code prints
Updating to v16 broke some of our code as our camel case env variables were no longer found under their original names. I'm not sure whether the change was intentional, but the API documentation for .env() still shows camel case env variable names in the argv object, which is misleading.
The text was updated successfully, but these errors were encountered: