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

@Pipe({
  name: 'parameters'
})
export class ParametersPipe implements PipeTransform {

  transform(value: {name: string, range: object}[]): string {
    return `{${value.map(e => `${e.name}: <${JSON.stringify(e.range).replace('{}', 'any')
      .replace(/["{}]/g, '')}>`).join(', ')}}`;
  }

}
