From 42fecd947ddd48e190809cd03d348f56126d40c3 Mon Sep 17 00:00:00 2001 From: Monstrofil Date: Fri, 10 Jan 2020 21:01:16 +0200 Subject: [PATCH] Improve typing of groupBy pipe --- src/aggregate/group-by.pipe.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/aggregate/group-by.pipe.ts b/src/aggregate/group-by.pipe.ts index 40812da..85bfe78 100644 --- a/src/aggregate/group-by.pipe.ts +++ b/src/aggregate/group-by.pipe.ts @@ -1,11 +1,16 @@ import { Pipe, PipeTransform, NgModule } from '@angular/core'; import { getProperty, isArray, isUndefined } from '../utils/utils'; +class GroupByResult { + value: Array; + key: any; +} + @Pipe({ name: 'groupBy', }) export class GroupByPipe implements PipeTransform { - transform(input: any, prop: string): Array { + transform(input: Array, prop: string): Array> { if (!isArray(input)) { return input; }