@@ -10,23 +10,27 @@ export function selectLast(options) {
1010}
1111
1212export function selectMinX ( options = { } ) {
13- if ( options . x === undefined ) throw new Error ( "missing channel: x" ) ;
14- return select ( min , options . x , options ) ;
13+ const x = options . x ;
14+ if ( x == null ) throw new Error ( "missing channel: x" ) ;
15+ return select ( min , x , options ) ;
1516}
1617
1718export function selectMinY ( options = { } ) {
18- if ( options . y === undefined ) throw new Error ( "missing channel: y" ) ;
19- return select ( min , options . y , options ) ;
19+ const y = options . y ;
20+ if ( y == null ) throw new Error ( "missing channel: y" ) ;
21+ return select ( min , y , options ) ;
2022}
2123
2224export function selectMaxX ( options = { } ) {
23- if ( options . x === undefined ) throw new Error ( "missing channel: x" ) ;
24- return select ( max , options . x , options ) ;
25+ const x = options . x ;
26+ if ( x == null ) throw new Error ( "missing channel: x" ) ;
27+ return select ( max , x , options ) ;
2528}
2629
2730export function selectMaxY ( options = { } ) {
28- if ( options . y === undefined ) throw new Error ( "missing channel: y" ) ;
29- return select ( max , options . y , options ) ;
31+ const y = options . y ;
32+ if ( y == null ) throw new Error ( "missing channel: y" ) ;
33+ return select ( max , y , options ) ;
3034}
3135
3236// TODO If the value (for some required channel) is undefined, scan forward?
0 commit comments