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, 'out' ) ) {
		opts.out = options.out;
		if ( !isString( opts.out ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'out', opts.out ) );
		}
	}
	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 ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {string} [options.out] - output file path
@param {string} [options.pattern] - glob pattern
@returns {(Error|null)} error object or null

@example
var opts = {};
var options = {
    'pattern': 'beep*.js'
};

var err = validate( opts, options );
if ( err ) {
   throw err;
}