UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

26 lines (24 loc) 400 B
import { dfdlT } from "@monstermann/dfdl"; //#region src/number/max.ts /** * `max(target, source)` * * Returns the larger of `target` and `source`. * * ```ts * max(5, 3); // 5 * max(2, 7); // 7 * max(4, 4); // 4 * ``` * * ```ts * pipe(5, max(3)); // 5 * pipe(2, max(7)); // 7 * pipe(4, max(4)); // 4 * ``` */ const max = dfdlT((a, b) => { return Math.max(a, b); }, 2); //#endregion export { max };