Skip to content

Commit 11d0e3d

Browse files
committed
refactor: replace internal 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent eae38b8 commit 11d0e3d

2 files changed

Lines changed: 5 additions & 55 deletions

File tree

lib/node_modules/@stdlib/blas/ext/unitspace/lib/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
3232
var isOrder = require( '@stdlib/ndarray/base/assert/is-order' );
3333
var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' );
3434
var nonCoreShape = require( '@stdlib/ndarray/base/complement-shape' );
35+
var resolveOrder = require( '@stdlib/ndarray/base/output-order' );
3536
var resolveStr = require( '@stdlib/ndarray/base/dtype-resolve-str' );
3637
var getDType = require( '@stdlib/ndarray/base/dtype' );
3738
var empty = require( '@stdlib/ndarray/empty' );
@@ -41,7 +42,6 @@ var format = require( '@stdlib/string/format' );
4142
var DTYPES = require( './dtypes.js' );
4243
var ENUMS = require( './type_enums.js' );
4344
var resolveDataType = require( './resolve_data_type.js' );
44-
var resolveOrder = require( './resolve_order.js' );
4545
var normalizeArgument = require( './normalize_argument.js' );
4646
var defaults = require( './defaults.js' );
4747
var base = require( './base.js' );
@@ -79,6 +79,7 @@ function unitspace( shape, start ) {
7979
var type;
8080
var opts;
8181
var ncsh;
82+
var arrs;
8283
var arg;
8384
var out;
8485
var sh;
@@ -91,6 +92,7 @@ function unitspace( shape, start ) {
9192
} else {
9293
throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', shape ) );
9394
}
95+
arrs = [];
9496
if ( isNumber( start ) ) {
9597
type = ENUMS.NUMBER;
9698
} else if ( isComplexLike( start ) ) {
@@ -101,6 +103,7 @@ function unitspace( shape, start ) {
101103
if ( !contains( DTYPES.idtypes0, dt ) ) {
102104
throw new TypeError( format( 'invalid argument. Second argument must have one of the following data types: "%s". Data type: `%s`.', join( DTYPES.idtypes0, '", "' ), dt ) );
103105
}
106+
arrs.push( start );
104107
} else {
105108
throw new TypeError( format( 'invalid argument. Second argument must be either a number, complex number, or an ndarray. Value: `%s`.', start ) );
106109
}
@@ -145,7 +148,7 @@ function unitspace( shape, start ) {
145148
dtypes[ 1 ] = options.dtype;
146149

147150
// Resolve the output array order:
148-
options.order = options.order || resolveOrder( start, type );
151+
options.order = options.order || resolveOrder( arrs );
149152

150153
// Resolve the complement of the operation dimensions:
151154
ncsh = nonCoreShape( sh, options.dims );

lib/node_modules/@stdlib/blas/ext/unitspace/lib/resolve_order.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)