import { ValidationPipe, ValidationPipeOptions } from "@nestjs/common";

export const createValidationPipe = (
  overrides?: ValidationPipeOptions,
): ValidationPipe =>
  new ValidationPipe({
    whitelist: true,
    forbidNonWhitelisted: true,
    transform: true,
    transformOptions: { enableImplicitConversion: true },
    ...overrides,
  });
