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, '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, 'state' ) ) {
		opts.state = options.state;
		if ( !isString( opts.state ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'state', opts.state ) );
		}
	}
	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.useragent] - user agent string
@param {string} [options.state] - state of memberships to return
@returns {(Error|null)} error or null