function validate( opts, options ) {
	if ( !isObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	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 ) );
	}
	opts.password = options.password;
	if ( !isString( opts.password ) ) {
		return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'password', opts.password ) );
	}
	if ( hasOwnProp( options, 'otp' ) ) {
		opts.otp = options.otp;
		if ( !isString( opts.otp ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'otp', opts.otp ) );
		}
	}
	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.username - GitHub username
@param {string} options.password - GitHub password
@param {string} [options.otp] - GitHub one-time password
@param {string} [options.useragent] - user agent string
@returns {(Error|null)} error or null