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

Skip to content

Commit 55c391a

Browse files
committed
Transform error messages
1 parent 9a84949 commit 55c391a

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
@@ -31,7 +31,7 @@ var iteratorSymbol = require( '@stdlib/symbol-iterator' );
3131
var zeros = require( '@stdlib/array-base-zeros' );
3232
var numel = require( '@stdlib/ndarray-base-numel' );
3333
var nextCartesianIndex = require( '@stdlib/ndarray-base-next-cartesian-index' ).assign;
34-
var format = require( '@stdlib/string-format' );
34+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3535

3636

3737
// MAIN //
@@ -79,19 +79,19 @@ function nditerIndices( shape ) {
7979
var i;
8080

8181
if ( !isCollection( shape ) ) {
82-
throw new TypeError( format( 'invalid argument. First argument must be an array of nonnegative integers. Value: `%s`.', shape ) );
82+
throw new TypeError( format( '1jtF5', shape ) );
8383
}
8484
opts = {
8585
'order': 'row-major'
8686
};
8787
if ( arguments.length > 1 ) {
8888
options = arguments[ 1 ];
8989
if ( !isPlainObject( options ) ) {
90-
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
90+
throw new TypeError( format( '1jt2V', options ) );
9191
}
9292
if ( hasOwnProp( options, 'order' ) ) {
9393
if ( !isOrder( options.order ) ) {
94-
throw new TypeError( format( 'invalid option. `%s` option must be a recognized order. Option: `%s`.', 'order', options.order ) );
94+
throw new TypeError( format( '1jt5C', 'order', options.order ) );
9595
}
9696
opts.order = options.order;
9797
}
@@ -103,7 +103,7 @@ function nditerIndices( shape ) {
103103
sh = [];
104104
for ( i = 0; i < ndims; i++ ) {
105105
if ( !isNonNegativeInteger( shape[ i ] ) ) {
106-
throw new TypeError( format( 'invalid argument. First argument must be an array of nonnegative integers. Value: `%s`.', shape ) );
106+
throw new TypeError( format( '1jtF5', shape ) );
107107
}
108108
sh.push( shape[ i ] );
109109
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@stdlib/ndarray-base-assert-is-row-major-string": "github:stdlib-js/ndarray-base-assert-is-row-major-string#main",
4747
"@stdlib/ndarray-base-next-cartesian-index": "^0.2.2",
4848
"@stdlib/ndarray-base-numel": "^0.2.2",
49-
"@stdlib/string-format": "^0.2.2",
49+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
5050
"@stdlib/symbol-iterator": "^0.2.2",
5151
"@stdlib/types": "^0.4.3",
5252
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",

0 commit comments

Comments
 (0)
0