all files / common/core/pipes/ keys.pipe.ts

75% Statements 6/8
100% Branches 0/0
25% Functions 1/4
80% Lines 4/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                             
/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
 
import { Pipe, PipeTransform } from '@angular/core';
 
/**
 * Map on object so we can itterate on it
 * @deprecated
 */
@Pipe({ name: 'keys' })
export class KeysPipe implements PipeTransform {
    /**
     * Transform object in array.
     *
     * @param value Object to itterate
     */
    public transform(value: any): any {
        return Object.keys(value).map((key) => value[key]);
    }
}