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

feat: add object and array fields to getYupConstraint validation #465

Merged
merged 7 commits into from
Apr 9, 2024

Conversation

gglee89
Copy link
Contributor

@gglee89 gglee89 commented Feb 18, 2024

What was done:

  • implementation of the getYupConstraint utility function.
  • Added validation for:
    • timestamp
    • array
    • nested object
    • list
    • tuple
      • ⚠️ until yup is updated to v1 we added a custom method for tuples which outputs tuples as:
        • tuple.0: {...}
        • tuple.1: {...}

packages/conform-dom/form.ts Outdated Show resolved Hide resolved
tests/conform-yup.spec.ts Outdated Show resolved Hide resolved
tests/conform-yup.spec.ts Show resolved Hide resolved
tests/conform-yup.spec.ts Outdated Show resolved Hide resolved
@edmundhung
Copy link
Owner

Sorry for the late review 🙏🏼 @gglee89

@gglee89 gglee89 requested a review from edmundhung April 2, 2024 12:37
@gglee89
Copy link
Contributor Author

gglee89 commented Apr 2, 2024

Thanks for the feedback @edmundhung
I've made the changes to leave tuple unsupported. Makes sense, especially because it's natively supported on yup v1.

edmundhung
edmundhung previously approved these changes Apr 2, 2024
Copy link
Owner

@edmundhung edmundhung left a comment

Choose a reason for hiding this comment

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

This is awesome. Thanks!

@edmundhung edmundhung changed the base branch from v1 to main April 9, 2024 19:16
@edmundhung edmundhung dismissed their stale review April 9, 2024 19:16

The base branch was changed.

@edmundhung edmundhung merged commit 2cab5e6 into edmundhung:main Apr 9, 2024
2 checks passed
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.

None yet

2 participants