Gathering detailed insights and metrics for es-iterator-helpers
Gathering detailed insights and metrics for es-iterator-helpers
Gathering detailed insights and metrics for es-iterator-helpers
Gathering detailed insights and metrics for es-iterator-helpers
An ESnext spec-compliant iterator helpers shim/polyfill/replacement that works as far down as ES3.
npm install es-iterator-helpers
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
15 Stars
104 Commits
2 Forks
4 Watching
3 Branches
3 Contributors
Updated on 28 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-6.1%
2,556,887
Compared to previous day
Last week
1.6%
14,503,969
Compared to previous week
Last month
8.2%
61,373,065
Compared to previous month
Last year
654.6%
555,651,790
Compared to previous year
15
An ESnext spec-compliant sync iterator helpers shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API “multi” interface. It works in an ES3-supported environment and complies with the iterator helpers spec and the iterator sequencing spec.
Because the Iterator.prototype
methods depend on a receiver (the this
value), the main export in each subdirectory takes the iterator to operate on as the first argument.
The main export of the package itself is simply an array of the available directory names. It’s sole intended use is for build tooling and testing.
Iterator
constructorIterator.prototype
Iterator.concat
Iterator.from
Iterator.zip
Iterator.zipKeyed
Iterator.prototype.constructor
Iterator.prototype.drop
Iterator.prototype.every
Iterator.prototype.filter
Iterator.prototype.find
Iterator.prototype.flatMap
Iterator.prototype.forEach
Iterator.prototype.map
Iterator.prototype.reduce
Iterator.prototype.some
Iterator.prototype.take
Iterator.prototype.toArray
1npm install --save es-iterator-helpers
Using explicit imports:
1const map = require('es-iterator-helpers/Iterator.prototype.map'); 2const toArray = require('es-iterator-helpers/Iterator.prototype.toArray'); 3const assert = require('assert'); 4 5const iterator = [1, 2, 3].values(); 6 7const mapped = map(iterator, (x) => x + 10); 8assert.deepEqual( 9 mapped.next(), 10 { 11 done: false, 12 value: 11, 13 } 14); 15assert.deepEqual( 16 toArray(mapped), 17 [12, 13] 18);
Shim using require
:
1require('es-iterator-helpers/auto'); // shim all of the methods 2 3require('es-iterator-helpers/Iterator.prototype.map/auto'); // shim the “map” method
Shim using import
syntax:
1import 'es-iterator-helpers/auto'; // shim all of the methods 2 3import 'es-iterator-helpers/Iterator.prototype.map/auto'; // shim the “map” method
Simply clone the repo, npm install
, and run npm test
No vulnerabilities found.
Reason
15 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More