import { ValidateIf , ValidationOptions } from 'class-validator' ; export function IsOptional ( validationOptions ? ) { return ValidateIf ( ( _obj , value ) => { return value !== null && value !== undefined && value !== '' ; } , validationOptions ) ; }