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

Skip to content

Commit 290e2c4

Browse files
committed
Transform error messages
1 parent 1b1a537 commit 290e2c4

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 //
@@ -58,13 +58,13 @@ function compose() {
5858
var i;
5959
nFuncs = arguments.length;
6060
if ( nFuncs < 2 ) {
61-
throw new Error( 'insufficient arguments. Must provide multiple functions to compose.' );
61+
throw new Error( format('1SB1Y') );
6262
}
6363
f = new Array( nFuncs );
6464
for ( i = 0; i < nFuncs; i++ ) {
6565
f[ i ] = arguments[ i ];
6666
if ( !isFunction( f[ i ] ) ) {
67-
throw new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );
67+
throw new TypeError( format( '1SBAj', f[ i ] ) );
6868
}
6969
}
7070
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