8000 Transform error messages · stdlib-js/utils-async-compose@04f261f · GitHub
[go: up one dir, main page]

Skip to content

Commit 04f261f

Browse files
committed
Transform error messages
1 parent cf56b02 commit 04f261f

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
@@ -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 //
@@ -74,13 +74,13 @@ function composeAsync() {
7474
var i;
7575
nFuncs = arguments.length;
7676
if ( nFuncs < 2 ) {
77-
throw new Error( 'insufficient arguments. Must provide multiple functions to compose.' );
77+
throw new Error( format('1Qv1Y') );
7878
}
7979
f = new Array( nFuncs );
8080
for ( i = 0; i < nFuncs; i++ ) {
8181
f[ i ] = arguments[ i ];
8282
if ( !isFunction( f[ i ] ) ) {
83-
throw new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );
83+
throw new TypeError( format( '1QvAj', f[ i ] ) );
8484
}
8585
}
8686
return composite;

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