8000 Transform error messages · stdlib-js/array-from-iterator@65a3379 · GitHub
[go: up one dir, main page]

Skip to content

Commit 65a3379

Browse files
committed
Transform error messages
1 parent 00914e4 commit 65a3379

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
@@ -27,7 +27,7 @@ var isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );
2727
var accessorSetter = require( '@stdlib/array-base-accessor-setter' );
2828
var setter = require( '@stdlib/array-base-setter' );
2929
var dtype = require( '@stdlib/array-dtype' );
30-
var format = require( '@stdlib/string-format' );
30+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3131

3232

3333
// MAIN //
@@ -71,20 +71,20 @@ function iterator2array() {
7171
if ( arguments.length > 2 ) {
7272
fcn = arguments[ 2 ];
7373
if ( !isFunction( fcn ) ) {
74-
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', fcn ) );
74+
throw new TypeError( format( '00p2b', fcn ) );
7575
}
7676
thisArg = arguments[ 3 ];
7777
}
7878
} else {
7979
fcn = arguments[ 1 ];
8080
if ( !isFunction( fcn ) ) {
81-
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', fcn ) );
81+
throw new TypeError( format( '00p2b', fcn ) );
8282
}
8383
thisArg = arguments[ 2 ];
8484
}
8585
}
8686
if ( !isIteratorLike( iterator ) ) {
87-
throw new TypeError( format( 'invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.', iterator ) );
87+
throw new TypeError( format( '00p2c', iterator ) );
8888
}
8989
i = -1;
9090
if ( out === void 0 ) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@stdlib/assert-is-collection": "^0.2.2"< 5F93 /span>,
4545
"@stdlib/assert-is-function": "^0.2.2",
4646
"@stdlib/assert-is-iterator-like": "^0.2.2",
47-
"@stdlib/string-format": "^0.2.2",
47+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4848
"@stdlib/types": "^0.4.3",
4949
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
5050
},

0 commit comments

Comments
 (0)
0