Skip to content

Conversation

seeun0210
Copy link

@seeun0210 seeun0210 commented Mar 15, 2025

Description

This pull request updates the Mechanism type by changing the type of the mechanism property from string to SASLMechanism. This change improves type safety and enforces consistency with the defined SASL mechanisms within the codebase.
Fixes #1744

Motivation and Context

By using the dedicated SASLMechanism type instead of a generic string, we ensure that only valid SASL mechanism values are used. This reduces the potential for errors and clarifies the intent of the type definition, aligning it with the overall type system of KafkaJS.

How Has This Been Tested?

  • The existing tests have been run to confirm that this change does not introduce any regressions.
  • Type checking tools (e.g., TypeScript compiler) have verified that the new type is correctly enforced.
    image

Types of Changes

  • Refactoring: Adjusting the type definition for improved clarity and robustness.

Checklist

  • I have read the contribution guidelines.
  • I have searched for any related issues and confirmed this update is appropriate.
  • My code follows the project’s style guidelines.
  • I have updated or added tests as necessary.
  • Documentation has been updated to reflect this change (if applicable).

Additional Notes

Feel free to provide any feedback or request further modifications as needed. Thank you for considering this improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Introduce SASLMechanism Type to Avoid Case Sensitivity Issues
1 participant