Skip to content

Commit 4cd8b55

Browse files
committed
null, not undefined
1 parent 240d0ba commit 4cd8b55

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/transforms/select.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,27 @@ export function selectLast(options) {
1010
}
1111

1212
export 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

1718
export 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

2224
export 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

2730
export 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

Comments
 (0)