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.
28 lines (27 loc) • 735 B
JavaScript
import { curryN } from 'ramda';
import toInteger32 from './toInteger32.js';
/**
* Checks whether the passed value is a signed 32 bit integer.
*
* @func isInteger32
* @aliases isInt32
* @memberOf RA
* @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
* @category Type
* @sig * -> Boolean
* @param {*} val The value to test
* @return {boolean}
* @see {@link RA.toInteger32|toInteger32}
* @example
*
* RA.isInteger32(0); //=> true
* RA.isInteger32((-2) ** 31); //=> true
*
* RA.isInteger32(Infinity); //=> false
* RA.isInteger32(NaN); //=> false
* RA.isInteger32(2 ** 31); //=> false
*/
var isInteger32 = curryN(1, function (val) {
return toInteger32(val) === val;
});
export default isInteger32;