source: node_modules/ramda-adjunct/src/isPositive.js

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

Initial commit

  • Property mode set to 100644
File size: 698 bytes
Line 
1import { both, lt } from 'ramda';
2
3import isNumber from './isNumber';
4
5/**
6 * Checks if value is a positive `Number` primitive or object. Zero is not considered positive.
7 *
8 * @func isPositive
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.isNegative|isNegative}
16 * @example
17 *
18 * RA.isPositive(1); // => true
19 * RA.isPositive(Number.MAX_VALUE); // => true
20 * RA.isPositive(-Infinity); // => false
21 * RA.isPositive(NaN); // => false
22 * RA.isPositive('5'); // => false
23 */
24const isPositive = both(isNumber, lt(0));
25
26export default isPositive;
Note: See TracBrowser for help on using the repository browser.