Skip to content

Commit 883b0db

Browse files
committed
Transform error messages
1 parent 76e6c20 commit 883b0db

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var isnan = require( '@stdlib/assert-is-nan' );
2424
var isCollection = require( '@stdlib/assert-is-collection' );
2525
var isString = require( '@stdlib/assert-is-string' ).isPrimitive;
2626
var isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;
27-
var format = require( '@stdlib/string-format' );
27+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2828

2929

3030
// MAIN //
@@ -86,15 +86,15 @@ function indexOf( arr, searchElement, fromIndex ) {
8686
var len;
8787
var i;
8888
if ( !isCollection( arr ) && !isString( arr ) ) {
89-
throw new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );
89+
throw new TypeError( format( '1UR2O', arr ) );
9090
}
9191
len = arr.length;
9292
if ( len === 0 ) {
9393
return -1;
9494
}
9595
if ( arguments.length === 3 ) {
9696
if ( !isInteger( fromIndex ) ) {
97-
throw new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );
97+
throw new TypeError( format( '1UR2z', fromIndex ) );
9898
}
9999
if ( fromIndex >= 0 ) {
100100
if ( fromIndex >= len ) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@stdlib/assert-is-integer": "^0.2.2",
4242
"@stdlib/assert-is-nan": "^0.2.2",
4343
"@stdlib/assert-is-string": "^0.2.2",
44-
"@stdlib/string-format": "^0.2.2",
44+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4545
"@stdlib/types": "^0.4.1",
4646
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
4747
},

0 commit comments

Comments
 (0)