oferei/json-gate — pull request #25 by andersonba (2014-03-27 21:41:58+00:00)
Title: Add sanitize attribute to clean object

Cleans object, removing unmatching properties.

See bellow:

```
// Schema
{
str: { type: 'string' },
sanitize: true
}
````

```
// Object
{
str: 'hi',
extra: 'unimportant data, discard this',
extra1: 'discard this'
}
```

```
// Result object (after validate):
{
str: 'hi'
}
```

```
// Getting result object
newObject = schema.validate(Object);

// or
schema.validate(Object, function(err, obj) {
newObject = obj;
});
```