Skip to content

Commit a6bf935

Browse files
committed
Transform error messages
1 parent a2027d5 commit a6bf935

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 allocUnsafe = require( '@stdlib/buffer-alloc-unsafe' );
3030
var numel = require( '@stdlib/ndarray-base-numel' );
3131
var ndarray = require( '@stdlib/ndarray-ctor' );
3232
var defaults = require( '@stdlib/ndarray-defaults' );
33-
var format = require( '@stdlib/string-format' );
33+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3434

3535

3636
// VARIABLES //
@@ -82,7 +82,7 @@ function empty( shape ) {
8282
if ( arguments.length > 1 ) {
8383
options = arguments[ 1 ];
8484
if ( !isPlainObject( options ) ) {
85-
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
85+
throw new TypeError( format( '1db2V', options ) );
8686
}
8787
if ( hasOwnProp( options, 'dtype' ) ) {
8888
dtype = options.dtype;
@@ -109,14 +109,14 @@ function empty( shape ) {
109109
} else if ( isArrayLike( shape ) ) {
110110
sh = shape;
111111
} else {
112-
throw new TypeError( format( 'invalid argument. First argument must be either a nonnegative integer or an array of nonnegative integers. Value: `%s`.', shape ) );
112+
throw new TypeError( format( '1db5s', shape ) );
113113
}
114114
ndims = sh.length;
115115
if ( ndims > 0 ) {
116116
len = numel( sh );
117117
if ( len !== len || len < 0 ) {
118118
// We should only get here if we've been provided an invalid shape (e.g., an array containing negative integers, etc)...
119-
throw new TypeError( format( 'invalid argument. First argument must be either a nonnegative integer or an array of nonnegative integers. Value: `%s`.', shape ) );
119+
throw new TypeError( format( '1db5s', shape ) );
120120
}
121121
st = shape2strides( sh, order );
122122
} else {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@stdlib/ndarray-base-strides2offset": "^0.2.1",
4848
"@stdlib/ndarray-ctor": "^0.2.1",
4949
"@stdlib/ndarray-defaults": "^0.2.1",
50-
"@stdlib/string-format": "^0.2.1",
50+
"@stdlib/error-tools-fmtprodmsg": "^0.2.1",
5151
"@stdlib/types": "^0.3.2",
5252
"@stdlib/error-tools-fmtprodmsg": "^0.2.1"
5353
},

0 commit comments

Comments
 (0)