nest
nest copied to clipboard
feat(common)!: type narrowing allowed injection tokens for `@Inject()`
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
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 | |
|---|---|
| Change from base Build e7c88d17-2198-4c13-b01a-98aa728736b6: | 0.0% |
| Covered Lines: | 6687 |
| Relevant Lines: | 7248 |
💛 - Coveralls