Skip to content

Forms and Data Handling: fix: specify that 'empty strings' will be ignored with { value : falsy } #29666

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GaneshS288
Copy link
Contributor

@GaneshS288 GaneshS288 commented May 4, 2025

Because

The explaination for optional modifer of express validator left out that empty strings will also be ignored with { value: falsy }

This PR

Changes this line

  • This is because { values: "falsy" } means values that aren’t undefined, null, false, or 0 will still be validated.

To this

  • This is because { values: "falsy" } means values that aren’t undefined, null, false, 0 or empty strings will still be validated.

Issue

Closes #XXXXX

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@github-actions github-actions bot added the Content: NodeJS Involves the NodeJS course label May 4, 2025
Co-authored-by: Austin Sullivan <a.m.sullivan.github@gmail.com>
@GaneshS288
Copy link
Contributor Author

GaneshS288 commented May 8, 2025

@wise-king-sullyman yeah your suggestion is reasonable. I committed it since I think "empty strings ''" is more explicit than just "empty strings". Oops I replied here instead of the original thread since it closed after commit and I couldn't open it again, sorry about that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: NodeJS Involves the NodeJS course
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants