mirror-rhinstaller-node-cache/es-iterator-helpers
2026-08-27 18:32:54 +02:00
..
aos b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.concat b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.from b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.chunks b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.constructor b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.drop b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.every b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.filter b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.find b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.flatMap b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.forEach b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.includes b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.join b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.map b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.reduce b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.some b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.take b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.toArray b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.prototype.windows b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.zip b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
Iterator.zipKeyed b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
IteratorHelperPrototype b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
test b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
WrapForValidIteratorPrototype b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
.nycrc b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
auto.js b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
CHANGELOG.md b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
eslint.config.mjs b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
index.json b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
LICENSE b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
package.json b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
README.md b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
shim.js b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00

es-iterator-helpers Version Badge

github actions coverage License Downloads

npm badge

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.

Supported things

Environments where this is needed

  • node < v22, Chrome < v122, Safari <= v17.1, Firefox <= v125: not implemented
  • node v22, Chrome v122 - v130: has a bug where { next: null } is not properly rejected
  • node v22 - v24, Chrome v122 - v134: missing early-error IteratorClose when argument validation fails (e.g., non-callable mapper does not call the iterator's return method)
  • all environments lack Iterator.concat, Iterator.zip, Iterator.zipKeyed, Iterator.prototype.chunks, Iterator.prototype.windows, Iterator.prototype.join, Iterator.prototype.includes

Getting started

npm install --save es-iterator-helpers

Usage/Examples

Using explicit imports:

const map = require('es-iterator-helpers/Iterator.prototype.map');
const toArray = require('es-iterator-helpers/Iterator.prototype.toArray');
const assert = require('assert');

const iterator = [1, 2, 3].values();

const mapped = map(iterator, (x) => x + 10);
assert.deepEqual(
	mapped.next(),
    {
        done: false,
        value: 11,
    }
);
assert.deepEqual(
    toArray(mapped),
    [12, 13]
);

Shim using require:

require('es-iterator-helpers/auto'); // shim all of the methods

require('es-iterator-helpers/Iterator.prototype.map/auto'); // shim the “map” method

Shim using import syntax:

import 'es-iterator-helpers/auto'; // shim all of the methods

import 'es-iterator-helpers/Iterator.prototype.map/auto'; // shim the “map” method

Tests

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

Additionally, the official test262 Iterator suite is included as a git submodule and can be run against the shim with npm run test262 (in CI this runs across a range of Node versions, from one with no native iterator helpers up to the current LTS). Initialize the submodule first with git submodule update --init --depth 1 (or clone with --recurse-submodules).