Ramda Adjunct 2.6.0

isInteger.js

  1. import polyfill from './internal/polyfills/Number.isInteger';
  2. /**
  3. * Checks whether the passed value is an `integer`.
  4. *
  5. * @func isInteger
  6. * @memberOf RA
  7. * @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
  8. * @category Type
  9. * @sig * -> Boolean
  10. * @param {*} val The value to test
  11. * @return {Boolean}
  12. * @see {@link RA.isNotInteger|isNotInteger}
  13. * @example
  14. *
  15. * RA.isInteger(0); //=> true
  16. * RA.isInteger(1); //=> true
  17. * RA.isInteger(-100000); //=> true
  18. *
  19. * RA.isInteger(0.1); //=> false
  20. * RA.isInteger(Math.PI); //=> false
  21. *
  22. * RA.isInteger(NaN); //=> false
  23. * RA.isInteger(Infinity); //=> false
  24. * RA.isInteger(-Infinity); //=> false
  25. * RA.isInteger('10'); //=> false
  26. * RA.isInteger(true); //=> false
  27. * RA.isInteger(false); //=> false
  28. * RA.isInteger([1]); //=> false
  29. */
  30. const isInteger = Number.isInteger || polyfill;
  31. export default isInteger;