package
compute the intersection between two intervals
npm install interval-intersectionGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
compute the intersection of two intervals where an interval is a 2 part array
npm install interval-intersection
var iisect = require('interval-intersection');
console.log(iisect([-1, 5], [0, 3]));
// output: [0, 3]
console.log(iisect([-2, -1], [1, 2]));
// output: nulliisect(a, b, out)
a is the first intervalb is the second intervalout is an optional 2 part araray. Provide this to avoid generating garbagenull if no intersection