2 lines
89 B
JavaScript
2 lines
89 B
JavaScript
const when = (pred, whenTrue) => (x) => pred(x) ? whenTrue(x) : x;
|
|
module.exports = when; |