10000 Transform error messages · stdlib-js/ndarray-iter-values@ceb502c · GitHub
[go: up one dir, main page]

Skip to content

Commit ceb502c

Browse files
committed
Transform error messages
1 parent 2130201 commit ceb502c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var zeros = require( '@stdlib/array-base-zeros' );
3131
var getShape = require( '@stdlib/ndarray-shape' );
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 nditerValues( x ) {
7979
var i;
8080

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@stdlib/ndarray-base-next-cartesian-index": "^0.2.2",
4747
"@stdlib/ndarray-base-numel": "^0.2.2",
4848
"@stdlib/ndarray-shape": "^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