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

@Pipe({
  name: 'replaceWithBlank',
  standalone: false
})
export class ReplaceWithBlankPipe implements PipeTransform {

  transform(value: string, ...args: unknown[]): string {
    /**
    * Replaces "--", "N/A", "n/a" from input with Blank
    * @param {string} text
    * @returns {String}
    */
    let input = ''
    if (typeof value !== undefined && value !== '' && value !== null) {
      input = value.toString().replace(/--|n\/a|N\/A/g, '');
    }
    return input;
  }

}
