import { curry } from '../curry'; /** * Subtract the first argument from the second. Same as `b - a`. * * Inspired by [Ramda.js](https://ramdajs.com/docs/#subtract) * * ``` * import { subtract } from '@appsweet-co/utils'; * * subtract(5, 9); * // => 4 * * const sub5 = subtract(5); * * sub5(9); * // => 4 * ``` * * The following are equivalent: * * ``` * subtract(a)(b); * subtract(a, b); * ``` */ const subtract = (a: number, b?: number) => (b) ? b - a : curry(subtract, a); export { subtract };