File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ var isFunction = require( '@stdlib/assert-is-function' );
24
24
var isCollection = require ( '@stdlib/assert-is-collection' ) ;
25
25
var isIteratorLike = require ( '@stdlib/assert-is-iterator-like' ) ;
26
26
var arraylike2object = require ( '@stdlib/array-base-arraylike2object' ) ;
27
+ var format = require ( '@stdlib/string-format' ) ;
27
28
28
29
29
30
// MAIN //
@@ -66,20 +67,20 @@ function iterator2array() {
66
67
if ( arguments . length > 2 ) {
67
68
fcn = arguments [ 2 ] ;
68
69
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 ) ) ;
70
71
}
71
72
thisArg = arguments [ 3 ] ;
72
73
}
73
74
} else {
74
75
fcn = arguments [ 1 ] ;
75
76
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 ) ) ;
77
78
}
78
79
thisArg = arguments [ 2 ] ;
79
80
}
80
81
}
81
82
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 ) ) ;
83
84
}
84
85
i = - 1 ;
85
86
if ( out === void 0 ) {
Original file line number Diff line number Diff line change 41
41
"@stdlib/assert-is-collection" : " ^0.0.x" ,
42
42
"@stdlib/assert-is-function" : " ^0.0.x" ,
43
43
"@stdlib/assert-is-iterator-like" : " ^0.0.x" ,
44
+ "@stdlib/string-format" : " ^0.0.x" ,
44
45
"@stdlib/types" : " ^0.0.x"
45
46
},
46
47
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments