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, 'type' ) ) {
		opts.type = options.type;
		if ( TYPES.indexOf( opts.type ) === -1 ) {
			return new TypeError( format( 'invalid option. `%s` option must be one of the following: [\'%s\']. Option: `%s`.', 'type', TYPES.join( '\', \'' ), opts.type ) );
		}
	}
	if ( hasOwnProp( options, 'useragent' ) ) {
		opts.useragent = options.useragent;
		if ( !isString( opts.useragent ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'useragent', opts.useragent ) );
		}
	}
	return null;
}
Validates function options.

@param {Object} opts - destination object
@param {Object} options - options to validate
@param {string} [options.type] - dependency type
@param {string} [options.useragent] - user agent string
@returns {(Error|null)} error or null