nest icon indicating copy to clipboard operation
nest copied to clipboard

feat(common)!: type narrowing allowed injection tokens for `@Inject()`

Open micalevisk opened this issue 2 years ago • 2 comments
trafficstars

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
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] 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?

we can pass anything to @Inject() decorator factory

What is the new behavior?

now we can only pass injection tokens (same type for provide on custom providers)

Does this PR introduce a breaking change?

  • [x] Yes
  • [ ] No

Other information

micalevisk avatar Nov 13 '23 15:11 micalevisk

Pull Request Test Coverage Report for Build d82035ec-2bea-47c6-8b34-fa7bc99f4aea

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.26%

Totals Coverage Status
Change from base Build e7c88d17-2198-4c13-b01a-98aa728736b6: 0.0%
Covered Lines: 6687
Relevant Lines: 7248

💛 - Coveralls

coveralls avatar Nov 14 '23 02:11 coveralls

screen

Tony133 avatar Nov 14 '23 07:11 Tony133