UNPKG

@thi.ng/checks

Version:

Collection of 70+ type, feature & value checks

9 lines (8 loc) 242 B
const isPositive = (x) => typeof x === "number" && x > 0; const isPositiveInt = (x) => Number.isInteger(x) && x > 0; const isNonNegativeInt = (x) => Number.isInteger(x) && x >= 0; export { isNonNegativeInt, isPositive, isPositiveInt };