Skip to content

Conversation

y-nk
Copy link
Contributor

@y-nk y-nk commented Jul 16, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • 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?

When using the ArgumentMetadata type in a transform pipe, we can't type metadata?.metatype which always ends up with a as XXX because the type is fixed to Type<any>

What is the new behavior?

Optional generic can be passed to ArgumentMetadata<MyClass> so that we can do:

if (metadata?.metatype) {
  const metatype = new metadata.metatype()
}

and get type safety both in the constructor and instance type

Does this PR introduce a breaking change?

  • Yes
  • No

@coveralls
Copy link

Pull Request Test Coverage Report for Build a4d5f079-e4c7-473a-a3b3-a406892e6719

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 42 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 88.934%

Files with Coverage Reduction New Missed Lines %
packages/core/injector/injector.ts 42 84.27%
Totals Coverage Status
Change from base Build 74b1a9ab-0b2d-47c2-9b96-2e66bcee106c: 0.02%
Covered Lines: 7265
Relevant Lines: 8169

💛 - Coveralls

@y-nk
Copy link
Contributor Author

y-nk commented Jul 25, 2025

@Hardanish-Singh is there a reason for not merging 🙏? i can help if needed.

@Hardanish-Singh
Copy link

@y-nk you would have to ask the code owners to merge this PR

@y-nk
Copy link
Contributor Author

y-nk commented Aug 6, 2025

@kamilmysliwiec 🙏

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.

3 participants