Skip to content

Commit e4685d4

Browse files
committed
Transform error messages
1 parent 6c5caf5 commit e4685d4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/main.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var iteratorSymbol = require( '@stdlib/symbol-iterator' );
2929
var accessorGetter = require( '@stdlib/array-base-accessor-getter' );
3030
var getter = require( '@stdlib/array-base-getter' );
3131
var dtype = require( '@stdlib/array-dtype' );
32-
var format = require( '@stdlib/string-format' );
32+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3333

3434

3535
// MAIN //
@@ -72,7 +72,7 @@ function arrayview2iterator( src ) {
7272
var dt;
7373
var i;
7474
if ( !isCollection( src ) ) {
75-
throw new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', src ) );
75+
throw new TypeError( format( '01l2O', src ) );
7676
}
7777
nargs = arguments.length;
7878
if ( nargs === 1 ) {
@@ -105,15 +105,15 @@ function arrayview2iterator( src ) {
105105
end = arguments[ 2 ];
106106
fcn = arguments[ 3 ];
107107
if ( !isFunction( fcn ) ) {
108-
throw new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', fcn ) );
108+
throw new TypeError( format( '01l32', fcn ) );
109109
}
110110
thisArg = arguments[ 4 ];
111111
}
112112
if ( !isInteger( begin ) ) {
113-
throw new TypeError( format( 'invalid argument. Second argument must be either an integer (starting index) or a function. Value: `%s`.', begin ) );
113+
throw new TypeError( format( '01lE7', begin ) );
114114
}
115115
if ( !isInteger( end ) ) {
116-
throw new TypeError( format( 'invalid argument. Third argument must be either an integer (ending index) or a function. Value: `%s`.', end ) );
116+
throw new TypeError( format( '01lE8', end ) );
117117
}
118118
if ( end < 0 ) {
119119
end = src.length + end;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@stdlib/assert-is-collection": "^0.2.2",
4545
"@stdlib/assert-is-function": "^0.2.2",
4646
"@stdlib/assert-is-integer": "^0.2.2",
47-
"@stdlib/string-format": "^0.2.2",
47+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4848
"@stdlib/symbol-iterator": "^0.2.2",
4949
"@stdlib/types": "^0.4.3",
5050
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",

0 commit comments

Comments
 (0)