
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Minimalistic helper for simple operation: put a bunch of [from, to] values and get any selection of them
Minimalistic helper for simple operation: put a bunch of [from, to] values and get any selection of them
put(from: integer, to: integer, record: Object): RangeIndex - put record to the index
find(from: integer, to: integer, options: Object?): Array - find records in range of from-to
findOuter(innerFrom: integer, innerTo: integer, options: Object?): Array - find records which from-to range contains innerFrom-innerTo range
Note: the result of findOuter is unsorted list of records. The records in this result would be in a different order than they were put.
Specify the options.sort to sort result.
options = {
sort: function(Object.<from, to>, Object.<from, to>){} // For findOuter method only. Callback for sorting result
filter: function(record: Object, from: number, to: number){} // Callback for filtering result
}
const rangeIndex = new RangeIndex()
, dataset = [
{from: 0, to: 10, data: '0-10'}, {from: 0, to: 20, data: '0-20'}, {from: 0, to: 50, data: '0-50'}
, {from: 50, to: 100, data: '50-100'}, {from: 50, to: 120, data: '50-120'}, {from: 50, to: 150, data: '50-150'}
, {from: 150, to: 1000, data: '150-1000'}
, {from: 250, to: 1200, data: '250-1200'}
, {from: 350, to: 2000, data: '350-2000'}
]
;
for ( let {from, to, data} of dataset ) {
rangeIndex.put(from, to, data);
}
rangeIndex.find(0, 500);//["0-10", "0-20", "0-50", "50-100", "50-120", "50-150"]
rangeIndex.findOuter(300, 500);//["150-1000", "250-1200"]
npm install rangeindex
MIT
FAQs
Minimalistic helper for simple operation: put a bunch of [from, to] values and get any selection of them
We found that rangeindex 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.