tamda
Version:
Practical functional programming library for TypeScript
12 lines • 375 B
JavaScript
/**
* Creates a function that opposes values returned by a function `fn`.
* @note Opposite means multiplying numbers by -1.
* @note Ramda's `negate`.
*/
export function opposite(fn) {
// tslint:disable-next-line: only-arrow-functions
return function () {
return fn.apply(undefined, arguments) * -1;
};
}
//# sourceMappingURL=opposite.js.map