8000 Transform error messages · stdlib-js/utils-while-each@faeaf5f · GitHub
[go: up one dir, main page]

Skip to content

Commit faeaf5f

Browse files
committed
Transform error messages
1 parent 7b122f4 commit faeaf5f

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
@@ -22,7 +22,7 @@
2222

2323
var isCollection = require( '@stdlib/assert-is-collection' );
2424
var isFunction = require( '@stdlib/assert-is-function' );
25-
var format = require( '@stdlib/string-format' );
25+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2626

2727

2828
// MAIN //
@@ -56,13 +56,13 @@ function whileEach( collection, predicate, fcn, thisArg ) {
5656
var len;
5757
var i;
5858
if ( !isCollection( collection ) ) {
59-
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
59+
throw new TypeError( format( '1YRAh', collection ) );
6060
}
6161
if ( !isFunction( predicate ) ) {
62-
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );
62+
throw new TypeError( format( '1YR2H', predicate ) );
6363
}
6464
if ( !isFunction( fcn ) ) {
65-
throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );
65+
throw new TypeError( format( '1YR3N', fcn ) );
6666
}
6767
len = collection.length;
6868
i = 0;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"dependencies": {
4040
"@stdlib/assert-is-collection": "^0.2.2",
4141
"@stdlib/assert-is-function": "^0.2.2",
42-
"@stdlib/string-format": "^0.2.2",
42+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4343
"@stdlib/types": "^0.4.3",
4444
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
4545
},

0 commit comments

Comments
 (0)
0