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

Handle Empty Strings as Undefined in Environment Validation #147

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

spiderCSman
Copy link
Collaborator

Introduces a helper function to treat empty strings as undefined during environment variable validation. The changes aim to simplify validation logic by avoiding repetitive .min(1) calls and ensuring empty strings are correctly flagged as invalid.

Changes Made:
Added stringOrUndefined Helper:

Ensures empty strings are treated as undefined.
Applies validation using .refine() and transformation using .transform().
Updated Server and Client Environment Variables:

Replaced z.string().min(1) with stringOrUndefined for consistency and maintainability.

Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hack-kit-web ❌ Failed (Inspect) Dec 17, 2024 9:07pm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lermatroid Ignoring the package-lock.json issue, is this what you are expecting from this issue? Just want to make sure that this is what is the purpose of #72

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.

2 participants