hatch-surf/node_modules/es-iterator-helpers
Riley Zhang df378d33ef
Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Merge GitHub main into Gitea repo (allow unrelated histories)
Resolved conflicts by taking GitHub versions for:
- .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml

Kept deploy.sh updated to:
- Pull from GitHub (primary source)
- Push to Gitea (push-mirror)
- Build from site/ directory (GitHub structure)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-25 05:20:46 +02:00
..
.github Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
aos Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.concat Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.from Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.constructor Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.drop Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.every Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.filter Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.find Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.flatMap Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.forEach Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.includes Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.map Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.reduce Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.some Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.take Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.prototype.toArray Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.zip Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
Iterator.zipKeyed Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
IteratorHelperPrototype Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
test Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
WrapForValidIteratorPrototype Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
.nycrc Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
auto.js Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
CHANGELOG.md Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
eslint.config.mjs Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
index.json Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
LICENSE Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
package.json Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
README.md Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +02:00
shim.js Merge GitHub main into Gitea repo (allow unrelated histories) 2026-06-25 05:20:46 +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. Its 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.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).