Skip to content

Commit 53de942

Browse files
committed
refactor: use base assertion utility
--- 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 4bd27a3 commit 53de942

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/node_modules/@stdlib/ndarray/base/shape2strides/lib/assign.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
24+
25+
2126
// FUNCTIONS //
2227

2328
/**
@@ -86,7 +91,7 @@ function columnmajor( shape, out ) {
8691
* // returns [ 1, 3 ]
8792
*/
8893
function shape2strides( shape, order, out ) {
89-
if ( order === 'column-major' ) {
94+
if ( isColumnMajor( order ) ) {
9095
return columnmajor( shape, out );
9196
}
9297
return rowmajor( shape, out );

lib/node_modules/@stdlib/ndarray/base/shape2strides/lib/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
24+
25+
2126
// FUNCTIONS //
2227

2328
/**
@@ -85,7 +90,7 @@ function columnmajor( shape ) {
8590
* // returns [ 1, 3 ]
8691
*/
8792
function shape2strides( shape, order ) {
88-
if ( order === 'column-major' ) {
93+
if ( isColumnMajor( order ) ) {
8994
return columnmajor( shape );
9095
}
9196
return rowmajor( shape );

0 commit comments

Comments
 (0)