{"name":"es-iterator-helpers","version":"1.2.2","keywords":["javascript","ecmascript","polyfill","shim","es-shims","es-shim API","Iterator","helpers","from","map","filter","take","drop","flatMap","reduce","toArray","forEach","some","every","find"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"license":"MIT","_id":"es-iterator-helpers@1.2.2","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"homepage":"https://github.com/es-shims/iterator-helpers#readme","bugs":{"url":"https://github.com/es-shims/iterator-helpers/issues"},"dist":{"shasum":"d979a9f686e2b0b72f88dbead7229924544720bc","tarball":"http://registry-npm.ywwl.com/es-iterator-helpers/download/es-iterator-helpers-1.2.2.tgz","fileCount":130,"integrity":"sha512-BrUQ0cPTB/IwXj23HtwHjS9n7O4h9FX94b4xc5zlTHxeLgTAdzYUDyy6KdExAl9lbN5rtfe44xpjpmj9grxs5w==","signatures":[{"sig":"MEUCIGghH/9GD0Nef+iEvkxll/D8XyS5zymLVH3gB/+Atp/xAiEAxc9GSQqAfoDgz+CyJkxA1oTMUOXJgoq6iqULALsfvJE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":286318,"size":42921,"noattachment":false,"key":"/es-iterator-helpers/-/es-iterator-helpers-1.2.2.tgz"},"main":"index.json","engines":{"node":">= 0.4"},"exports":{".":"./index.json","./auto":"./auto.js","./shim":"./shim.js","./Iterator":"./Iterator/index.js","./Iterator.zip":"./Iterator.zip/index.js","./package.json":"./package.json","./Iterator.from":"./Iterator.from/index.js","./Iterator/auto":"./Iterator/auto.js","./Iterator/shim":"./Iterator/shim.js","./Iterator.concat":"./Iterator.concat/index.js","./Iterator.zip/auto":"./Iterator.zip/auto.js","./Iterator.zip/shim":"./Iterator.zip/shim.js","./Iterator.zipKeyed":"./Iterator.zipKeyed/index.js","./Iterator/polyfill":"./Iterator/polyfill.js","./Iterator.from/auto":"./Iterator.from/auto.js","./Iterator.from/shim":"./Iterator.from/shim.js","./Iterator.prototype":"./Iterator.prototype/index.js","./Iterator.concat/auto":"./Iterator.concat/auto.js","./Iterator.concat/shim":"./Iterator.concat/shim.js","./Iterator.zip/polyfill":"./Iterator.zip/polyfill.js","./Iterator.from/polyfill":"./Iterator.from/polyfill.js","./Iterator.prototype.map":"./Iterator.prototype.map/index.js","./Iterator.zipKeyed/auto":"./Iterator.zipKeyed/auto.js","./Iterator.zipKeyed/shim":"./Iterator.zipKeyed/shim.js","./Iterator.prototype.drop":"./Iterator.prototype.drop/index.js","./Iterator.prototype.find":"./Iterator.prototype.find/index.js","./Iterator.prototype.some":"./Iterator.prototype.some/index.js","./Iterator.prototype.take":"./Iterator.prototype.take/index.js","./Iterator.prototype/auto":"./Iterator.prototype/auto.js","./Iterator.prototype/shim":"./Iterator.prototype/shim.js","./Iterator/implementation":"./Iterator/implementation.js","./Iterator.concat/polyfill":"./Iterator.concat/polyfill.js","./Iterator.prototype.every":"./Iterator.prototype.every/index.js","./Iterator.prototype.filter":"./Iterator.prototype.filter/index.js","./Iterator.prototype.reduce":"./Iterator.prototype.reduce/index.js","./Iterator.prototype.flatMap":"./Iterator.prototype.flatMap/index.js","./Iterator.prototype.forEach":"./Iterator.prototype.forEach/index.js","./Iterator.prototype.toArray":"./Iterator.prototype.toArray/index.js","./Iterator.zipKeyed/polyfill":"./Iterator.zipKeyed/polyfill.js","./Iterator.prototype.map/auto":"./Iterator.prototype.map/auto.js","./Iterator.prototype.map/shim":"./Iterator.prototype.map/shim.js","./Iterator.prototype/polyfill":"./Iterator.prototype/polyfill.js","./Iterator.zip/implementation":"./Iterator.zip/implementation.js","./Iterator.from/implementation":"./Iterator.from/implementation.js","./Iterator.prototype.drop/auto":"./Iterator.prototype.drop/auto.js","./Iterator.prototype.drop/shim":"./Iterator.prototype.drop/shim.js","./Iterator.prototype.find/auto":"./Iterator.prototype.find/auto.js","./Iterator.prototype.find/shim":"./Iterator.prototype.find/shim.js","./Iterator.prototype.some/auto":"./Iterator.prototype.some/auto.js","./Iterator.prototype.some/shim":"./Iterator.prototype.some/shim.js","./Iterator.prototype.take/auto":"./Iterator.prototype.take/auto.js","./Iterator.prototype.take/shim":"./Iterator.prototype.take/shim.js","./Iterator.prototype.every/auto":"./Iterator.prototype.every/auto.js","./Iterator.prototype.every/shim":"./Iterator.prototype.every/shim.js","./Iterator.concat/implementation":"./Iterator.concat/implementation.js","./Iterator.prototype.constructor":"./Iterator.prototype.constructor/index.js","./Iterator.prototype.filter/auto":"./Iterator.prototype.filter/auto.js","./Iterator.prototype.filter/shim":"./Iterator.prototype.filter/shim.js","./Iterator.prototype.reduce/auto":"./Iterator.prototype.reduce/auto.js","./Iterator.prototype.reduce/shim":"./Iterator.prototype.reduce/shim.js","./Iterator.prototype.flatMap/auto":"./Iterator.prototype.flatMap/auto.js","./Iterator.prototype.flatMap/shim":"./Iterator.prototype.flatMap/shim.js","./Iterator.prototype.forEach/auto":"./Iterator.prototype.forEach/auto.js","./Iterator.prototype.forEach/shim":"./Iterator.prototype.forEach/shim.js","./Iterator.prototype.map/polyfill":"./Iterator.prototype.map/polyfill.js","./Iterator.prototype.toArray/auto":"./Iterator.prototype.toArray/auto.js","./Iterator.prototype.toArray/shim":"./Iterator.prototype.toArray/shim.js","./Iterator.prototype.drop/polyfill":"./Iterator.prototype.drop/polyfill.js","./Iterator.prototype.find/polyfill":"./Iterator.prototype.find/polyfill.js","./Iterator.prototype.some/polyfill":"./Iterator.prototype.some/polyfill.js","./Iterator.prototype.take/polyfill":"./Iterator.prototype.take/polyfill.js","./Iterator.zipKeyed/implementation":"./Iterator.zipKeyed/implementation.js","./Iterator.prototype.every/polyfill":"./Iterator.prototype.every/polyfill.js","./Iterator.prototype/implementation":"./Iterator.prototype/implementation.js","./Iterator.prototype.filter/polyfill":"./Iterator.prototype.filter/polyfill.js","./Iterator.prototype.reduce/polyfill":"./Iterator.prototype.reduce/polyfill.js","./Iterator.prototype.constructor/auto":"./Iterator.prototype.constructor/auto.js","./Iterator.prototype.constructor/shim":"./Iterator.prototype.constructor/shim.js","./Iterator.prototype.flatMap/polyfill":"./Iterator.prototype.flatMap/polyfill.js","./Iterator.prototype.forEach/polyfill":"./Iterator.prototype.forEach/polyfill.js","./Iterator.prototype.toArray/polyfill":"./Iterator.prototype.toArray/polyfill.js","./Iterator.prototype.map/implementation":"./Iterator.prototype.map/implementation.js","./Iterator.prototype.drop/implementation":"./Iterator.prototype.drop/implementation.js","./Iterator.prototype.find/implementation":"./Iterator.prototype.find/implementation.js","./Iterator.prototype.some/implementation":"./Iterator.prototype.some/implementation.js","./Iterator.prototype.take/implementation":"./Iterator.prototype.take/implementation.js","./Iterator.prototype.constructor/polyfill":"./Iterator.prototype.constructor/polyfill.js","./Iterator.prototype.every/implementation":"./Iterator.prototype.every/implementation.js","./Iterator.prototype.filter/implementation":"./Iterator.prototype.filter/implementation.js","./Iterator.prototype.reduce/implementation":"./Iterator.prototype.reduce/implementation.js","./Iterator.prototype.flatMap/implementation":"./Iterator.prototype.flatMap/implementation.js","./Iterator.prototype.forEach/implementation":"./Iterator.prototype.forEach/implementation.js","./Iterator.prototype.toArray/implementation":"./Iterator.prototype.toArray/implementation.js","./Iterator.prototype.constructor/implementation":"./Iterator.prototype.constructor/implementation.js"},"gitHead":"d5379b9f445a13e8924e8138bd6cfaa1298baf0a","scripts":{"lint":"eslint --ext=js,mjs .","test":"npm run tests-only","prelint":"es-shim-api --type=multi --ignore-dirs=WrapForValidIteratorPrototype,IteratorHelperPrototype","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"evalmd README.md","posttest":"npx npm@'>=10.2' audit --production","prepublish":"not-in-publish || npm run prepublishOnly","tests-only":"nyc tape 'test/**/*.js'","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","prepublishOnly":"safe-publish-latest"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"repository":{"url":"git+https://github.com/es-shims/iterator-helpers.git","type":"git"},"_npmVersion":"11.6.2","description":"An ESnext spec-compliant iterator helpers shim/polyfill/replacement that works as far down as ES3.","directories":{},"_nodeVersion":"25.2.1","dependencies":{"gopd":"^1.2.0","call-bind":"^1.0.8","es-errors":"^1.3.0","has-proto":"^1.2.0","call-bound":"^1.0.4","globalthis":"^1.0.4","es-abstract":"^1.24.1","has-symbols":"^1.1.0","function-bind":"^1.1.2","get-intrinsic":"^1.3.0","internal-slot":"^1.1.0","define-properties":"^1.2.1","safe-array-concat":"^1.1.3","es-set-tostringtag":"^2.1.0","iterator.prototype":"^1.1.5","has-property-descriptors":"^1.0.2"},"publishConfig":{"ignore":[".github/workflows"]},"_hasShrinkwrap":false,"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"nyc":"^10.3.2","jiti":"^0.0.0","tape":"^5.9.0","eslint":"^9.39.2","evalmd":"^0.0.19","encoding":"^0.1.13","for-each":"^0.3.5","npmignore":"^0.3.2","in-publish":"^2.0.1","@es-shims/api":"^3.0.3","mock-property":"^1.1.0","auto-changelog":"^2.5.0","object-inspect":"^1.13.4","has-strict-mode":"^1.1.0","has-tostringtag":"^1.0.2","iterate-iterator":"^1.0.2","es-value-fixtures":"^1.7.1","safe-publish-latest":"^2.0.0","eslint-plugin-import":"^2.32.0","functions-have-names":"^1.2.3","@ljharb/eslint-config":"^22.1.2","make-generator-function":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/es-iterator-helpers_1.2.2_1765664573633_0.897190790232443","host":"s3://npm-registry-packages-npm-production"},"readme":"# es-iterator-helpers <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ESnext spec-compliant sync iterator helpers shim/polyfill/replacement that works as far down as ES3.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) “multi” interface. It works in an ES3-supported environment and complies with the [iterator helpers spec](https://tc39.es/proposal-iterator-helpers/) and the [iterator sequencing spec](https://tc39.es/proposal-iterator-sequencing/).\n\nBecause 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.\n\nThe 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.\n\n## Supported things\n\n - [`Iterator` constructor](https://tc39.es/proposal-iterator-helpers/#sec-iterator-constructor)\n - [`Iterator.prototype`](https://tc39.es/proposal-iterator-helpers/#sec-iterator.prototype)\n - [`Iterator.concat`](https://tc39.es/proposal-iterator-sequencing/)\n - [`Iterator.from`](https://tc39.es/proposal-iterator-helpers/#sec-iterator.from)\n - [`Iterator.zip`](https://tc39.es/proposal-joint-iteration/#sec-iterator.zip)\n - [`Iterator.zipKeyed`](https://tc39.es/proposal-joint-iteration/#sec-iterator.zipkeyed)\n - [`Iterator.prototype.constructor`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.constructor)\n - [`Iterator.prototype.drop`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.drop)\n - [`Iterator.prototype.every`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.every)\n - [`Iterator.prototype.filter`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.filter)\n - [`Iterator.prototype.find`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.find)\n - [`Iterator.prototype.flatMap`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.flatmap)\n - [`Iterator.prototype.forEach`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.foreach)\n - [`Iterator.prototype.includes`](https://tc39.es/proposal-iterator-includes/)\n - [`Iterator.prototype.map`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.map)\n - [`Iterator.prototype.reduce`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.reduce)\n - [`Iterator.prototype.some`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.some)\n - [`Iterator.prototype.take`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.take)\n - [`Iterator.prototype.chunks`](https://tc39.es/proposal-iterator-chunking/#sec-iteratorprototype.chunks)\n - [`Iterator.prototype.toArray`](https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.toarray)\n - [`Iterator.prototype.windows`](https://tc39.es/proposal-iterator-chunking/#sec-iteratorprototype.windows)\n - [`Iterator.prototype.join`](https://tc39.es/proposal-iterator-join/)\n\n## Environments where this is needed\n\n - node < v22, Chrome < v122, Safari <= v17.1, Firefox <= v125: not implemented\n - node v22, Chrome v122 - v130: has a [bug](https://issues.chromium.org/issues/336839115) where `{ next: null }` is not properly rejected\n - 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)\n - all environments lack Iterator.concat, Iterator.zip, Iterator.zipKeyed, Iterator.prototype.chunks, Iterator.prototype.windows, Iterator.prototype.join, Iterator.prototype.includes\n\n## Getting started\n\n```sh\nnpm install --save es-iterator-helpers\n```\n\n## Usage/Examples\n\nUsing explicit imports:\n\n```js\nconst map = require('es-iterator-helpers/Iterator.prototype.map');\nconst toArray = require('es-iterator-helpers/Iterator.prototype.toArray');\nconst assert = require('assert');\n\nconst iterator = [1, 2, 3].values();\n\nconst mapped = map(iterator, (x) => x + 10);\nassert.deepEqual(\n\tmapped.next(),\n    {\n        done: false,\n        value: 11,\n    }\n);\nassert.deepEqual(\n    toArray(mapped),\n    [12, 13]\n);\n```\n\nShim using `require`:\n\n```js\nrequire('es-iterator-helpers/auto'); // shim all of the methods\n\nrequire('es-iterator-helpers/Iterator.prototype.map/auto'); // shim the “map” method\n```\n\nShim using `import` syntax:\n\n[](#preventEval)\n```js\nimport 'es-iterator-helpers/auto'; // shim all of the methods\n\nimport 'es-iterator-helpers/Iterator.prototype.map/auto'; // shim the “map” method\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\nAdditionally, the official [test262](https://github.com/tc39/test262) Iterator suite is included as a git submodule and can be run against the shim with `npm run test262`\n(in CI this runs across a range of Node versions, from one with no native iterator helpers up to the current LTS).\nInitialize the submodule first with `git submodule update --init --depth 1` (or clone with `--recurse-submodules`).\n\n[package-url]: https://npmjs.org/package/es-iterator-helpers\n[npm-version-svg]: https://versionbadg.es/es-shims/iterator-helpers.svg\n[deps-svg]: https://david-dm.org/es-shims/iterator-helpers.svg\n[deps-url]: https://david-dm.org/es-shims/iterator-helpers\n[dev-deps-svg]: https://david-dm.org/es-shims/iterator-helpers/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/iterator-helpers#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/es-iterator-helpers.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/es-iterator-helpers.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/es-iterator-helpers.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=es-iterator-helpers\n[codecov-image]: https://codecov.io/gh/es-shims/iterator-helpers/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/iterator-helpers/\n[actions-image]: https://img.shields.io/github/check-runs/es-shims/iterator-helpers/main\n[actions-url]: https://github.com/es-shims/iterator-helpers/actions\n","publish_time":1765664573791,"_cnpm_publish_time":1765664573791,"dist-tags":{"latest":"1.4.0"}}