Skip to content

Commit e992ce2

Browse files
committed
Auto-generated commit
1 parent 58d5c82 commit e992ce2

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.github/.keepalive

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

lib/main.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var isCollection = require( '@stdlib/assert-is-collection' );
2525
var isIteratorLike = require( '@stdlib/assert-is-iterator-like' );
2626
var isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;
2727
var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
28+
var format = require( '@stdlib/string-format' );
2829

2930

3031
// MAIN //
@@ -67,10 +68,10 @@ function iterator2arrayview( iterator, out ) {
6768
var v;
6869

6970
if ( !isIteratorLike( iterator ) ) {
70-
throw new TypeError( 'invalid argument. First argument must be an iterator protocol-compliant object. Value: `' + iterator + '`.' );
71+
throw new TypeError( format( 'invalid argument. First argument must be an iterator protocol-compliant object. Value: `%s`.', iterator ) );
7172
}
7273
if ( !isCollection( out ) ) {
73-
throw new TypeError( 'invalid argument. Second argument must be an array-like object. Value: `' + out + '`.' );
74+
throw new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) );
7475
}
7576
nargs = arguments.length;
7677
if ( nargs === 2 ) {
@@ -108,23 +109,23 @@ function iterator2arrayview( iterator, out ) {
108109
end = arguments[ 3 ];
109110
fcn = arguments[ 4 ];
110111
if ( !isFunction( fcn ) ) {
111-
throw new TypeError( 'invalid argument. Fifth argument must be a callback function. Value: `' + fcn + '`.' );
112+
throw new TypeError( format( 'invalid argument. Fifth argument must be a callback function. Value: `%s`.', fcn ) );
112113
}
113114
}
114115
} else { // nargs > 5
115116
begin = arguments[ 2 ];
116117
end = arguments[ 3 ];
117118
fcn = arguments[ 4 ];
118119
if ( !isFunction( fcn ) ) {
119-
throw new TypeError( 'invalid argument. Fifth argument must be a callback function. Value: `' + fcn + '`.' );
120+
throw new TypeError( format( 'invalid argument. Fifth argument must be a callback function. Value: `%s`.', fcn ) );
120121
}
121122
thisArg = arguments[ 5 ];
122123
}
123124
if ( !isInteger( begin ) ) {
124-
throw new TypeError( 'invalid argument. Third argument must be either an integer (starting index) or a callback function. Value: `' + begin + '`.' );
125+
throw new TypeError( format( 'invalid argument. Third argument must be either an integer (starting index) or a callback function. Value: `%s`.', begin ) );
125126
}
126127
if ( !isInteger( end ) ) {
127-
throw new TypeError( 'invalid argument. Fourth argument must be either an integer (ending index) or a callback function. Value: `' + end + '`.' );
128+
throw new TypeError( format( 'invalid argument. Fourth argument must be either an integer (ending index) or a callback function. Value: `%s`.', end ) );
128129
}
129130
if ( end < 0 ) {
130131
end = out.length + end;

package.json

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

0 commit comments

Comments
 (0)