function validate( opts, options ) {
	if ( !isObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	opts.token = options.token;
	if ( !isString( opts.token ) ) {
		return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'token', opts.token ) );
	}
	if ( hasOwnProp( options, 'protocol' ) ) {
		opts.protocol = options.protocol;
		if ( !isString( opts.protocol ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'protocol', opts.protocol ) );
		}
		if ( indexOf( PROTOCOLS, opts.protocol ) === -1 ) {
			return new Error( format( 'invalid option. `%s` must be one of the following: "%s". Option: `%s`.', 'protocol', PROTOCOLS.join( '", "' ), opts.protocol ) );
		}
	}
	if ( hasOwnProp( options, 'hostname' ) ) {
		opts.hostname = options.hostname;
		if ( !isString( opts.hostname ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'hostname', opts.hostname ) );
		}
	}
	if ( hasOwnProp( options, 'port' ) ) {
		opts.port = options.port;
		if ( !isNonNegativeInteger( opts.port ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'port', opts.port ) );
		}
	}
	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 ) );
		}
	}
	if ( hasOwnProp( options, 'body' ) ) {
		opts.body = options.body;
		if ( !isString( opts.body ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'body', opts.body ) );
		}
	}
	if ( hasOwnProp( options, 'assignees' ) ) {
		opts.assignees = options.assignees;
		if ( !isStringArray( opts.assignees ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an array of strings. Option: `%s`.', 'assignees', opts.assignees ) );
		}
	}
	if ( hasOwnProp( options, 'milestone' ) ) {
		opts.milestone = options.milestone;
		if ( !isPositiveInteger( opts.milestone ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'milestone', opts.milestone ) );
		}
	}
	if ( hasOwnProp( options, 'labels' ) ) {
		opts.labels = options.labels;
		if ( !isStringArray( opts.labels ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an array of strings. Option: `%s`.', 'labels', opts.labels ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - options to validate
@param {string} options.token - GitHub access token
@param {string} [options.protocol] - request protocol
@param {string} [options.hostname] - endpoint hostname
@param {NonNegativeInteger} [options.port] - endpoint port
@param {string} [options.useragent] - user agent string
@param {string} [options.body] - issue content
@param {StringArray} [options.assignees] - usernames of assigned users
@param {PositiveInteger} [options.milestone] - associated milestone number
@param {StringArray} [options.labels] - issue labels
@returns {(Error|null)} error or null