Skip to content

Commit 3088dea

Browse files
committed
test: fix lint errors
--- 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: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent b9d3f03 commit 3088dea

File tree

1 file changed

+3
-29
lines changed
  • lib/node_modules/@stdlib/ndarray/dispatch/docs/types

1 file changed

+3
-29
lines changed

lib/node_modules/@stdlib/ndarray/dispatch/docs/types/test.ts

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* limitations under the License.
1717
*/
1818

19-
/* eslint-disable max-lines */
19+
/* eslint-disable max-lines, prefer-const */
2020

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

2323
import { ndarray } from '@stdlib/types/ndarray';
24-
import { ArrayLike } from '@stdlib/types/array';
24+
import ind2sub = require( '@stdlib/ndarray/ind2sub' );
2525
import dispatch = require( './index' );
2626

2727

@@ -82,31 +82,6 @@ function quaternary( x: number, y: number, z: number, w: number ): number {
8282
return x + y + z + w;
8383
}
8484

85-
/**
86-
* Mock `ind2sub` function.
87-
*
88-
* @param shape - dimensions
89-
* @param idx - linear index
90-
* @param opts - options
91-
* @returns subscripts
92-
*/
93-
function ind2sub( shape: ArrayLike<number>, idx: number, opts?: any ): Array<number> {
94-
let out;
95-
let i;
96-
97-
out = [];
98-
if ( typeof opts === 'object' && opts !== null && opts.order === 'row-major' ) { no-unsafe-any
99-
for ( i = 0; i < shape.length; i += 1 ) {
100-
out.push( idx % shape[ i ] );
101-
}
102-
} else {
103-
for ( i = 0; i < shape.length; i += 1 ) {
104-
out.push( idx % shape[ i ] );
105-
}
106-
}
107-
return out;
108-
}
109-
11085
/**
11186
* Mock ndarray function.
11287
*
@@ -138,9 +113,8 @@ function ndarrayFcn( arrays: Array<ndarray>, fcn: ( x: any ) => any ): void {
138113
xord = x.order;
139114
yord = y.order;
140115
opts = {
141-
'order': ''
116+
'order': xord
142117
};
143-
opts.order = xord;
144118
for ( i = 0; i < N; i += 1 ) {
145119
// Convert a linear index to subscripts:
146120
opts.order = xord;

0 commit comments

Comments
 (0)