source: node_modules/ramda-adjunct/src/isInteger32.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: 717 bytes
Line 
1import { curryN } from 'ramda';
2
3import toInteger32 from './toInteger32';
4
5/**
6 * Checks whether the passed value is a signed 32 bit integer.
7 *
8 * @func isInteger32
9 * @aliases isInt32
10 * @memberOf RA
11 * @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
12 * @category Type
13 * @sig * -> Boolean
14 * @param {*} val The value to test
15 * @return {boolean}
16 * @see {@link RA.toInteger32|toInteger32}
17 * @example
18 *
19 * RA.isInteger32(0); //=> true
20 * RA.isInteger32((-2) ** 31); //=> true
21 *
22 * RA.isInteger32(Infinity); //=> false
23 * RA.isInteger32(NaN); //=> false
24 * RA.isInteger32(2 ** 31); //=> false
25 */
26const isInteger32 = curryN(1, (val) => toInteger32(val) === val);
27
28export default isInteger32;
Note: See TracBrowser for help on using the repository browser.