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, 'dir' ) ) {
		opts.dir = options.dir;
		if ( !isString( opts.dir ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'dir', opts.dir ) );
		}
	}
	if ( hasOwnProp( options, 'pattern' ) ) {
		opts.pattern = options.pattern;
		if ( !isString( opts.pattern ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'pattern', opts.pattern ) );
		}
	}
	if ( hasOwnProp( options, 'ignore' ) ) {
		opts.ignore = options.ignore;
		if ( !isStringArray( opts.ignore ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an array of strings. Option: `%s`.', 'ignore', opts.ignore ) );
		}
	}
	if ( hasOwnProp( options, 'cumulative' ) ) {
		opts.cumulative = options.cumulative;
		if ( !isBoolean( opts.cumulative ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'cumulative', opts.cumulative ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {string} [options.dir] - root directory from which to search for files
@param {string} [options.pattern] - glob pattern
@param {StringArray} [options.ignore] - glob pattern(s) to exclude matches
@param {boolean} [options.cumulative] - boolean indicating whether to perform a cumulative analysis
@returns {(Error|null)} null or an error object

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