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

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {string} [options.bundle] - bundle filename
@param {string} [options.dir] - root package directory
@param {string} [options.html] - HTML filename
@param {StringArray} [options.ignore] - ignore patterns
@param {string} [options.mount] - base URL mount
@param {Object} [options.packages_pattern] - glob pattern
@param {Object} [options.files_pattern] - glob pattern
@param {string} [options.title] - HTML title
@returns {(Error|null)} error object or null

@example
var opts = {};
var options = {
    'bundle': 'test_bundle.js'
};

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