UNPKG

vanilla-type-check

Version:
19 lines (18 loc) 489 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Check if a value is an integer number * * @param value value to check * @returns `true` if `obj` is an integer */ function isInt(value) { var type = typeof value; return (type === 'number' || type === 'string') && Number(value) == value && value % 1 === 0 && value !== '' && value !== true && value !== false; } exports.isInt = isInt;