source: node_modules/ramda-adjunct/es/isNegative.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 737 bytes
Line 
1import { both, gt, curryN } from 'ramda';
2import isNumber from './isNumber';
3
4/**
5 * Checks if value is a negative `Number` primitive or object. Zero is not considered neither
6 * positive or negative.
7 *
8 * @func isNegative
9 * @memberOf RA
10 * @since {@link https://char0n.github.io/ramda-adjunct/1.15.0|v1.15.0}
11 * @category Type
12 * @sig * -> Boolean
13 * @param {*} val The value to test
14 * @return {boolean}
15 * @see {@link RA.isPositive|isPositive}
16 * @example
17 *
18 * RA.isNegative(-1); // => true
19 * RA.isNegative(Number.MIN_VALUE); // => false
20 * RA.isNegative(+Infinity); // => false
21 * RA.isNegative(NaN); // => false
22 * RA.isNegative('5'); // => false
23 */
24var isNegative = curryN(1, both(isNumber, gt(0)));
25export default isNegative;
Note: See TracBrowser for help on using the repository browser.