Skip to content

Commit 165c7fb

Browse files
authored
fix: use the correct TypeScript callback signature and update docs for array/base/for-each
PR-URL: #5448 Reviewed-by: Athan Reines <[email protected]>
1 parent 3b48bb5 commit 165c7fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/node_modules/@stdlib/array/base/for-each/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Callback function.
2424

2525
thisArg: any (optional)
26-
Callback function execution context.
26+
Callback execution context.
2727

2828
Examples
2929
--------

lib/node_modules/@stdlib/array/base/for-each/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type Unary<T, V> = ( this: V, value: T ) => void;
4040
* @param value - current array element
4141
* @param index - current array element index
4242
*/
43-
type Binary<T, V> = ( this: V, value: T, indices: Array<number> ) => void;
43+
type Binary<T, V> = ( this: V, value: T, index: number ) => void;
4444

4545
/**
4646
* Callback invoked for each array element.
@@ -49,7 +49,7 @@ type Binary<T, V> = ( this: V, value: T, indices: Array<number> ) => void;
4949
* @param index - current array element index
5050
* @param arr - input array
5151
*/
52-
type Ternary<T, U, V> = ( this: V, value: T, indices: Array<number>, arr: U ) => void;
52+
type Ternary<T, U, V> = ( this: V, value: T, index: number, arr: U ) => void;
5353

5454
/**
5555
* Callback invoked for each array element.
@@ -65,7 +65,7 @@ type Callback<T, U, V> = Nullary<V> | Unary<T, V> | Binary<T, V> | Ternary<T, U,
6565
*
6666
* @param x - input array
6767
* @param fcn - callback function
68-
* @param thisArg - callback function execution context
68+
* @param thisArg - callback execution context
6969
*
7070
* @example
7171
* var naryFunction = require( '@stdlib/utils/nary-function' );
@@ -84,7 +84,7 @@ declare function forEach<T = unknown, V = unknown>( x: AccessorArrayLike<T>, fcn
8484
*
8585
* @param x - input array
8686
* @param fcn - callback function
87-
* @param thisArg - callback function execution context
87+
* @param thisArg - callback execution context
8888
*
8989
* @example
9090
* var naryFunction = require( '@stdlib/utils/nary-function' );

0 commit comments

Comments
 (0)