Skip to content
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

Add option to treat empty strings as null values #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfilenko
Copy link

@mfilenko mfilenko commented Mar 18, 2022

Hey,

First of all, thanks a load for your work! This package is awesome! It's extremely useful and the code is super easy to navigate and work with 🙌

I would like to add an option to treat empty strings as null values. A use case can be the following .env file that indicates that values must be set, i.e., "" is not a valid value:

$ cat .env.example
# Make sure the following variables are set
MY_ENV_VAR1=
MY_EVV_VAR2=

The ignoreEmpty option shines when it comes to usage in Kotlin, e.g.:

dotenv["MY_ENV_VAR1"] ?: throw ...

@cdimascio cdimascio self-requested a review March 27, 2022 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant