
# Validator

This is an **internal** module!

### Validator.validate

##### Options:

&nbsp;&nbsp;&nbsp;&nbsp;
target : Object

&nbsp;&nbsp;&nbsp;&nbsp;
targets

&nbsp;&nbsp;&nbsp;&nbsp;


### Validator(options)

Constructs an instance of `Validator`.

`Validator` instances are variadric functions. In other words, any number of arguments are accepted. 

Instances ensure any passed arguments adhere to the pre-defined guidelines.

Here are the **valid options**:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [options.types](#options.types)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [options.defaults](#options.defaults)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [options.validate](#options.validate)

#### options.types

Must be an `{}` or `undefined`.

Each value must be a `Type`, an `ArrayOf Type`, or a nested `options.types`-style object literal.

If this and `options.defaults` are both `undefined`, the `Validator` constructor returns `null`.

```Coffeescript
types:
	name: Required String
	friends: Required ArrayOf Friends
	gender: String
	profile:
		picture: Image
```

#### options.defaults

Must be an `{}` or `undefined`.

Each value must be a `

#### options.validate


# A Validator takes in an options object and returns a boolean.
# If the `types` and `defaults` options are both omitted, no Validator is created.
# If the `validate` option is omitted, the `validateTypes` utility function is used. 
