From 58e15aa67ae5c3fd4385429f8403353a98c00541 Mon Sep 17 00:00:00 2001 From: Mohammed Keyvanzadeh Date: Wed, 17 Aug 2022 02:04:56 +0430 Subject: [PATCH] tls: use logical OR operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the logical OR operator instead of the ternary operator where applicable. PR-URL: https://github.com/nodejs/node/pull/44236 Reviewed-By: theanarkh Reviewed-By: Tobias Nießen Reviewed-By: Anto Aravinth Reviewed-By: Feng Yu Reviewed-By: Matteo Collina Reviewed-By: Darshan Sen --- lib/internal/tls/secure-context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/tls/secure-context.js b/lib/internal/tls/secure-context.js index a9bf4a1da71eca..3d2e4d6623e859 100644 --- a/lib/internal/tls/secure-context.js +++ b/lib/internal/tls/secure-context.js @@ -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));