Question · NestJS course · Module 10: Data Validation

OmitType vs PickType

What is the difference between OmitType and PickType in @nestjs/mapped-types?

Answer options

  • OmitType is faster, PickType is slower
  • OmitType creates a DTO without selected fields, PickType creates a DTO with only selected fields
  • OmitType works with REST, PickType with GraphQL
  • There is no difference - both functions work identically

You can check the correct answer by solving this task in the CodeWorlds game.