DefinitelyTyped/types/group-array/group-array-tests.ts
Richie Bendall 06b82c4e40 feat: Add types for group-array (#41819)
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
2020-01-23 10:45:53 -08:00

13 lines
320 B
TypeScript

import groupArray = require("group-array");
const input = [
{ tag: 'one', content: 'A' },
{ tag: 'one', content: 'B' },
{ tag: 'two', content: 'C' },
{ tag: 'two', content: 'D' },
{ tag: 'three', content: 'E' },
{ tag: 'three', content: 'F' }
];
groupArray(input, 'tag'); // $ExpectType object