-
Notifications
You must be signed in to change notification settings - Fork 33
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
Check that env is not empty #146
Comments
Hi,
basically you're describing a case when |
Yeap, there are many cases when providing an empty value is fatal for the app in some further from initialization step. So we use those “ifs”, while having that flag in lib would be super comfy. I may create a PR, if everyone likes the idea |
I'm fine with it. Looks like the check should be added here (rough idea, haven't checked yet) Line 266 in c6faa7e
Feel free to submit a PR, thanks! |
@koterin hey, can I assign it to you? (it's fine if you don't wanna take it, I will) |
No, it's fine, I'll take it |
We have a
required
flag that ensures that env is set. But it doesn't check if it's just listed or really set to any value.It's crucial for most apps I'm working with and can help with throwing away ugly validators like this
This feature is also present in some other libs as
notEmpty
.I suggest we add it here as well so providing a
notEmpty
flag would make a comparison of the env to its zero type value and throw parsing error as a resultThe text was updated successfully, but these errors were encountered: