Skip to content

Commit e4c2567

Browse files
committed
fix: apply suggestions from code review
--- 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: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent c9d34ee commit e4c2567

File tree

1 file changed

+16
-5
lines changed
  • lib/node_modules/@stdlib/blas/ext/index-of/lib

1 file changed

+16
-5
lines changed

lib/node_modules/@stdlib/blas/ext/index-of/lib/base.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ var table = {
6161
* @name indexOf
6262
* @type {Function}
6363
* @param {ndarrayLike} x - input ndarray
64-
* @param {(ndarrayLike|number)} searchElement - search element
65-
* @param {(ndarrayLike|number)} [fromIndex] - index from which to begin searching
64+
* @param {ndarrayLike} searchElement - search element
65+
* @param {ndarrayLike} fromIndex - indices from which to begin searching
6666
* @param {Options} [options] - function options
6767
* @param {IntegerArray} [options.dims] - list of dimensions over which to perform operation
6868
* @param {string} [options.dtype] - output ndarray data type
6969
* @throws {TypeError} first argument must be an ndarray-like object
70-
* @throws {TypeError} search element argument must be either an ndarray-like object or a scalar value
71-
* @throws {TypeError} from index argument must be either an ndarray-like object or a scalar value
70+
* @throws {TypeError} second argument must be either an ndarray-like object
71+
* @throws {TypeError} third argument must be either an ndarray-like object
7272
* @throws {TypeError} options argument must be an object
7373
* @throws {RangeError} dimension indices must not exceed input ndarray bounds
7474
* @throws {RangeError} number of dimension indices must not exceed the number of input ndarray dimensions
@@ -77,6 +77,7 @@ var table = {
7777
*
7878
* @example
7979
* var Float64Array = require( '@stdlib/array/float64' );
80+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
8081
* var ndarray = require( '@stdlib/ndarray/ctor' );
8182
*
8283
* // Create a data buffer:
@@ -94,8 +95,18 @@ var table = {
9495
* // Create an input ndarray:
9596
* var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
9697
*
98+
* // Create a search element ndarray:
99+
* var searchElement = scalar2ndarray( 4.0, {
100+
* 'dtype': 'float64'
101+
* })
102+
*
103+
* // Create a from index ndarray:
104+
* var fromIndex = scalar2ndarray( 0, {
105+
* 'dtype': 'int32'
106+
* })
107+
*
97108
* // Find index:
98-
* var out = indexOf( x, 4.0 );
109+
* var out = indexOf( x, searchElement, fromIndex );
99110
* // returns <ndarray>
100111
*
101112
* var idx = out.get();

0 commit comments

Comments
 (0)