ramda-adjunct
Version:
Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.
33 lines (28 loc) • 984 B
JavaScript
exports.__esModule = true;
exports["default"] = void 0;
var _ramda = require("ramda");
var _isInteger = _interopRequireDefault(require("./isInteger"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* Checks if value is odd integer number.
* An odd number is an integer which is not a multiple DIVISIBLE of two.
*
* @func isOdd
* @memberOf RA
* @since {@link https://char0n.github.io/ramda-adjunct/1.18.0|v1.18.0}
* @category Type
* @sig * -> Boolean
* @param {*} val The value to test
* @return {boolean}
* @see {@link RA.isEven|isEven}
* @example
*
* RA.isOdd(1); // => true
* RA.isOdd(-Infinity); // => false
* RA.isOdd(4); // => false
* RA.isOdd(3); // => true
*/
var isOdd = (0, _ramda.curryN)(1, (0, _ramda.both)(_isInteger["default"], (0, _ramda.pipe)((0, _ramda.flip)(_ramda.modulo)(2), (0, _ramda.complement)(_ramda.equals)(0))));
var _default = isOdd;
exports["default"] = _default;
;