definma-ui/src/app/parameters.pipe.ts

13 lines
342 B
TypeScript
Raw Normal View History

2020-07-27 17:52:03 +02:00
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(', ')}}`;
}
}