tls: use optional chaining to simplify checks
PR-URL: https://github.com/nodejs/node/pull/41337 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
parent
1344b36fe3
commit
f34c0e0bc0
@ -161,11 +161,9 @@ function configSecureContext(context, options = {}, name = 'options') {
|
||||
for (let i = 0; i < key.length; ++i) {
|
||||
const val = key[i];
|
||||
const pem = (
|
||||
val !== undefined && val !== null &&
|
||||
val.pem !== undefined ? val.pem : val);
|
||||
val?.pem !== undefined ? val.pem : val);
|
||||
const pass = (
|
||||
val !== undefined && val !== null &&
|
||||
val.passphrase !== undefined ? val.passphrase : passphrase);
|
||||
val?.passphrase !== undefined ? val.passphrase : passphrase);
|
||||
setKey(context, pem, pass, name);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user