Skip to content

Commit fcd5be3

Browse files
committed
refactor: improve type declarations for group function using generics
1 parent 31aff93 commit fcd5be3

File tree

1 file changed

+2
-2
lines changed
  • lib/node_modules/@stdlib/utils/group/docs/types

1 file changed

+2
-2
lines changed

lib/node_modules/@stdlib/utils/group/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ interface Options {
5151
* var out = group( arr, groups );
5252
* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }
5353
*/
54-
declare function group( collection: Collection, groups: Collection ): any;
54+
declare function group<T>( collection: Collection<T>, groups: Collection<T> ): { [key: string]: Collection<T> };
5555

5656
/**
5757
* Groups values as arrays associated with distinct keys.
@@ -89,7 +89,7 @@ declare function group( collection: Collection, groups: Collection ): any;
8989
* var out = group( arr, opts, groups );
9090
* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }
9191
*/
92-
declare function group( collection: Collection, options: Options, groups: Collection ): any;
92+
declare function group<T>( collection: Collection<T>, options: Options, groups: Collection<T> ): { [key: string]: Collection<T>};
9393

9494

9595
// EXPORTS //

0 commit comments

Comments
 (0)