UNPKG

sikits

Version:

A powerful and comprehensive utility library for JavaScript and TypeScript with 100+ functions for strings, numbers, arrays, and objects

16 lines (15 loc) 597 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isBetween = exports.isFloat = exports.isInteger = exports.isOdd = exports.isEven = void 0; const isEven = (n) => n % 2 === 0; exports.isEven = isEven; const isOdd = (n) => n % 2 !== 0; exports.isOdd = isOdd; const isInteger = (n) => Number.isInteger(n); exports.isInteger = isInteger; const isFloat = (n) => !Number.isInteger(n); exports.isFloat = isFloat; const isBetween = (n, min, max, inclusive = true) => { return inclusive ? n >= min && n <= max : n > min && n < max; }; exports.isBetween = isBetween;