Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rangerjs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rangerjs - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

package.json
{
"name": "rangerjs",
"version": "0.0.5",
"version": "0.0.6",
"description": "A lightweight JS library for defining an array of ranges.",

@@ -5,0 +5,0 @@ "main": "ranger.js",

@@ -6,3 +6,3 @@ ranger.js

*note: upper limit is exclusive*
*note: upper limit is always non-inclusive*

@@ -30,2 +30,35 @@ var ranger = require('rangerjs');

newRanger.checkRange(2, 3); //true
newRanger.checkRange(3, 4); //true
newRanger.checkRange(3, 4); //true
####newRanger.addRecuringRange(from, to, interval, count, finish);
*Either `count` (of reptitions) or `finish` (final upper limit) must be set.*
*If using `finish`, set `count` to `null` or `< 1`.*
//These will create the same ranges:
newRanger.addRecuringRange(1, 2, 2, 3);
newRanger.addRecuringRange(1, 2, 2, 0, 7);
//Result:
newRanger.check(1); //true
newRanger.check(2); //false
newRanger.check(3); //true
newRanger.check(4); //false
newRanger.check(5); //true
newRanger.check(6); //false
newRanger.check(7); //false
####newRanger.removeRecuringRange(from, to, interval, count, finish);
*Either `count` (of reptitions) or `finish` (final upper limit) must be set.*
*If using `finish`, set `count` to `null` or `< 1`.*
newRanger.addRange(1, 8);
//These will remove the same ranges:
newRanger.removeRecuringRange(1, 2, 2, 3);
newRanger.removeRecuringRange(1, 2, 2, 0, 7);
//Result:
newRanger.check(1); //false
newRanger.check(2); //true
newRanger.check(3); //false
newRanger.check(4); //true
newRanger.check(5); //false
newRanger.check(6); //true
newRanger.check(7); //true
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc