Skip to content

Commit fb8a93b

Browse files
authored
chore: add isNumber assertion in plot/vega/axis/ctor/lib/band-position
PR-URL: #10780 Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent a256141 commit fb8a93b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • lib/node_modules/@stdlib/plot/vega/axis/ctor/lib/band-position

lib/node_modules/@stdlib/plot/vega/axis/ctor/lib/band-position/set.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
var logger = require( 'debug' );
2626
var isUndefined = require( '@stdlib/assert/is-undefined' );
2727
var isBetween = require( '@stdlib/assert/is-between' );
28+
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
2829
var format = require( '@stdlib/string/format' );
2930
var changeEvent = require( './../change_event.js' );
3031
var prop = require( './properties.js' );
@@ -50,7 +51,7 @@ var debug = logger( 'vega:axis:set:'+prop.name );
5051
* @returns {void}
5152
*/
5253
function set( value ) {
53-
if ( !isBetween( value, 0.0, 1.0 ) && !isUndefined( value ) ) {
54+
if ( !( isNumber( value ) && isBetween( value, 0.0, 1.0 ) ) && !isUndefined( value ) ) {
5455
throw new TypeError( format( 'invalid assignment. `%s` must be on the interval: [0, 1]. Value: `%s`.', prop.name, value ) );
5556
}
5657
if ( value !== this[ prop.private ] ) {

0 commit comments

Comments
 (0)