Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

safe-array-iterator Version Badge

github actions coverage License Downloads

npm badge

Get an iterator for an array that's robust against prototype modification.

Getting started

npm install --save safe-array-iterator

Usage/Examples

var safeArrayIterator = require('safe-array-iterator');
var assert = require('assert');

delete Array.prototype[Symbol.iterator];

const arr = [1, 2, 3];
const results = [];
for (const x of safeArrayIterator(arr)) {
    results.push(x);
}

assert.deepEqual(results, arr);

Tests

Simply clone the repo, npm install, and run npm test

About

Get an iterator for an array that's robust against prototype modification.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages