Skip to content

Commit

Permalink
removed the ternary expression
Browse files Browse the repository at this point in the history
  • Loading branch information
parasss19 committed Oct 12, 2023
1 parent 9ca99c7 commit 6fdab20
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions library/src/helpers/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,17 @@ export class ServerHelpers {
let securityProtocol;
let saslMechanism;

securityProtocol =
protocol === 'kafka'
? securitySchema
? 'SASL_PLAINTEXT'
: 'PLAINTEXT'
: securitySchema
? 'SASL_SSL'
: 'SSL';
if (protocol === 'kafka') {
if (securitySchema) {
securityProtocol = 'SASL_PLAINTEXT';
} else {
securityProtocol = 'PLAINTEXT';
}
} else if (securitySchema) {
securityProtocol = 'SASL_SSL';
} else {
securityProtocol = 'SSL';
}

if (securitySchema) {
switch (securitySchema.type()) {
Expand Down

0 comments on commit 6fdab20

Please sign in to comment.