Skip to content

Commit 33834bf

Browse files
committed
Transform error messages
1 parent 7e4e2db commit 33834bf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/main.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var zeros = require( '@stdlib/array-base-zeros' );
3030
var getShape = require( '@stdlib/ndarray-shape' );
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 nditerValues( x ) {
7878
var i;
7979

8080
if ( !isndarrayLike( x ) ) {
81-
throw new TypeError( format( 'invalid argument. First argument must be an ndarray. Value: `%s`.', x ) );
81+
throw new TypeError( format( '1k14f', x ) );
8282
}
8383
opts = {
8484
'order': x.order
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( '1k12V', 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( '1k15C', 'order', options.order ) );
9494
}
9595
opts.order = options.order;
9696
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@stdlib/ndarray-base-next-cartesian-index": "^0.2.2",
4646
"@stdlib/ndarray-base-numel": "^0.2.2",
4747
"@stdlib/ndarray-shape": "^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.3",
5151
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",

0 commit comments

Comments
 (0)