just-in-range
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

just-in-range

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-in-range
yarn add just-in-range

Check if number is within a given range

  import inRange from 'just-number-in-range'

/*
  inRange(2, 1, 10); // true
  inRange(15, 20); // true
  inRange(20, 21, 30); // false
  inRange(30, 21, 30); // false
  inRange(); // throws
  inRange(100); // throws
  inRange("js"); // throws
*/

Readme

Keywords

Package Sidebar

Install

npm i just-in-range

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

5.02 kB

Total Files

9

Last publish

Collaborators

  • angus-c