source: imaps-frontend/node_modules/es-abstract/helpers/isInteger.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 440 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $abs = GetIntrinsic('%Math.abs%');
6var $floor = GetIntrinsic('%Math.floor%');
7
8var $isNaN = require('./isNaN');
9var $isFinite = require('./isFinite');
10
11module.exports = function isInteger(argument) {
12 if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
13 return false;
14 }
15 var absValue = $abs(argument);
16 return $floor(absValue) === absValue;
17};
18
Note: See TracBrowser for help on using the repository browser.