
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
time-overlap
Advanced tools
This module provides several useful functions to calculate timestamps(enter-exit,array-format) overlapping
This module provides several useful functions to calculate timestamps(enter-exit,array-format) overlapping
#install
npm install time-overlap
#test
npm test
#usage
var timeOverlap = require('time-overlap');
timeOverlap.cross([1,3,5,7],[2,4,6,8]); // return [2,3,6,7]
// --1--2--3--4--5--6--7--8--9-- //
// 1-----3 5-----7 //arg0
// 2-----4 6-----8 //arg1
//==============================
// 2--3 6--7 //result
timeOverlap.sum([1,3,5,7],[2,4,6,8]); //return [1,4,5,8]
// --1--2--3--4--5--6--7--8--9-- //
// 1-----3 5-----7 //arg0
// 2-----4 6-----8 //arg1
//==============================
// 1--------4 5--------8 //result
timeOverlap.crossAll();
//same as cross(), but can receive multiple operand
timeOverlap.sumAll();
//same as sum(), but can receive multiple operand
timeOverlap.integrate([1,2,3,4,5,7]); // return 4
// --1--2--3--4--5--6--7--8--9--
// 1--2 3--4 5-----7
//=============================
// 1+ 1+ 2 = 4
#other examples
<CROSS>
--1--2--3--4--5--6--7--8--9-- //
1-----3 4-----6 //arg0 [1,3,4,6]
3--4 5--------8 //arg1 [3,4,5,8]
=============================
3 4 5--6 //result [3,3,4,4,5,6]
--1--2--3--4--5--6--7--8--9-- //
1-----3 6----------- //arg0 [1,3,6]
2--------------7 //arg1 [2,7]
1--2 5--------8 //arg2 [1,2,5,8]
=============================
2 6--7 //result [2,2,6,7]
<SUM>
--1--2--3--4--5--6--7--8--9-- //
1-----3 4-----6 8----- //arg0 [1,3,4,6,8]
3--4 5-----------9 //arg1 [3,4,5,9]
=============================
1-----3--4----------------- //result [1,3,3,4,4]
FAQs
This module provides several useful functions to calculate timestamps(enter-exit,array-format) overlapping
We found that time-overlap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.