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, 'returns' ) ) {
		opts.returns = options.returns;
		if ( indexOf( returns, opts.returns ) === -1 ) {
			return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'returns', returns.join( '", "' ), opts.returns ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {string} [options.returns] - output format
@returns {(Error|null)} null or an error object

@example
var opts = {};
var options = {
    'returns': '*'
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}