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

Support 'empty' prop and type 'any' #24

Merged
merged 5 commits into from
Mar 4, 2016
Merged

Support 'empty' prop and type 'any' #24

merged 5 commits into from
Mar 4, 2016

Conversation

ksafranski
Copy link
Contributor

Closes #23 and Closes #22

@ksafranski ksafranski self-assigned this Mar 4, 2016
// If empty (and empty allowed), move forward
if (context.def.empty && context.value.length === 0) {
return context.value
}
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TomFrost: added with 7f361d1

@TomFrost
Copy link
Contributor

TomFrost commented Mar 4, 2016

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.

@ksafranski
Copy link
Contributor Author

@TomFrost I'll write some integration tests to cover your last comment since it will need to move into the actual type checks.

ksafranski added a commit that referenced this pull request Mar 4, 2016
Support 'empty' prop and type 'any'
@ksafranski ksafranski merged commit 5405da5 into master Mar 4, 2016
@ksafranski ksafranski deleted the empty-any branch March 4, 2016 22:20
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