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

Fix object pattern in combination with empty #1386

Merged
merged 1 commit into from
Jan 4, 2018

Conversation

choffmeister
Copy link
Contributor

When using Joi.object().pattern(...) it is currently not possible to convert values to undefined.

I guess the provided test case is self explaining. If not, I am happy to provide a more detailed explanation.

Copy link
Contributor

@DavidTPate DavidTPate left a comment

Choose a reason for hiding this comment

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

The changes look good to me, I think this was an edge case that was missed.

@DavidTPate
Copy link
Contributor

@Marsup I followed this particular part back and that check has been there since initial inception of pattern matching for object introduced with efc226a.

This seems like a semver-minor change as best as I can tell as it is not changing our interface but will slightly change behavior in a very specific edge case. If there's a different opinion I'm definitely open to it.

@Marsup
Copy link
Collaborator

Marsup commented Jan 4, 2018

Thanks @DavidTPate and @choffmeister. I'm indeed tempted not to consider it breaking, it may not even be minor but patch. I'll still release it as minor if people want to pin.

@Marsup Marsup self-assigned this Jan 4, 2018
@Marsup Marsup merged commit 2cc5c28 into hapijs:master Jan 4, 2018
@Marsup Marsup added this to the 13.1.0 milestone Jan 4, 2018
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants