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

@Pipe({
  name: 'trim',
  standalone: false,
})
export class TrimPipe implements PipeTransform {
  transform(value: string, length: number = 25): any {
    if (isString(value) && value.length > 25 + 3) {
      return value.substr(0, length - 1) + '...';
    }
    return value;
  }
}
