Closed nunofgs closed 9 years ago
This PR passes the options object to nested constraints so that they may inherit the strict property.
strict
Take, for example, the following constraints:
{ user: { name: { first: new Assert().Required(), last: new Assert().Required() } } }
If you try to validate with the object: { user: {} }, this will return true, even in strict mode, which is not desired.
{ user: {} }
true
This fix allows the nested name object to receive the strict mode validation from its parent.
name
Thanks a lot for your PR.
I'll release it in a new tag once #40 gets merged too.
Best
This PR passes the options object to nested constraints so that they may inherit the
strict
property.Take, for example, the following constraints:
If you try to validate with the object:
{ user: {} }
, this will returntrue
, even instrict
mode, which is not desired.This fix allows the nested
name
object to receive thestrict
mode validation from its parent.