nest icon indicating copy to clipboard operation
nest copied to clipboard

fix: typings for fastify `enableCors` method

Open mdorda opened this issue 1 year ago • 1 comments
trafficstars

Fastify adapter uses typings from @fastify/cors package for enableCors method

Fix nestjs/nest#13234

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] ~Docs have been added / updated (for bug fixes / features)~ I do not think it is needed, documentation already refers to @fastfy/cors options

PR Type

What kind of change does this PR introduce?

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Other... Please describe:

What is the current behavior?

Issue Number: https://github.com/nestjs/nest/issues/13234

What is the new behavior?

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No (well, it could be for fastify, because typings have been changed...)

Other information

I'm not sure I've got the architecture right. My understanding is that the adapter should be platform-independent, and if there is a platform-specific implementation of the adapter then not. I took inspiration from useStaticAssets method for example, i.e. a universal adapter has any types and then the individual types are applied to the adapter (fastify, express) implementations.

mdorda avatar Feb 22 '24 06:02 mdorda

Pull Request Test Coverage Report for Build 3ac7222e-1121-4ad3-b143-a064507b3715

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.16%

Totals Coverage Status
Change from base Build dfe9054c-bafd-4c33-b92a-568f17cde136: 0.0%
Covered Lines: 6736
Relevant Lines: 7309

💛 - Coveralls

coveralls avatar Feb 22 '24 06:02 coveralls