Socket
Book a DemoInstallSign in
Socket

safe-array-iterator

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe-array-iterator

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

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

safe

FAQs

Package last updated on 19 Dec 2024

Did you know?

Socket

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.

Install

Related posts