import { Pipe , PipeTransform , NgModule } from '@angular/core' ; import { isObject } from '../utils/utils' ; @ Pipe ( { name : 'keys' } ) export class KeysPipe implements PipeTransform { transform ( input ) { if ( ! isObject ( input ) ) { return input ; } return Object . keys ( input ) ; } } @ NgModule ( { declarations : [ KeysPipe ] , exports : [ KeysPipe ] , } ) export class NgKeysPipeModule { }