-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support 'empty' prop and type 'any' #24
Conversation
// If empty (and empty allowed), move forward | ||
if (context.def.empty && context.value.length === 0) { | ||
return context.value | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not failing in the event that empty isn't allowed, and context.value is an empty array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings and arrays were already allowed to be empty before this push -- it would be good to have a test around the failure case for each of these, to prove empty values can be blocked. |
@TomFrost I'll write some integration tests to cover your last comment since it will need to move into the actual type checks. |
Support 'empty' prop and type 'any'
Closes #23 and Closes #22