UNPKG

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.

29 lines (25 loc) 780 B
import { both, gt } from 'ramda'; import curry1 from 'ramda/src/internal/_curry1'; import isNumber from './isNumber'; /** * Checks if value is a negative `Number` primitive or object. Zero is not considered neither * positive or negative. * * @func isNegative * @memberOf RA * @since {@link https://char0n.github.io/ramda-adjunct/1.15.0|v1.15.0} * @category Type * @sig * -> Boolean * @param {*} val The value to test * @return {boolean} * @see {@link RA.isPositive|isPositive} * @example * * RA.isNegative(-1); // => true * RA.isNegative(Number.MIN_VALUE); // => false * RA.isNegative(+Infinity); // => false * RA.isNegative(NaN); // => false * RA.isNegative('5'); // => false */ const isNegative = curry1(both(isNumber, gt(0))); export default isNegative;