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

@Pipe({
  name: 'capitalize'
})
export class SpaCapitalizePipe implements PipeTransform {

  transform(value: string, ..._args: unknown[]): string {
    return value = value ? value.charAt(0).toUpperCase() + value.substr(1).toLowerCase() : '';
  }

  static transform(value: string, ..._args: unknown[]): string {
    return new SpaCapitalizePipe().transform(value, _args);
  }

}
