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 ) );
	}
	opts.scopes = options.scopes;
	if ( !isStringArray( opts.scopes ) ) {
		return new TypeError( format( 'invalid option. `%s` option must be an array of strings. Option: `%s`.', 'scopes', opts.scopes ) );
	}
	opts.note = options.note;
	if ( !isString( opts.note ) ) {
		return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'note', opts.note ) );
	}
	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, 'note_url' ) ) {
		opts.note_url = options.note_url;
		if ( !isURI( opts.note_url ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a valid URI. Option: `%s`.', 'note_url', opts.note_url ) );
		}
	}
	if ( hasOwnProp( options, 'client_id' ) ) {
		opts.client_id = options.client_id;
		if ( !isString( opts.client_id ) || opts.client_id.length !== 20 ) {
			return new TypeError( format( 'invalid option. `%s` option must be a 20-character string. Option: `%s`.', 'client_id', opts.client_id ) );
		}
	}
	if ( hasOwnProp( options, 'client_secret' ) ) {
		opts.client_secret = options.client_secret;
		if (
			!isString( opts.client_secret ) ||
			opts.client_secret.length !== 40
		) {
			return new TypeError( format( 'invalid option. `%s` option must be a 40-character string. Option: `%s`.', 'client_secret', opts.client_secret ) );
		}
	}
	if ( hasOwnProp( options, 'fingerprint' ) ) {
		opts.fingerprint = options.fingerprint;
		if ( !isString( opts.fingerprint ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'fingerprint', opts.fingerprint ) );
		}
	}
	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 {StringArray} options.scopes - list of scopes
@param {string} options.note - note regarding the purpose of the token
@param {string} [options.otp] - GitHub one-time password
@param {string} [options.note_url] - application URL
@param {string} [options.client_id] - app OAuth client id
@param {string} [options.client_secret] - app OAuth client secret
@param {string} [options.fingerprint] - unique token id
@param {string} [options.useragent] - user agent string
@returns {(Error|null)} error or null