From add7b8b8d446690e641586a52c210a6f6c7b4756 Mon Sep 17 00:00:00 2001 From: Paras Date: Thu, 12 Oct 2023 11:45:43 +0530 Subject: [PATCH] refactor: if-else statement code --- library/src/helpers/server.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/library/src/helpers/server.ts b/library/src/helpers/server.ts index eb6bcf9ca..c5e9d2f9d 100644 --- a/library/src/helpers/server.ts +++ b/library/src/helpers/server.ts @@ -59,13 +59,12 @@ export class ServerHelpers { } else { securityProtocol = 'PLAINTEXT'; } + } else if (securitySchema) { + securityProtocol = 'SASL_SSL'; } else { - if (securitySchema) { - securityProtocol = 'SASL_SSL'; - } else { - securityProtocol = 'SSL'; - } + securityProtocol = 'SSL'; } + if (securitySchema) { switch (securitySchema.type()) { case 'plain':