Proposal for Config.nonEmptyString() to Handle Empty .env Variables

Config.nonEmptyString("") or Equivalent

Would you be interested in adding a feature like Config.nonEmptyString("HOST") or an option to treat empty strings as "no value"? This feature exists in T3 Env (https://env.t3.gg/docs/core) and is very useful because, often, .env files aren't fully populated and might look like this:

REDIRECT_EMAIL=

PORT=


I've tested this with dotenv, and those variables end up as empty strings. While I know I could validate this myself, I wonder if this use case is common enough to warrant making it a core feature.
Was this page helpful?