UNPKG

@thi.ng/checks

Version:

Collection of 70+ type, feature & value checks

9 lines (8 loc) 242 B
const isNegative = (x) => typeof x === "number" && x < 0; const isNegativeInt = (x) => Number.isInteger(x) && x < 0; const isNonPositiveInt = (x) => Number.isInteger(x) && x <= 0; export { isNegative, isNegativeInt, isNonPositiveInt };