13 lines
342 B
TypeScript
13 lines
342 B
TypeScript
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(', ')}}`;
|
|
}
|
|
|
|
}
|