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, '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 ( opts.protocol !== 'http' && opts.protocol !== 'https' ) {
			return new Error( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'protocol', [ 'http', 'https' ].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, 'pathname' ) ) {
		opts.pathname = options.pathname;
		if ( !isString( opts.pathname ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'pathname', opts.pathname ) );
		}
	}
	if ( hasOwnProp( options, 'page' ) ) {
		opts.page = options.page;
		if ( !isPositiveInteger( opts.page ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'page', opts.page ) );
		}
	}
	if ( hasOwnProp( options, 'last_page' ) ) {
		opts.last_page = options.last_page;
		if ( !isPositiveInteger( opts.last_page ) && opts.last_page !== 'last' ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer or "last". Option: `%s`.', 'last_page', opts.last_page ) );
		}
	}
	if ( hasOwnProp( options, 'per_page' ) ) {
		opts.per_page = options.per_page;
		if ( !isPositiveInteger( opts.per_page ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'per_page', opts.per_page ) );
		}
	}
	if ( hasOwnProp( options, 'query' ) ) {
		opts.query = options.query;
		if ( !isString( opts.query ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'query', opts.query ) );
		}
	}
	if ( hasOwnProp( options, 'token' ) ) {
		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, 'accept' ) ) {
		opts.accept = options.accept;
		if ( !isString( opts.accept ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'accept', opts.accept ) );
		}
	}
	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.

@private
@param {Object} opts - destination object
@param {Options} options - options to validate
@param {string} [options.protocol] - request protocol
@param {string} [options.hostname] - endpoint hostname
@param {NonNegativeInteger} [options.port] - endpoint port
@param {string} [options.pathname] - resource pathname
@param {PositiveInteger} [options.page] - resource page
@param {PositiveInteger} [options.last_page] - last resource page
@param {PositiveInteger} [options.per_page] - page size
@param {string} [options.query] - params portion of a query string
@param {string} [options.token] - GitHub access token
@param {string} [options.accept] - media type
@param {string} [options.useragent] - user agent string
@returns {(Error|null)} error or null