/* * Copyright (c) 2019. Mario Studio. All right reserved. */ import { Pipe, PipeTransform, } from '@angular/core'; import { Dictionary, keyBy, List, PropertyName, ValueIterateeCustom, } from 'lodash'; @Pipe({ name: 'keyBy', }) export class KeyByPipe implements PipeTransform { transform ( collection: List | null | undefined, iteratee?: ValueIterateeCustom, ): Dictionary { return keyBy(collection, iteratee); } }