lib/validate.js
changed.
Other files ignored by Codecov
.github/.keepalive
was deleted.
21 | 21 | // MODULES // |
|
22 | 22 | ||
23 | 23 | var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; |
|
24 | + | var format = require( '@stdlib/string-format' ); |
|
24 | 25 | var isnan = require( '@stdlib/assert-is-nan' ); |
|
25 | 26 | ||
26 | 27 |
42 | 43 | */ |
|
43 | 44 | function validate( a, b ) { |
|
44 | 45 | if ( !isNumber( a ) || isnan( a ) ) { |
|
45 | - | return new TypeError( 'invalid argument. First argument must be a number primitive and not `NaN`. Value: `'+a+'`.' ); |
|
46 | + | return new TypeError( format( 'invalid argument. First argument must be a number primitive and not `NaN`. Value: `%s`.', a ) ); |
|
46 | 47 | } |
|
47 | 48 | if ( !isNumber( b ) || isnan( b ) ) { |
|
48 | - | return new TypeError( 'invalid argument. Second argument must be a number primitive and not `NaN`. Value: `'+b+'`.' ); |
|
49 | + | return new TypeError( format( 'invalid argument. Second argument must be a number primitive and not `NaN`. Value: `%s`.', b ) ); |
|
49 | 50 | } |
|
50 | 51 | if ( a >= b ) { |
|
51 | - | return new RangeError( 'invalid argument. Minimum support `a` must be less than maximum support `b`. Value: `['+a+','+b+']`.'); |
|
52 | + | return new RangeError( format( 'invalid argument. Minimum support `a` must be less than maximum support `b`. Value: `[%f,%f]`.', a, b ) ); |
|
52 | 53 | } |
|
53 | 54 | return null; |
|
54 | 55 | } |
Files | Coverage |
---|---|
lib | 100.00% |
Project Totals (5 files) | 100.00% |