Closed nickrobillard closed 4 years ago
Thanks! The changes look good. The build failed due to a simple linting error. Looks like we need to drop the require statement for joi
in that file now since it's not being used.
Lint:
/home/travis/build/jedireza/mongo-models/index.js:
Line 4: no-unused-vars - 'Joi' is assigned a value but never used. Allowed unused vars must match /^internals$/.
Let's get that updated and then we can land this PR.
Done!
Thanks!
published as mongo-models@3.0.2
When using @hapi/joi 16.x.x, the following error occurs when instantiating a model. This can be easily reproduced using the Customer example. Simply use joi 16 instead of 15.
Example:
Throws error:
Joi validate() method has changed in v16 and the following small changes resolve the issue. Based on some quick tests, this change is also backwards compatible with v15.