File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,18 +214,18 @@ export function slice(values, type = Array) {
214214}
215215
216216// Returns true if any of x, x1, or x2 is not (strictly) undefined.
217- export function hasX ( { x , x1 , x2 } ) {
218- return x !== undefined || x1 !== undefined || x2 !== undefined ;
217+ export function hasX ( options ) {
218+ return options ?. x !== undefined || options ?. x1 !== undefined || options ?. x2 !== undefined ;
219219}
220220
221221// Returns true if any of y, y1, or y2 is not (strictly) undefined.
222- export function hasY ( { y , y1 , y2 } ) {
223- return y !== undefined || y1 !== undefined || y2 !== undefined ;
222+ export function hasY ( options ) {
223+ return options ?. y !== undefined || options ?. y1 !== undefined || options ?. y2 !== undefined ;
224224}
225225
226226// Returns true if has x or y, or if interval is not (strictly) undefined.
227227export function hasXY ( options ) {
228- return hasX ( options ) || hasY ( options ) || options . interval !== undefined ;
228+ return hasX ( options ) || hasY ( options ) || options ? .interval !== undefined ;
229229}
230230
231231// Disambiguates an options object (e.g., {y: "x2"}) from a primitive value.
Original file line number Diff line number Diff line change 11import { hasX , hasY , identity } from "../options.js" ;
22
3- export function maybeIdentityX ( options = { } , k = "x" ) {
4- return hasX ( options ) ? options : { ...options , [ k ] : identity } ;
3+ export function maybeIdentityX ( options ) {
4+ return hasX ( options ) ? options : { ...options , x : identity } ;
55}
66
7- export function maybeIdentityY ( options = { } , k = "y" ) {
8- return hasY ( options ) ? options : { ...options , [ k ] : identity } ;
7+ export function maybeIdentityY ( options ) {
8+ return hasY ( options ) ? options : { ...options , y : identity } ;
99}
You can’t perform that action at this time.
0 commit comments