UNPKG

@enonic/js-utils

Version:
17 lines (15 loc) 340 B
// value/isInt.ts function isInt(value) { return typeof value === "number" && isFinite(value) && // TODO Is isFinite() available in Enonic XP? Math.floor(value) === value; } // value/isPositiveInteger.ts function isPositiveInteger(v) { if (!isInt(v) || v < 0) { return false; } return true; } export { isPositiveInteger };