Skip to content

Conversation

@miso-kyoungminkim
Copy link
Contributor

@miso-kyoungminkim miso-kyoungminkim commented Dec 31, 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?

Issue Number: N/A

This PR imporoves the type safety of built-in pipes in the @nestjs/common package by refining input/output types and removing unnecessary type assertions.

  • Introduction of unknown Input Type: Updated the transform method in all pipes to accept value: unknown instead of any or specific types like string. This forces more explicit type checking before processing the input.
  • Refined Return Types: Updated the return types of transform methods to explicitly include null | undefined when the optional configuration is enabled, accurately reflecting the pipe's potential output.
  • Robust Validation Logic: Replaced any assertions with explicit type guards (e.g., isString, isNumber, instanceof Date) to ensure data integrity.
  • Consistent Implementation: Applied these improvements across the entire pipe collection.
  • Theses changes preserve backward compatibility and pass all existing tests.

What is the new behavior?

nothing changed

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

Pull Request Test Coverage Report for Build 92fc9ffa-d560-4892-b2fe-2aff2db6e7d0

Details

  • 16 of 16 (100.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.759%

Totals Coverage Status
Change from base Build 2ad1776b-4e80-4104-bc1d-47efd0095c0f: 0.0%
Covered Lines: 7441
Relevant Lines: 8290

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants