Skip to content

Commit 45f9567

Browse files
committed
Auto-generated commit
1 parent 14d1fa5 commit 45f9567

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/assign.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var isComplexLike = require( '@stdlib/assert-is-complex-like' );
2424
var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;
2525
var isCollection = require( '@stdlib/assert-is-collection' );
26+
var format = require( '@stdlib/string-format' );
2627
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2728
var dtype = require( '@stdlib/complex-dtype' );
2829
var adtype = require( '@stdlib/array-dtype' );
@@ -75,32 +76,32 @@ function linspace( start, stop, out ) {
7576
dt1 = dtype( start );
7677
if ( dt1 === null ) {
7778
if ( !isComplexLike( start ) ) {
78-
throw new TypeError( 'invalid argument. First argument must be either a real or complex number. Value: `' + start + '`.' );
79+
throw new TypeError( format( 'invalid argument. First argument must be either a real or complex number. Value: `%s`.', start ) );
7980
}
8081
dt1 = 'complex128';
8182
}
8283
flg = true;
8384
} else if ( !isNumber( start ) || isnan( start ) ) {
84-
throw new TypeError( 'invalid argument. First argument must be either a real or complex number. Value: `' + start + '`.' );
85+
throw new TypeError( format( 'invalid argument. First argument must be either a real or complex number. Value: `%s`.', start ) );
8586
} else {
8687
dt1 = 'float64';
8788
}
8889
if ( typeof stop === 'object' ) {
8990
dt2 = dtype( stop );
9091
if ( dt2 === null ) {
9192
if ( !isComplexLike( stop ) ) {
92-
throw new TypeError( 'invalid argument. Second argument must be either a real or complex number. Value: `' + stop + '`.' );
93+
throw new TypeError( format( 'invalid argument. Second argument must be either a real or complex number. Value: `%s`.', stop ) );
9394
}
9495
dt2 = 'complex128';
9596
}
9697
flg = true;
9798
} else if ( !isNumber( stop ) || isnan( stop ) ) {
98-
throw new TypeError( 'invalid argument. Second argument must be either a real or complex number. Value: `' + stop + '`.' );
99+
throw new TypeError( format( 'invalid argument. Second argument must be either a real or complex number. Value: `%s`.', stop ) );
99100
} else {
100101
dt2 = 'float64';
101102
}
102103
if ( !isCollection( out ) ) {
103-
throw new TypeError( 'invalid argument. Third argument must be an array-like object. Value: `' + out + '`.' );
104+
throw new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );
104105
}
105106
opts = {
106107
'endpoint': defaults.endpoint

0 commit comments

Comments
 (0)