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

interval-intersection

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

interval-intersection

compute the intersection between two intervals

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

interval-intersection

compute the intersection of two intervals where an interval is a 2 part array

install

npm install interval-intersection

use

var iisect = require('interval-intersection');

console.log(iisect([-1, 5], [0, 3]));
// output: [0, 3]

console.log(iisect([-2, -1], [1, 2]));
// output: null

api surface

iisect(a, b, out)

  • a is the first interval
  • b is the second interval
  • out is an optional 2 part araray. Provide this to avoid generating garbage
  • returns: 2 part array or null if no intersection

license

MIT

Keywords

FAQs

Package last updated on 22 Mar 2015

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

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