
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
weighted-interval-merge
Advanced tools
This library offers a default interval merge along with the ability to add a weight to each interval which will be used to resolve overlaps. If no weight is given or all weights are the same it will produce a standard interval merge, going from left to ri
This library offers a default interval merge along with the ability to add a weight to each interval which will be used to resolve overlaps. If no weight is given or all weights are the same it will produce a standard interval merge, going from left to right.
The operation makes a copy of the input array, the original array and it's elements are unaltered. Any extra properties are preserved on the copy.

The method expects an input array with elements matching the following signature, only start and end properties are required. offsetStart and index default to 0.
Indexes are normalized back to 1, so three intervals with indexes 3, 5 and 10 will be normalized to 1, 2, 3.
npm install --save weighted-interval-merge
import { weightedIntervalMerge } from "weighted-interval-merge";
const intervals = [
{ id: 1, start: 0, offsetStart: 1, end: 10, index: 0 },
{ id: 2, start: 2, end: 7, index: 1 },
{ id: 3, start: 4, end: 5, index: 2 }
];
const merged = weightedIntervalMerge(intervals);
console.log(merged);
// [
// { id: 1, start: 0, offsetStart: 1, end: 2, index: 1 },
// { id: 2, start: 2, end: 4, index: 2, offsetStart: 0 },
// { id: 3, start: 4, end: 5, index: 3, offsetStart: 0 },
// { id: 2, start: 2, end: 7, index: 2, offsetStart: 3 },
// { id: 1, start: 0, offsetStart: 7, end: 10, index: 1 }
// ];
FAQs
This library offers a default interval merge along with the ability to add a weight to each interval which will be used to resolve overlaps. If no weight is given or all weights are the same it will produce a standard interval merge, going from left to ri
We found that weighted-interval-merge 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.