Bird
0
0

Which interface must a custom pipe class implement in NestJS?

easy📝 Conceptual Q2 of 15
NestJS - Pipes

Which interface must a custom pipe class implement in NestJS?

APipeTransform
BCanActivate
CExceptionFilter
DMiddlewareConsumer
Step-by-Step Solution
Solution:
  1. Step 1: Recall NestJS pipe interface

    Custom pipes must implement the PipeTransform interface to define transform logic.
  2. Step 2: Differentiate from other interfaces

    CanActivate is for guards, ExceptionFilter for error handling, MiddlewareConsumer for middleware setup.
  3. Final Answer:

    PipeTransform -> Option A
  4. Quick Check:

    Custom pipe interface = PipeTransform [OK]
Quick Trick: Custom pipes always implement PipeTransform interface [OK]
Common Mistakes:
  • Using CanActivate instead of PipeTransform
  • Confusing with ExceptionFilter
  • Not implementing any interface

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes