Skip to content

Commit 2ba2e12

Browse files
kgrytesaurabhraghuvanshii
authored andcommitted
docs: rename parameter
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 9df0606 commit 2ba2e12

File tree

3 files changed

+26
-28
lines changed

3 files changed

+26
-28
lines changed

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/docs/repl.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
{{alias}}( arrays, initial, accumulator )
2+
{{alias}}( arrays, initial, clbk )
33
Performs a reduction over elements in an input ndarray.
44

55
A provided "ndarray" should be an object with the following properties:
@@ -12,19 +12,17 @@
1212
- order: specifies whether an ndarray is row-major (C-style) or column-major
1313
(Fortran-style).
1414

15-
The accumulator callback should be a binary function accepting two
16-
arguments:
15+
The callback function should be a binary function accepting two arguments:
1716

1817
- accumulated: the accumulated result.
1918
- currentValue: the current ndarray element.
2019

21-
Each invocation of the accumulator callback should return an updated
22-
accumulated result. This return value is subsequently provided to the
23-
accumulator callback upon next invocation.
20+
Each invocation of the callback should return an updated accumulated result.
21+
This return value is subsequently provided to the callback upon next
22+
invocation.
2423

25-
After invoking the accumulator callback for each element in a provided
26-
ndarray, the function returns the return value from the last invocation of
27-
the accumulator callback.
24+
After invoking the callback for each element in a provided ndarray, the
25+
function returns the return value from the last invocation of the callback.
2826

2927
Parameters
3028
----------
@@ -34,8 +32,8 @@
3432
initial: any
3533
Initial accumulator value.
3634

37-
accumulator: Function
38-
Accumulator callback.
35+
clbk: Function
36+
Callback function.
3937

4038
Returns
4139
-------

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ import { ArrayLike } from '@stdlib/types/array';
2424
import { typedndarray } from '@stdlib/types/ndarray';
2525

2626
/**
27-
* Accumulator callback invoked for each ndarray element.
27+
* Callback invoked for each ndarray element.
2828
*
2929
* @param acc - accumulated result
3030
* @param value - current ndarray element
3131
* @returns result
3232
*/
33-
type Accumulator<T = unknown, U = unknown> = ( acc: T, value: U ) => T;
33+
type Callback<T = unknown, U = unknown> = ( acc: T, value: U ) => T;
3434

3535
/**
3636
* Performs a reduction over elements in an ndarray.
3737
*
3838
* @param arrays - array-like object containing one input ndarray
3939
* @param initial - initial value
40-
* @param accumulator - callback function
40+
* @param clbk - callback function
4141
* @returns accumulated result
4242
*
4343
* @example
@@ -73,7 +73,7 @@ type Accumulator<T = unknown, U = unknown> = ( acc: T, value: U ) => T;
7373
* var v = accumulateUnary( [ x ], 0.0, add );
7474
* // returns 39.0
7575
*/
76-
declare function accumulateUnary<T = unknown, U = unknown>( arrays: ArrayLike<typedndarray<U>>, initial: T, accumulator: Accumulator<T, U> ): T;
76+
declare function accumulateUnary<T = unknown, U = unknown>( arrays: ArrayLike<typedndarray<U>>, initial: T, clbk: Callback<T, U> ): T;
7777

7878

7979
// EXPORTS //

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/docs/types/test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import zeros = require( '@stdlib/ndarray/zeros' );
2020
import accumulateUnary = require( './index' );
2121

2222
/**
23-
* Accumulator callback.
23+
* Callback function.
2424
*
2525
* @param acc - accumulated result
2626
* @param x - input value
2727
* @returns accumulated result
2828
*/
29-
function accumulator( acc: number, x: number ): number {
29+
function clbk( acc: number, x: number ): number {
3030
return acc + x;
3131
}
3232

@@ -38,22 +38,22 @@ function accumulator( acc: number, x: number ): number {
3838
const x = zeros( [ 2, 2 ] );
3939
const arrays = [ x ];
4040

41-
accumulateUnary( arrays, 0.0, accumulator ); // $ExpectType number
41+
accumulateUnary( arrays, 0.0, clbk ); // $ExpectType number
4242
}
4343

4444
// The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarray-like objects...
4545
{
46-
accumulateUnary( 5, 0.0, accumulator ); // $ExpectError
47-
accumulateUnary( true, 0.0, accumulator ); // $ExpectError
48-
accumulateUnary( false, 0.0, accumulator ); // $ExpectError
49-
accumulateUnary( null, 0.0, accumulator ); // $ExpectError
50-
accumulateUnary( undefined, 0.0, accumulator ); // $ExpectError
51-
accumulateUnary( {}, 0.0, accumulator ); // $ExpectError
52-
accumulateUnary( [ 1 ], 0.0, accumulator ); // $ExpectError
53-
accumulateUnary( ( x: number ): number => x, 0.0, accumulator ); // $ExpectError
46+
accumulateUnary( 5, 0.0, clbk ); // $ExpectError
47+
accumulateUnary( true, 0.0, clbk ); // $ExpectError
48+
accumulateUnary( false, 0.0, clbk ); // $ExpectError
49+
accumulateUnary( null, 0.0, clbk ); // $ExpectError
50+
accumulateUnary( undefined, 0.0, clbk ); // $ExpectError
51+
accumulateUnary( {}, 0.0, clbk ); // $ExpectError
52+
accumulateUnary( [ 1 ], 0.0, clbk ); // $ExpectError
53+
accumulateUnary( ( x: number ): number => x, 0.0, clbk ); // $ExpectError
5454
}
5555

56-
// The compiler throws an error if the function is provided a third argument which is not an accumulator function...
56+
// The compiler throws an error if the function is provided a third argument which is not a valid callback function...
5757
{
5858
const x = zeros( [ 2, 2 ] );
5959
const arrays = [ x ];
@@ -75,5 +75,5 @@ function accumulator( acc: number, x: number ): number {
7575

7676
accumulateUnary(); // $ExpectError
7777
accumulateUnary( arrays ); // $ExpectError
78-
accumulateUnary( arrays, 0.0, accumulator, {} ); // $ExpectError
78+
accumulateUnary( arrays, 0.0, clbk, {} ); // $ExpectError
7979
}

0 commit comments

Comments
 (0)