Rewrite ternary as IIFE

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2022-11-24 11:26:14 -05:00
1 parent 386cf3b87b
commit 1e179bfab3
1 file changed
+11 -5
@@ -29,11 +29,17 @@ const injectSystemCAsInjectable = getInjectable({
return;
}
const cas = Array.isArray(globalAgent.options.ca)
? globalAgent.options.ca
: globalAgent.options.ca
? [globalAgent.options.ca]
: [];
const cas = (() => {
if (Array.isArray(globalAgent.options.ca)) {
return globalAgent.options.ca;
}
if (globalAgent.options.ca) {
return [globalAgent.options.ca];
}
return [];
})();
for (const cert of certs) {
if (!isCertActive(cert)) {