doffm/Onvalid — Issue #2: .and question
Author: cdrubin
Created: 2012-01-04 23:11:49+00:00
State: open

I really like the simplicity of your library. Nice work! But before I can use it I want to learn more about something that does not seem quite right:

```javascript
var data, schema, valid;

valid = require('onvalid');

schema = {
email: valid.exists,
age: valid.and(valid.gte(18), valid.lte(40))
};

data = {
email: 'test@hello.org',
age: 17
};

if (valid.validate(data, schema)) {
console.log('Success');
} else {
console.log('Failure');
}
```
This should fail validation but does not. The .gte and .lte methods seem to work fine by themselves but in combination with .and() do not seem to do what I expect. What am I missing? Thanks!