Fix object pattern in combination with empty#1386
Conversation
DavidTPate
left a comment
There was a problem hiding this comment.
The changes look good to me, I think this was an edge case that was missed.
|
@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. |
|
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. |
|
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. |
|
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. |
When using
Joi.object().pattern(...)it is currently not possible to convert values toundefined.I guess the provided test case is self explaining. If not, I am happy to provide a more detailed explanation.