Skip to content

Commit cd34a2e

Browse files
committed
Transform error messages
1 parent 27eef48 commit cd34a2e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/main.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var getOrder = require( '@stdlib/ndarray-order' );
3333
var numel = require( '@stdlib/ndarray-base-numel' );
3434
var nextCartesianIndex = require( '@stdlib/ndarray-base-next-cartesian-index' ).assign;
3535
var gcopy = require( '@stdlib/blas-base-gcopy' );
36-
var format = require( '@stdlib/string-format' );
36+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3737

3838

3939
// MAIN //
@@ -96,7 +96,7 @@ function filterMap( x, options, fcn, thisArg ) {
9696
var v;
9797
var i;
9898
if ( !isndarrayLike( x ) ) {
99-
throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
99+
throw new TypeError( format( 'null5t', x ) );
100100
}
101101
if ( arguments.length < 3 ) {
102102
clbk = options;
@@ -116,11 +116,11 @@ function filterMap( x, options, fcn, thisArg ) {
116116
ctx = thisArg;
117117
}
118118
if ( !isFunction( clbk ) ) {
119-
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );
119+
throw new TypeError( format( 'null2b', clbk ) );
120120
}
121121
if ( hasOpts ) {
122122
if ( !isPlainObject( opts ) ) {
123-
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );
123+
throw new TypeError( format( 'null2V', opts ) );
124124
}
125125
if ( hasOwnProp( opts, 'dtype' ) ) {
126126
dt = opts.dtype;
@@ -129,7 +129,7 @@ function filterMap( x, options, fcn, thisArg ) {
129129
}
130130
if ( hasOwnProp( opts, 'order' ) ) {
131131
if ( !isOrder( opts.order ) ) {
132-
throw new TypeError( format( 'invalid option. `%s` option must be a recognized order. Option: `%s`.', 'order', opts.order ) );
132+
throw new TypeError( format( 'null5C', 'order', opts.order ) );
133133
}
134134
ord = opts.order;
135135
}
@@ -140,7 +140,7 @@ function filterMap( x, options, fcn, thisArg ) {
140140
ctor = ctors( dt );
141141
if ( ctor === null ) {
142142
// The only way we should get here is if the user provided an unsupported data type, as `getDType` should error if the input array has an unrecognized/unsupported data type...
143-
throw new TypeError( format( 'invalid option. `%s` option must be a recognized data type. Option: `%s`.', 'dtype', opts.dtype ) );
143+
throw new TypeError( format( 'nullBf', 'dtype', opts.dtype ) );
144144
}
145145
// Resolve the iteration order:
146146
if ( ord === void 0 ) {

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)