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

@Pipe({
  name: 'packageNumberParser',
})
export class PackageNumberParserPipe implements PipeTransform {
  transform(packageNumber: string): string {
    if (!packageNumber) {
      return '';
    }
    if (packageNumber.length !== 18) {
      return packageNumber;
    }

    return packageNumber.slice(6, 12);
  }
}
