NestJS - Pipes
What happens if the custom pipe below receives the input "abc"?
export class ParseIntPipe implements PipeTransform {
transform(value: any) {
const val = parseInt(value, 10);
if (isNaN(val)) {
throw new Error('Invalid number');
}
return val;
}
}