only replace `process.env` variable if value is defined
This fixes https://github.com/goatandsheep/react-native-dotenv/issues/251#issuecomment-1066200376
react-native sets the NODE_ENV after this transformation happens.
Code that directly access process.env.NODE_ENV was replaced by babelMode during transformation (if latest babel was used) or by undefined.
With this commit, any access to a process.env variable is only replaced by the corresponding value if its value is set.
Codecov Report
Base: 98.97% // Head: 98.96% // Decreases project coverage by -0.01% :warning:
Coverage data is based on head (
9f3cffd) compared to base (3a940cb). Patch coverage: 100.00% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## main #316 +/- ##
==========================================
- Coverage 98.97% 98.96% -0.02%
==========================================
Files 1 1
Lines 98 97 -1
==========================================
- Hits 97 96 -1
Misses 1 1
| Impacted Files | Coverage Δ | |
|---|---|---|
| index.js | 98.96% <100.00%> (-0.02%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@goatandsheep can this be merged?
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.
Hi @schiller-manuel let me look into this
I will still need to resolve another issue before I release the next version but I'll merge