wrapp/validate.js — pull request #20 by colinskow (2014-07-07 18:31:43+00:00)
Title: Validate deeply nested properties

## Enable validation of deeply nested properties
Use a string with dot notation or bracket notation to perform validations on complex objects.

```javascript
var attributes = {
name: "Nicklas Ansman",
email: "nicklas@ansman.se",
deeply: {
nested: {
variable: "hello"
}
}
};
var constraints = {
name: {
pass: true
},
email: {
pass: true,
fail: true,
fail2: true
},
"deeply.nested.variable": {
fail2: true
}
};

expect(validate(attributes, constraints)).toEqual({
email: [
"Email must be a valid email address",
"Email is simply not good enough"
],
"deeply.nested.variable": [
"Deeply.nested.variable is simply not good enough"
]
});
```