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

Add isNull type #215

Merged
merged 5 commits into from
Mar 2, 2022
Merged

Add isNull type #215

merged 5 commits into from
Mar 2, 2022

Conversation

dwightjack
Copy link
Owner

@dwightjack dwightjack commented Feb 19, 2022

Add the native validator isNull. The validator basically returns {type: null} and does not have any method or flag.

It can be used as an escape hatch for nullable non-required props.

See #206 for more context.

@dwightjack dwightjack self-assigned this Feb 19, 2022
@dwightjack dwightjack marked this pull request as ready for review February 19, 2022 09:30
@dwightjack dwightjack linked an issue Feb 19, 2022 that may be closed by this pull request
@victorgarciaesgi
Copy link
Collaborator

It's all good for me! :D
I just think the naming can be improved to remain consistent with other validators all being lowercased.
I was thinking nullable() ?
Again just a really minor thing you have the last word :p

@victorgarciaesgi
Copy link
Collaborator

Not related to this PR (But i don't know how to contact you otherwise), I recently migrated one of my repo to vitest instead of jest, and it's night and day. If you want I could work on a PR for it :)

@dwightjack
Copy link
Owner Author

Not related to this PR (But i don't know how to contact you otherwise), I recently migrated one of my repo to vitest instead of jest, and it's night and day. If you want I could work on a PR for it :)

That would be great! I wanted to take a look into vitest but didn't have the time yet. If you have time to submit a PR, that's very welcome 🙇.

@dwightjack
Copy link
Owner Author

PS: for things like proposals, enhancements etc, I guess we could you the discussion feature. 😃

@victorgarciaesgi
Copy link
Collaborator

PS: for things like proposals, enhancements etc, I guess we could you the discussion feature. 😃

Aha yes I always forgot about this. I'll keep you updated if I find a little time to do it :D

@dwightjack
Copy link
Owner Author

@victorgarciaesgi I changed the name to nullable, thanks for the suggestion.

I'm going to merge this PR and release an RC version

@dwightjack dwightjack merged commit b1a2d5b into next Mar 2, 2022
@victorgarciaesgi
Copy link
Collaborator

Yeay! 🎉

@dwightjack dwightjack deleted the feat/null-type branch July 23, 2022 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add null in possible generic types of object
2 participants