8000 Transform error messages · stdlib-js/utils-async-if-then@cd39368 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd39368

Browse files
committed
Transform error messages
1 parent b680ac8 commit cd39368

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var isFunction = require( '@stdlib/assert-is-function' );
24-
var format = require( '@stdlib/string-format' );
24+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2525

2626

2727
// MAIN //
@@ -72,16 +72,16 @@ var format = require( '@stdlib/string-format' );
7272
*/
7373
function ifthenAsync( predicate, x, y, done ) {
7474
if ( !isFunction( predicate ) ) {
75-
throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );
75+
throw new TypeError( format( '1RH3c', predicate ) );
7676
}
7777
if ( !isFunction( x ) ) {
78-
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', x ) );
78+
throw new TypeError( format( '1RH2H', x ) );
7979
}
8080
if ( !isFunction( y ) ) {
81-
throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', y ) );
81+
throw new TypeError( format( '1RH3N', y ) );
8282
}
8383
if ( !isFunction( done ) ) {
84-
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
84+
throw new TypeError( format( '1RH3q', done ) );
8585
}
8686
predicate( clbk1 );
8787

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"dependencies": {
4040
"@stdlib/assert-is-function": "^0.2.2",
41-
"@stdlib/string-format": "^0.2.2",
41+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4242
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
4343
},
4444
"devDependencies": {

0 commit comments

Comments
 (0)
0