I encountered a problem while upgrading Joi from v15 to v17+. I rewrote the .extend() call to match the new API from v16. It seems that the default in the Joi schema for the options argument of the withPattern custom rule is not applied. It makes this
condition fail whereas it should not. For the test on $range the found variable is false but args.options.inverse is undefined hence the strict equality comparison fails.
I don't know if it's normal and expected from the Joi rewrite and that I should just update the condition or if I made a mistake rewriting the extend() calls and the default should have worked. I don't have anymore time for today to work on it but I might be able to finish during the week-end. If anyone has an answer to this problem and wants to chime in, feel free to do so. 😃
I encountered a problem while upgrading Joi from v15 to v17+. I rewrote the
.extend()
call to match the new API from v16. It seems that the default in the Joi schema for theoptions
argument of thewithPattern
custom rule is not applied. It makes this condition fail whereas it should not. For the test on$range
thefound
variable isfalse
butargs.options.inverse
is undefined hence the strict equality comparison fails.I don't know if it's normal and expected from the Joi rewrite and that I should just update the condition or if I made a mistake rewriting the
extend()
calls and thedefault
should have worked. I don't have anymore time for today to work on it but I might be able to finish during the week-end. If anyone has an answer to this problem and wants to chime in, feel free to do so. 😃