import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'addToPreviousCompartmentCodeLabelPipe',
})
export class AddToPreviousCompartmentCodeLabelPipe implements PipeTransform {
  transform(compartmentCode: string): string {
    const compartmentCodeSplit = compartmentCode?.split('_');
    compartmentCodeSplit?.shift();
    return compartmentCodeSplit?.join('_');
  }
}
