Skip to content

fix: remove unecessary as casting#140

Merged
antondalgren merged 1 commit intomainfrom
remove-as-casting
May 27, 2025
Merged

fix: remove unecessary as casting#140
antondalgren merged 1 commit intomainfrom
remove-as-casting

Conversation

@antondalgren
Copy link
Copy Markdown
Contributor

@antondalgren antondalgren commented May 27, 2025

This pull request focuses on improving type safety and code clarity by refining TypeScript type annotations and removing unnecessary type assertions. The changes primarily affect methods in the AMQPChannel, AMQPQueue, and AMQPView classes.

TypeScript type safety improvements:

  • src/amqp-channel.ts: Updated the queue, queueDeclare, and exchangeDeclare methods to use explicit type annotations for default parameter values, replacing type assertions with inline type definitions for cleaner and safer code. [1] [2] [3]

  • src/amqp-queue.ts: Refined the subscribe method parameters by replacing the type assertion with an inline type definition, ensuring consistency with other method signatures.

  • src/amqp-view.ts: Removed redundant type assertions in the setLongString and setBigInt64 method calls, relying on TypeScript's type inference for improved readability and maintainability.

@antondalgren antondalgren merged commit d999538 into main May 27, 2025
5 checks passed
@antondalgren antondalgren deleted the remove-as-casting branch May 27, 2025 11:44
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.

2 participants