Skip to content

Commit fad9cf7

Browse files
committed
docs: fix declarations and add notes
--- 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: passed - task: lint_license_headers status: passed ---
1 parent c188028 commit fad9cf7

File tree

2 files changed

+65
-37
lines changed

2 files changed

+65
-37
lines changed

lib/node_modules/@stdlib/blas/ext/index-of/docs/types/index.d.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { ArrayLike } from '@stdlib/types/array';
2423
import { IntegerIndexAndGenericDataType as DataType, typedndarray } from '@stdlib/types/ndarray';
2524

2625
/**
@@ -48,9 +47,13 @@ type OutputArray = typedndarray<number>;
4847
*/
4948
interface BaseOptions {
5049
/**
51-
* List of dimensions over which to perform operation.
50+
* Dimension over which to perform operation. Default: `-1`.
51+
*
52+
* ## Notes
53+
*
54+
* - If provided a negative integer, the dimension along which to perform the operation is determined by counting backward from the last dimension (where `-1` refers to the last dimension).
5255
*/
53-
dims?: ArrayLike<number>;
56+
dim?: number;
5457
}
5558

5659
/**
@@ -76,6 +79,11 @@ interface IndexOf {
7679
/**
7780
* Returns the first index of a specified search element along an ndarray dimension.
7881
*
82+
* ## Notes
83+
*
84+
* - When searching for a search element, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same.
85+
* - If unable to find a search element along an ndarray dimension, the corresponding element in the returned ndarray is `-1`.
86+
*
7987
* @param x - input ndarray
8088
* @param searchElement - search element
8189
* @param options - function options
@@ -97,6 +105,11 @@ interface IndexOf {
97105
/**
98106
* Returns the first index of a specified search element along an ndarray dimension.
99107
*
108+
* ## Notes
109+
*
110+
* - When searching for a search element, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same.
111+
* - If unable to find a search element along an ndarray dimension, the corresponding element in the returned ndarray is `-1`.
112+
*
100113
* @param x - input ndarray
101114
* @param searchElement - search element
102115
* @param fromIndex - index from which to begin searching
@@ -119,6 +132,11 @@ interface IndexOf {
119132
/**
120133
* Returns the first index of a specified search element along an ndarray dimension and assigns results to a provided output ndarray.
121134
*
135+
* ## Notes
136+
*
137+
* - When searching for a search element, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same.
138+
* - If unable to find a search element along an ndarray dimension, the corresponding element in the returned ndarray is `-1`.
139+
*
122140
* @param x - input ndarray
123141
* @param searchElement - search element
124142
* @param out - output ndarray
@@ -148,6 +166,11 @@ interface IndexOf {
148166
/**
149167
* Returns the first index of a specified search element along an ndarray dimension and assigns results to a provided output ndarray.
150168
*
169+
* ## Notes
170+
*
171+
* - When searching for a search element, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same.
172+
* - If unable to find a search element along an ndarray dimension, the corresponding element in the returned ndarray is `-1`.
173+
*
151174
* @param x - input ndarray
152175
* @param searchElement - search element
153176
* @param fromIndex - index from which to begin searching
@@ -179,6 +202,11 @@ interface IndexOf {
179202
/**
180203
* Returns the first index of a specified search element along an ndarray dimension.
181204
*
205+
* ## Notes
206+
*
207+
* - When searching for a search element, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same.
208+
* - If unable to find a search element along an ndarray dimension, the corresponding element in the returned ndarray is `-1`.
209+
*
182210
* @param x - input ndarray
183211
* @param searchElement - search element
184212
* @param fromIndex - index from which to begin searching

lib/node_modules/@stdlib/blas/ext/index-of/docs/types/test.ts

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ import indexOf = require( './index' );
7777
indexOf( ( x: number ): number => x, 0.0, 0, {} ); // $ExpectError
7878
}
7979

80-
// The compiler throws an error if the function is provided a search element argument which is not an ndarray or scalar value...
80+
// The compiler throws an error if the function is provided a search element argument which is not an ndarray or scalar value having the same "type"...
8181
{
8282
const x = zeros( [ 2, 2 ], {
8383
'dtype': 'float64'
@@ -185,27 +185,27 @@ import indexOf = require( './index' );
185185
indexOf( x, 0.0, 0, { 'dtype': ( x: number ): number => x } ); // $ExpectError
186186
}
187187

188-
// The compiler throws an error if the function is provided an invalid `dims` option...
188+
// The compiler throws an error if the function is provided an invalid `dim` option...
189189
{
190190
const x = zeros( [ 2, 2 ], {
191191
'dtype': 'float64'
192192
});
193193

194-
indexOf( x, 0.0, { 'dims': '5' } ); // $ExpectError
195-
indexOf( x, 0.0, { 'dims': 5 } ); // $ExpectError
196-
indexOf( x, 0.0, { 'dims': true } ); // $ExpectError
197-
indexOf( x, 0.0, { 'dims': false } ); // $ExpectError
198-
indexOf( x, 0.0, { 'dims': null } ); // $ExpectError
199-
indexOf( x, 0.0, { 'dims': {} } ); // $ExpectError
200-
indexOf( x, 0.0, { 'dims': ( x: number ): number => x } ); // $ExpectError
201-
202-
indexOf( x, 0.0, 0, { 'dims': '5' } ); // $ExpectError
203-
indexOf( x, 0.0, 0, { 'dims': 5 } ); // $ExpectError
204-
indexOf( x, 0.0, 0, { 'dims': true } ); // $ExpectError
205-
indexOf( x, 0.0, 0, { 'dims': false } ); // $ExpectError
206-
indexOf( x, 0.0, 0, { 'dims': null } ); // $ExpectError
207-
indexOf( x, 0.0, 0, { 'dims': {} } ); // $ExpectError
208-
indexOf( x, 0.0, 0, { 'dims': ( x: number ): number => x } ); // $ExpectError
194+
indexOf( x, 0.0, { 'dim': '5' } ); // $ExpectError
195+
indexOf( x, 0.0, { 'dim': true } ); // $ExpectError
196+
indexOf( x, 0.0, { 'dim': false } ); // $ExpectError
197+
indexOf( x, 0.0, { 'dim': null } ); // $ExpectError
198+
indexOf( x, 0.0, { 'dim': [] } ); // $ExpectError
199+
indexOf( x, 0.0, { 'dim': {} } ); // $ExpectError
200+
indexOf( x, 0.0, { 'dim': ( x: number ): number => x } ); // $ExpectError
201+
202+
indexOf( x, 0.0, 0, { 'dim': '5' } ); // $ExpectError
203+
indexOf( x, 0.0, 0, { 'dim': true } ); // $ExpectError
204+
indexOf( x, 0.0, 0, { 'dim': false } ); // $ExpectError
205+
indexOf( x, 0.0, 0, { 'dim': null } ); // $ExpectError
206+
indexOf( x, 0.0, 0, { 'dim': [] } ); // $ExpectError
207+
indexOf( x, 0.0, 0, { 'dim': {} } ); // $ExpectError
208+
indexOf( x, 0.0, 0, { 'dim': ( x: number ): number => x } ); // $ExpectError
209209
}
210210

211211
// The compiler throws an error if the function is provided an invalid `keepdims` option...
@@ -295,7 +295,7 @@ import indexOf = require( './index' );
295295
indexOf.assign( ( x: number ): number => x, 0.0, 0, y, {} ); // $ExpectError
296296
}
297297

298-
// The compiler throws an error if the `assign` method is provided a search element argument which is not an ndarray or scalar value...
298+
// The compiler throws an error if the `assign` method is provided a search element argument which is not an ndarray or scalar value having the same "type"...
299299
{
300300
const x = zeros( [ 2, 2 ], {
301301
'dtype': 'float64'
@@ -418,7 +418,7 @@ import indexOf = require( './index' );
418418
indexOf.assign( x, 0.0, 1, y, ( x: number ): number => x ); // $ExpectError
419419
}
420420

421-
// The compiler throws an error if the `assign` method is provided an invalid `dims` option...
421+
// The compiler throws an error if the `assign` method is provided an invalid `dim` option...
422422
{
423423
const x = zeros( [ 2, 2 ], {
424424
'dtype': 'float64'
@@ -427,21 +427,21 @@ import indexOf = require( './index' );
427427
'dtype': 'int32'
428428
});
429429

430-
indexOf.assign( x, 0.0, y, { 'dims': '5' } ); // $ExpectError
431-
indexOf.assign( x, 0.0, y, { 'dims': 5 } ); // $ExpectError
432-
indexOf.assign( x, 0.0, y, { 'dims': true } ); // $ExpectError
433-
indexOf.assign( x, 0.0, y, { 'dims': false } ); // $ExpectError
434-
indexOf.assign( x, 0.0, y, { 'dims': null } ); // $ExpectError
435-
indexOf.assign( x, 0.0, y, { 'dims': {} } ); // $ExpectError
436-
indexOf.assign( x, 0.0, y, { 'dims': ( x: number ): number => x } ); // $ExpectError
437-
438-
indexOf.assign( x, 0.0, 1, y, { 'dims': '5' } ); // $ExpectError
439-
indexOf.assign( x, 0.0, 1, y, { 'dims': 5 } ); // $ExpectError
440-
indexOf.assign( x, 0.0, 1, y, { 'dims': true } ); // $ExpectError
441-
indexOf.assign( x, 0.0, 1, y, { 'dims': false } ); // $ExpectError
442-
indexOf.assign( x, 0.0, 1, y, { 'dims': null } ); // $ExpectError
443-
indexOf.assign( x, 0.0, 1, y, { 'dims': {} } ); // $ExpectError
444-
indexOf.assign( x, 0.0, 1, y, { 'dims': ( x: number ): number => x } ); // $ExpectError
430+
indexOf.assign( x, 0.0, y, { 'dim': '5' } ); // $ExpectError
431+
indexOf.assign( x, 0.0, y, { 'dim': true } ); // $ExpectError
432+
indexOf.assign( x, 0.0, y, { 'dim': false } ); // $ExpectError
433+
indexOf.assign( x, 0.0, y, { 'dim': null } ); // $ExpectError
434+
indexOf.assign( x, 0.0, y, { 'dim': [] } ); // $ExpectError
435+
indexOf.assign( x, 0.0, y, { 'dim': {} } ); // $ExpectError
436+
indexOf.assign( x, 0.0, y, { 'dim': ( x: number ): number => x } ); // $ExpectError
437+
438+
indexOf.assign( x, 0.0, 1, y, { 'dim': '5' } ); // $ExpectError
439+
indexOf.assign( x, 0.0, 1, y, { 'dim': true } ); // $ExpectError
440+
indexOf.assign( x, 0.0, 1, y, { 'dim': false } ); // $ExpectError
441+
indexOf.assign( x, 0.0, 1, y, { 'dim': null } ); // $ExpectError
442+
indexOf.assign( x, 0.0, 1, y, { 'dim': [] } ); // $ExpectError
443+
indexOf.assign( x, 0.0, 1, y, { 'dim': {} } ); // $ExpectError
444+
indexOf.assign( x, 0.0, 1, y, { 'dim': ( x: number ): number => x } ); // $ExpectError
445445
}
446446

447447
// The compiler throws an error if the `assign` method is provided an unsupported number of arguments...

0 commit comments

Comments
 (0)