import { Pipe, PipeTransform } from '@angular/core'; import _ from 'lodash'; @Pipe({ name: 'object', pure: true }) export class ObjectPipe implements PipeTransform { transform(value: object, omit: string[] = []): string { const res = _.omit(value, omit); return res && Object.keys(res).length ? JSON.stringify(res) : ''; } }