Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: if-else statement code #806

Closed
wants to merge 8 commits into from
10 changes: 5 additions & 5 deletions library/src/helpers/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ export class ServerHelpers {
) {
let securityProtocol;
let saslMechanism;

if (protocol === 'kafka') {
if (securitySchema) {
securityProtocol = 'SASL_PLAINTEXT';
} else {
securityProtocol = 'PLAINTEXT';
}
} else if (securitySchema) {
securityProtocol = 'SASL_SSL';
} else {
if (securitySchema) {
parasss19 marked this conversation as resolved.
Show resolved Hide resolved
securityProtocol = 'SASL_SSL';
} else {
securityProtocol = 'SSL';
}
securityProtocol = 'SSL';
}

if (securitySchema) {
switch (securitySchema.type()) {
case 'plain':
Expand Down