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