
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.
interval-op
Advanced tools
0-dependencies library implemeting basic operations on discrete intervals where boundary conditions reflect the intuitive expectations when dealing with availabilities.
// Union behaves like with closed intervals
[9 .. 12] U [12 .. 17] = [9 .. 17]
// Substraction behaves like with open intervals
[9 .. 17] - [15 .. 17] = [9 .. 15]
npm install interval-op
[start, end][ [start1, end1], [start2, end2], ... ]Examples:
const { union, subtract } = require('interval-op')
console.log( union([ [9, 12], [12, 17] ]) ) // => [[9, 17]]
console.log( subtract([ [9, 17] ], [ [15, 17] ]) ) // => [[9, 15]]
More examples can be found in test/test.js
The library assumes that the elements used as interval boundaries
all have an order relation and can be compared with the relational
operators >, <, >= and <=.
For example, it can be used with numbers or dates.
To use it with a more complex object, you can read about Abstract Relational Comparison and Symbol.toPrimitive
See test/ComplexWithRelation.js for an example of
custom class implementing Symbol.toPrimitive
npm install
the library has no production dependencies, but uses standardJS
for linting/formattingnpm run testnpx standard --fixFAQs
Basic operations on discrete intervals in JS
We found that interval-op 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.