NestJS - Pipes
Identify the mistake in this
FileValidationPipe snippet:transform(file) {
const allowedExtensions = ['jpg', 'png'];
const extension = file.originalname.split('.').pop;
if (!allowedExtensions.includes(extension)) {
throw new BadRequestException('Unsupported file type');
}
return file;
}