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, '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, 'username' ) ) {
		opts.username = options.username;
		if ( !isString( opts.username ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'username', opts.username ) );
		}
	}
	if ( hasOwnProp( options, 'type' ) ) {
		opts.type = options.type;
		if ( !isString( opts.type ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'type', opts.type ) );
		}
	}
	if ( hasOwnProp( options, 'sort' ) ) {
		opts.sort = options.sort;
		if ( !isString( opts.sort ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sort', opts.sort ) );
		}
	}
	if ( hasOwnProp( options, 'direction' ) ) {
		opts.direction = options.direction;
		if ( !isString( opts.direction ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'direction', opts.direction) );
		}
	}
	if ( hasOwnProp( options, 'visibility' ) ) {
		opts.visibility = options.visibility;
		if ( !isString( opts.visibility ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'visibility', opts.visibility ) );
		}
	}
	if ( hasOwnProp( options, 'affiliation' ) ) {
		opts.affiliation = options.affiliation;
		if ( !isString( opts.affiliation ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'affiliation', opts.affiliation ) );
		}
	}
	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.token] - GitHub access token
@param {string} [options.username] - GitHub username
@param {string} [options.type] - repository type
@param {string} [options.sort] - sort method
@param {string} [options.direction] - sort direction
@param {string} [options.visibility] - repository visibility (requires token)
@param {string} [options.affiliation] - repository affiliation (requires token)
@param {string} [options.useragent] - user agent string
@returns {(Error|null)} error or null