8000 Transform error messages · stdlib-js/ndarray-iter-indices@33eec7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 33eec7a

Browse files
committed
Transform error messages
1 parent 89b059f commit 33eec7a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var iteratorSymbol = require( '@stdlib/symbol-iterator' );
3030
var zeros = require( '@stdlib/array-base-zeros' );
3131
var numel = require( '@stdlib/ndarray-base-numel' );
3232
var nextCartesianIndex = require( '@stdlib/ndarray-base-next-cartesian-index' ).assign;
33-
var format = require( '@stdlib/string-format' );
33+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3434

3535

3636
// MAIN //
@@ -78,19 +78,19 @@ function nditerIndices( shape ) {
7878
var i;
7979

8080
if ( !isCollection( shape ) ) {
81-
throw new TypeError( format( 'invalid argument. First argument must be an array of nonnegative integers. Value: `%s`.', shape ) );
81+
throw new TypeError( format( '1jtF5', shape ) );
8282
}
8383
opts = {
8484
'order': 'row-major'
8585
};
8686
if ( arguments.length > 1 ) {
8787
options = arguments[ 1 ];
8888
if ( !isPlainObject( options ) ) {
89-
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
89+
throw new TypeError( format( '1jt2V', options ) );
9090
}
9191
if ( hasOwnProp( options, 'order' ) ) {
9292
if ( !isOrder( options.order ) ) {
93-
throw new TypeError( format( 'invalid option. `%s` option must be a recognized order. Option: `%s`.', 'order', options.order ) );
93+
throw new TypeError( format( '1jt5C', 'order', options.order ) );
9494
}
9595
opts.order = options.order;
9696
}
@@ -102,7 +102,7 @@ function nditerIndices( shape ) {
102102
sh = [];
103103
for ( i = 0; i < ndims; i++ ) {
104104
if ( !isNonNegativeInteger( shape[ i ] ) ) {
105-
throw new TypeError( format( 'invalid argument. First argument must be an array of nonnegative integers. Value: `%s`.', shape ) );
105+
throw new TypeError( format( '1jtF5', shape ) );
106106
}
107107
sh.push( shape[ i ] );
108108
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@stdlib/ndarray-base-assert-is-order": "^0.2.2",
4646
"@stdlib/ndarray-base-next-cartesian-index": "^0.2.2",
4747
"@stdlib/ndarray-base-numel": "^0.2.2",
48-
"@stdlib/string-format": "^0.2.2",
48+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4949
"@stdlib/symbol-iterator": "^0.2.2",
5050
"@stdlib/types": "^0.4.1",
5151
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",

0 commit comments

Comments
 (0)
0