@enonic/js-utils
Version:
Enonic XP JavaScript Utils
17 lines (15 loc) • 340 B
JavaScript
// 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
};