import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'chargesFilter' } ) export class ChargesFilterPipe implements PipeTransform { transform ( charges , chargesDataSource , currencyCode , multiDisburseLoan ? ) { if ( charges ) { charges = charges . filter ( ( charge ) => { if ( ( charge . currency . code !== currencyCode ) || ( ! ! multiDisburseLoan && charge . chargeTimeType . id === 12 ) || chargesDataSource . filter ( ( chargeData ) => chargeData . id === charge . id ) . length ) { return false ; } return true ; } ) ; } return charges ; } }