10000 Auto-generated commit · stdlib-js/array-from-iterator@c5c2f9b · GitHub
[go: up one dir, main page]

Skip to content

Commit c5c2f9b

Browse files
committed
Auto-generated commit
1 parent 28f409c commit c5c2f9b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var isFunction = require( '@stdlib/assert-is-function' );
2424
var isCollection = require( '@stdlib/assert-is-collection' );
2525
var isIteratorLike = require( '@stdlib/assert-is-iterator-like' );
2626
var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
27+
var format = require( '@stdlib/string-format' );
2728

2829

2930
// MAIN //
@@ -66,20 +67,20 @@ function iterator2array() {
6667
if ( arguments.length > 2 ) {
6768
fcn = arguments[ 2 ];
6869
if ( !isFunction( fcn ) ) {
69-
throw new TypeError( 'invalid argument. Callback argument must be a function. Value: `' + fcn + '`.' );
70+
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', fcn ) );
7071
}
7172
thisArg = arguments[ 3 ];
7273
}
7374
} else {
7475
fcn = arguments[ 1 ];
7576
if ( !isFunction( fcn ) ) {
76-
throw new TypeError( 'invalid argument. Callback argument must be a function. Value: `' + fcn + '`.' );
77+
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', fcn ) );
7778
}
7879
thisArg = arguments[ 2 ];
7980
}
8081
}
8182
if ( !isIteratorLike( iterator ) ) {
82-
throw new TypeError( 'invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `' + iterator + '`.' );
83+
throw new TypeError( format( 'invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.', iterator ) );
8384
}
8485
i = -1;
8586
if ( out === void 0 ) {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@stdlib/assert-is-collection": "^0.0.x",
4242
"@stdlib/assert-is-function": "^0.0.x",
4343
"@stdlib/assert-is-iterator-like": "^0.0.x",
44+
"@stdlib/string-format": "^0.0.x",
4445
"@stdlib/types": "^0.0.x"
4546
},
4647
"devDependencies": {

0 commit comments

Comments
 (0)
0