🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

is-num-between

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-num-between

A package for determining if a number is between two numbers

1.0.1
latest
Source
npm
Version published
Weekly downloads
11
Maintainers
1
Weekly downloads
 
Created
Source

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.

ArgumentTypeDescription
valuenumberValue to be tested if it falls within the range.
minnumberThe minimum of the range.
maxnumberThe maximum of the range
inclusivebooleanDetermines if the value can be equal to the min or max.

Keywords

isbetween

FAQs

Package last updated on 31 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts