Skip to content

Commit b92f33c

Browse files
committed
feat: improve type specificity
1 parent f41e1b6 commit b92f33c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • lib/node_modules/@stdlib/utils/map-function/docs/types

lib/node_modules/@stdlib/utils/map-function/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@
2323
*
2424
* @returns result
2525
*/
26-
type Nullary = () => any;
26+
type Nullary<T> = () => T;
2727

2828
/**
2929
* Invoked function.
3030
*
3131
* @param i - invocation index
3232
* @returns result
3333
*/
34-
type Unary = ( i: number ) => any;
34+
type Unary<T> = ( i: number ) => T;
3535

3636
/**
3737
* Invoked function.
3838
*
3939
* @param i - invocation index
4040
* @returns result
4141
*/
42-
type Fcn = Nullary | Unary;
42+
type Fcn<T> = Nullary<T> | Unary<T>;
4343

4444
/**
4545
* Invokes a function `n` times and returns an array of accumulated function return values.
@@ -62,7 +62,7 @@ type Fcn = Nullary | Unary;
6262
* var arr = mapFun( fcn, 5 );
6363
* // returns [ 0, 1, 2, 3, 4 ]
6464
*/
65-
declare function mapFun( fcn: Fcn, n: number, thisArg?: any ): Array<any>;
65+
declare function mapFun<T = unknown>( fcn: Fcn<T>, n: number, thisArg?: ThisParameterType<Fcn<T>> ): Array<T>;
6666

6767

6868
// EXPORTS //

0 commit comments

Comments
 (0)