function validate( opts, options ) {
	if ( !isObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'name' ) ) {
		opts.name = options.name;
		if (
			!isString( opts.name ) &&
			!isStringArray( opts.name )
		) {
			return new TypeError( format( 'invalid option. `%s` option must be a string or an array of strings. Option: `%s`.', 'name', opts.name ) );
		}
	}
	if ( hasOwnProp( options, 'year' ) ) {
		opts.year = options.year;
		if (
			!isPositiveInteger( opts.year ) &&
			!isPositiveIntegerArray( opts.year )
		) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer or an array of positive integers. Option: `%s`.', 'year', opts.year ) );
		}
	}
	if ( hasOwnProp( options, 'range' ) ) {
		opts.range = options.range;
		if (
			!isPositiveIntegerArray( opts.range ) ||
			opts.range.length !== 2
		) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer array of length two. Option: `%s`.', 'range', opts.range ) );
		}
		if ( opts.range[ 0 ] < 1790 ) {
			return new RangeError( format( 'invalid option. `%s` option cannot be less than 1790. Option: `%s`.', 'range[0]', opts.range ) );
		}
		if ( opts.range[ 1 ] > 5000 ) {
			return new RangeError( format( 'invalid option. `%s` option cannot be greater than 5000. Option: `%s`.', 'range[1]', opts.range ) );
		}
	}
	if ( hasOwnProp( options, 'party' ) ) {
		opts.party = options.party;
		if (
			!isString( opts.party ) &&
			!isStringArray( opts.party )
		) {
			return new TypeError( format( 'invalid option. `%s` option must be a string or an array of strings. Option: `%s`.', 'party', opts.party ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {(string|StringArray)} [options.name] - President name(s)
@param {(PositiveInteger|PositiveIntegerArray)} [options.year] - year(s)
@param {PositiveIntegerArray} [options.range] - year range
@param {(string|StringArray)} [options.party] - political party
@returns {(Error|null)} null or an error object

@example
var opts = {};
var options = {
    'range': [ 1942, 2008 ],
    'president': 'Barack Obama'
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}