Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
random-array-iterator
Advanced tools
An iterator to iterate an array in random order with controls to requeue or dequeue elements during the iteration
An iterator to iterate an array in random order with controls to requeue or dequeue elements during the iteration.
npm install random-array-iterator
const RandomArrayIterator = require('random-array-iterator')
const ite = new RandomArrayIterator([1, 2, 3, 4, 5])
for (const val of ite) {
console.log(val) // random value
// call requeue if you want to revisit this value is the same iteration
if (someCondition) ite.requeue()
// call dequeue if you want to remove the value from the iteration and array entirely
if (someOtherCondition) ite.dequeue()
}
ite = new RandomArrayIterator(array)
Make a new iterator. Implements the JavaScript iterator interface.
ite.requeue()
Requeue the current value. Only valid to call during an iteration.
ite.dequeue()
Remove the current value from the array and iteration. Only valid to vall during an iteration.
ite.restart()
Restarts the iterator.
MIT
FAQs
An iterator to iterate an array in random order with controls to requeue or dequeue elements during the iteration
The npm package random-array-iterator receives a total of 1,772 weekly downloads. As such, random-array-iterator popularity was classified as popular.
We found that random-array-iterator 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.