tls: use logical OR operator

Use the logical OR operator instead of the ternary operator where
applicable.

PR-URL: https://github.com/nodejs/node/pull/44236
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Mohammed Keyvanzadeh 2022-08-17 02:04:56 +04:30 committed by GitHub
parent b04f81c149
commit 7f5679b901
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,7 +265,7 @@ function configSecureContext(context, options = kEmptyObject, name = 'options')
if (pfx !== undefined && pfx !== null) {
if (ArrayIsArray(pfx)) {
ArrayPrototypeForEach(pfx, (val) => {
const raw = val.buf ? val.buf : val;
const raw = val.buf || val;
const pass = val.passphrase || passphrase;
if (pass !== undefined && pass !== null) {
context.loadPKCS12(toBuf(raw), toBuf(pass));