Skip to content

Commit 49952f7

Browse files
committed
refactor: improve type specificity
--- 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: na - 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: na - task: lint_license_headers status: passed ---
1 parent d47c5ea commit 49952f7

File tree

1 file changed

+6
-6
lines changed
  • lib/node_modules/@stdlib/ndarray/base/map/docs/types

1 file changed

+6
-6
lines changed

lib/node_modules/@stdlib/ndarray/base/map/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ import { typedndarray } from '@stdlib/types/ndarray';
2828
*
2929
* @returns output value
3030
*/
31-
type Nullary<U, ThisArg> = ( this: ThisArg ) => U;
31+
type Nullary<V, ThisArg> = ( this: ThisArg ) => V;
3232

3333
/**
3434
* Callback invoked for each ndarray element.
3535
*
3636
* @param value - current array element
3737
* @returns output value
3838
*/
39-
type Unary<T, U, ThisArg> = ( this: ThisArg, value: T ) => U;
39+
type Unary<T, V, ThisArg> = ( this: ThisArg, value: T ) => V;
4040

4141
/**
4242
* Callback invoked for each ndarray element.
@@ -45,7 +45,7 @@ type Unary<T, U, ThisArg> = ( this: ThisArg, value: T ) => U;
4545
* @param indices - current array element indices
4646
* @returns output value
4747
*/
48-
type Binary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> ) => U;
48+
type Binary<T, V, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> ) => V;
4949

5050
/**
5151
* Callback invoked for each ndarray element.
@@ -55,7 +55,7 @@ type Binary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> )
5555
* @param arr - input array
5656
* @returns output value
5757
*/
58-
type Ternary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>, arr: typedndarray<T> ) => U;
58+
type Ternary<T, U, V, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>, arr: U ) => V;
5959

6060
/**
6161
* Callback invoked for each ndarray element.
@@ -65,7 +65,7 @@ type Ternary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>,
6565
* @param arr - input array
6666
* @returns output value
6767
*/
68-
type Callback<T, U, ThisArg> = Nullary<U, ThisArg> | Unary<T, U, ThisArg> | Binary<T, U, ThisArg> | Ternary<T, U, ThisArg>;
68+
type Callback<T, U, V, ThisArg> = Nullary<V, ThisArg> | Unary<T, V, ThisArg> | Binary<T, V, ThisArg> | Ternary<T, U, V, ThisArg>;
6969

7070
/**
7171
* Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray.
@@ -109,7 +109,7 @@ type Callback<T, U, ThisArg> = Nullary<U, ThisArg> | Unary<T, U, ThisArg> | Bina
109109
* console.log( y.data );
110110
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
111111
*/
112-
declare function map<T = unknown, U = unknown, ThisArg = unknown>( arrays: ArrayLike<typedndarray<T>>, fcn: Callback<T, U, ThisArg>, thisArg?: ThisParameterType<Callback<T, U, ThisArg>> ): void;
112+
declare function map<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = unknown, ThisArg = unknown>( arrays: ArrayLike<U>, fcn: Callback<T, U, V, ThisArg>, thisArg?: ThisParameterType<Callback<T, U, V, ThisArg>> ): void;
113113

114114

115115
// EXPORTS //

0 commit comments

Comments
 (0)