crocks
Version:
A collection of well known Algebraic Datatypes for your utter enjoyment.
14 lines (10 loc) • 304 B
JavaScript
/** @license ISC License (c) copyright 2017 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */
var isNumber = require('./isNumber')
// isInteger : a -> Boolean
function isInteger(x) {
return isNumber(x)
&& isFinite(x)
&& Math.floor(x) === x
}
module.exports = isInteger