devbyray / is-between-js

IsBetween.js | Check if a number is between a minimum or a maximum number

Home Page:https://www.npmjs.com/package/is-between-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IsBetween.js

Build Status npm version

Install

npm i is-between-js

How to use?

You can import the isBetween function in your JavaScript/TypeScript file and use it like this!

The TypeScript types are included in the library.

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

isBetween(1).min(0).max(10).calc() // returns true
isBetween(10).min(0).max(9).calc() // returns false

or

import { Between } from 'is-between-js'

const between = new Between()

between.value(1).min(0).max(10).calc() // returns true
between.value(10).min(0).max(9).calc() // returns false

About

IsBetween.js | Check if a number is between a minimum or a maximum number

https://www.npmjs.com/package/is-between-js

License:MIT License


Languages

Language:TypeScript 96.0%Language:JavaScript 4.0%