is-num-between
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

is-between

Created: Mar 31, 2021 11:35 AM

is-num-between

  • Package for determining whether a number is between min and max with an inclusive flag for extra clarity.

Installation

Install with npm:

$ npm install is-num-between

Usage

import {isBetween} from 'is-num-between'

isBetween(1, 1, 3, true) //true

isBetween(1, 1, 3) //false

isBetween(2, 1, 3) //true

API Reference

isBetween(value, min, max, inclusive): boolean

Returns if the value is between the min and max.

Argument Type Description
value number Value to be tested if it falls within the range.
min number The minimum of the range.
max number The maximum of the range
inclusive boolean Determines if the value can be equal to the min or max.

/is-num-between/

    Package Sidebar

    Install

    npm i is-num-between

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    4.71 kB

    Total Files

    9

    Last publish

    Collaborators

    • willparr