Skip to content

Commit de2703a

Browse files
committed
Transform error messages
1 parent a614894 commit de2703a

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
@@ -33,7 +33,7 @@ var getOrder = require( '@stdlib/ndarray-order' );
3333
var ndarray = require( '@stdlib/ndarray-ctor' );
3434
var emptyArray = require( '@stdlib/array-empty' );
3535
var allocUnsafe = require( '@stdlib/buffer-alloc-unsafe' );
36-
var format = require( '@stdlib/string-format' );
36+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3737

3838

3939
// MAIN //
@@ -83,13 +83,13 @@ function emptyLike( x ) {
8383
var sh;
8484

8585
if ( !isndarrayLike( x ) ) {
86-
throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
86+
throw new TypeError( format( '1dZ5t', x ) );
8787
}
8888
opts = {};
8989
if ( arguments.length > 1 ) {
9090
options = arguments[ 1 ];
9191
if ( !isPlainObject( options ) ) {
92-
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
92+
throw new TypeError( format( '1dZ2V', options ) );
9393
}
9494
if ( hasOwnProp( options, 'dtype' ) ) {
9595
dtype = options.dtype;
@@ -102,7 +102,7 @@ function emptyLike( x ) {
102102
sh = [ sh ];
103103
}
104104
if ( !isNonNegativeIntegerArray( sh ) ) {
105-
throw new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer or an array of nonnegative integers. Option: `%s`.', 'shape', sh ) );
105+
throw new TypeError( format( '1dZDs', 'shape', sh ) );
106106
}
107107
} else {
108108
sh = getShape( x );

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@stdlib/ndarray-dtype": "^0.2.2",
5151
"@stdlib/ndarray-order": "^0.2.2",
5252
"@stdlib/ndarray-shape": "^0.2.2",
53-
"@stdlib/string-format": "^0.2.2",
53+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
5454
"@stdlib/types": "^0.4.3",
5555
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
5656
},

0 commit comments

Comments
 (0)