Skip to content

Commit d13a0fc

Browse files
committed
refactor: remove unreachable path
The only way for there to be more dimension indices than dims is if a user provides duplicate indices. However, that will already be caught by another check earlier, making the removed branch unreachable. --- 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 ce50d3e commit d13a0fc

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lib/node_modules/@stdlib/ndarray/every/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var validate = require( './validate.js' );
5353
* @throws {TypeError} first argument must be an ndarray-like object
5454
* @throws {TypeError} options argument must be an object
5555
* @throws {RangeError} dimension indices must not exceed input ndarray bounds
56-
* @throws {RangeError} number of dimension indices must not exceed the number of input ndarray dimensions
56+
* @throws {Error} dimension indices must be unique
5757
* @throws {Error} must provide valid options
5858
* @returns {ndarray} output ndarray
5959
*

lib/node_modules/@stdlib/ndarray/every/lib/validate.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ function validate( opts, ndims, options ) {
7676
if ( tmp.length !== opts.dims.length ) {
7777
return new Error( format( 'invalid option. `%s` option contains duplicate indices. Option: [%s].', 'dims', join( opts.dims, ',' ) ) );
7878
}
79-
if ( tmp.length > ndims ) {
80-
return new RangeError( format( 'invalid option. `%s` option specifies more dimensions than exists in the input array. Number of dimensions: %d. Option: [%s].', 'dims', ndims, join( opts.dims, ',' ) ) );
81-
}
8279
opts.dims = tmp;
8380
}
8481
return null;

0 commit comments

Comments
 (0)