FatCat_Tanks_Challenge/lib/combinators.ts

10 lines
162 B
TypeScript

// @ts-nocheck
export const tap = (fn) => (input) => {
fn(input);
return input;
};
export const doIf = (fn, pred) => (input) =>
pred ? fn(input) : input;