Skip to content

Conversation

Jaronem
Copy link

@Jaronem Jaronem commented Sep 16, 2024

Summary

In the example, nextMiddleware may be undefined since setting it via setNext() is not mandatory. If it is the last middleware in the chain, setNext() must not be called therefore this.nextMiddleware.execute(context); cannot be executed

Motivation

The code does not compile with TS since nextMiddleware is type actually Middleware | undefined.

Test plan

  • (Basic documentation change)

Closing issues

Fixes #

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Jaronem Jaronem requested a review from a team as a code owner September 16, 2024 06:33
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.

1 participant