is-integral-number.js 364 B

1234567891011
  1. 'use strict';
  2. var isObject = require('../internals/is-object');
  3. var floor = Math.floor;
  4. // `IsIntegralNumber` abstract operation
  5. // https://tc39.es/ecma262/#sec-isintegralnumber
  6. // eslint-disable-next-line es/no-number-isinteger -- safe
  7. module.exports = Number.isInteger || function isInteger(it) {
  8. return !isObject(it) && isFinite(it) && floor(it) === it;
  9. };