updeep-remeda/esm/ifElse.js

9 lines
378 B
JavaScript
Raw Normal View History

2023-01-03 18:51:35 +00:00
import update from "./update.js";
import wrap from "./wrap.js";
function updateIfElse(object, predicate, trueUpdates, falseUpdates) {
const test = typeof predicate === "function" ? predicate(object) : predicate;
const updates = test ? trueUpdates : falseUpdates;
return update(object, updates);
}
export default wrap(updateIfElse);
//# sourceMappingURL=ifElse.js.map