Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
time-ordered-set
Advanced tools
Readme
Efficiently maintain a set of nodes ordered by the time they were added to the set
npm install time-ordered-set
var set = require('time-ordered-set')
var s = set()
// add 3 nodes
s.add({
hello: 'world'
})
var node = s.add({
hello: 'welt'
})
s.add({
hello: 'verden'
})
// re-add the 2nd one
s.add(node)
console.log(s.toArray().map(node => node.hello)) // ['world', 'verden', 'welt']
var s = set()
Create a new set
node = s.add(node)
Add a new node to the set. Will add the properties node.next
and node.prev
to the node.
Re-adding the same node will move to the latest node.
node = s.remove(node)
Remove a node. Will set node.next
and node.prev
to null
.
bool = s.has(node)
Check if a node has been added.
var array = s.toArray(maxCount)
Get an ordered array out of all the nodes, ordered from oldest to newest. Set maxCount
if you only want to get a subset.
s.oldest
Property containing the oldest node.
s.latest
Property containing the newest node.
s.length
Property containing how many nodes are in the set.
MIT
FAQs
Efficiently maintain a set of nodes ordered by the time they were added to the set
The npm package time-ordered-set receives a total of 1,360 weekly downloads. As such, time-ordered-set popularity was classified as popular.
We found that time-ordered-set 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
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.