{"name":"array.prototype.foreach","version":"1.0.3","description":"An ES spec-compliant `Array.prototype.forEach` shim/polyfill/replacement that works as far down as ES3.","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"funding":{"url":"https://github.com/sponsors/ljharb"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"license":"MIT","bugs":{"url":"https://github.com/es-shims/Array.prototype.forEach/issues"},"homepage":"https://github.com/es-shims/Array.prototype.forEach#readme","main":"index.js","exports":{".":[{"import":"./index.mjs","require":"./index.js","default":"./index.js"},"./index.js"],"./auto":"./auto.js","./polyfill":"./polyfill.js","./implementation":"./implementation.js","./shim":"./shim.js","./package.json":"./package.json"},"scripts":{"prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","pretest":"npm run --silent lint && evalmd README.md","posttest":"aud --production","tests-only":"nyc tape 'test/**/*.js'","tests-esm":"nyc node test/index.mjs","test":"npm run tests-only && npm run tests-esm","lint":"eslint --ext=js,mjs .","postlint":"es-shim-api --bound","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/es-shims/Array.prototype.forEach.git"},"keywords":["Array.prototype.forEach","forEach","array","ecmascript","ES","shim","polyfill","es-shim API"],"dependencies":{"call-bind":"^1.0.2","define-properties":"^1.1.3","es-abstract":"^1.19.1","es-array-method-boxes-properly":"^1.0.0","get-intrinsic":"^1.1.1","is-string":"^1.0.7"},"devDependencies":{"@es-shims/api":"^2.2.3","@ljharb/eslint-config":"^20.0.0","aud":"^1.1.5","auto-changelog":"^2.3.0","eslint":"^8.4.1","evalmd":"^0.0.19","functions-have-names":"^1.2.2","has-strict-mode":"^1.0.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.3.2"},"testling":{"files":["test/index.js","test/implementation.js","test/shimmed.js"]},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"gitHead":"71f8a002c0423bc36c729b371f48bb8cbbe913c9","_id":"array.prototype.foreach@1.0.3","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-e9NFzULgl1UknKkEPrIrDMBmFEoJtAqYgFOjsngUfbsq5W9xe6liFjIpIRZB4GJtguM+mywCqU8yf4JX2R4SSg==","shasum":"d6fda6b8bcb019f83ef88bc50d477e582e9ecf26","tarball":"http://registry-npm.ywwl.com/array.prototype.foreach/download/array.prototype.foreach-1.0.3.tgz","fileCount":20,"unpackedSize":23277,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXvXNPr4wwUbfXcCdAnCzu+6j4AuqSiFHn05lxd64HmAiApGboSdWj4kmcoeT9Jb4NVB52AYqdL/P4kIn1J3RN3pA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY1PtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9ng//XTWTfTLDE/DSkylws5C0IfSkZivu6OkhK29+QM4oYbrfMUE4\r\ncOOQIP1zXoEnr9AnPkm7o2LM8ytBrYFNIXyI/+ik37e1A62R79P5EoA8itNr\r\n3rvtK6g85/HohE3ZfAJMbUUrtQmeTz4uyZpFdaUP+KQCLeBNx0M71OXb4DRW\r\nXbzi52xoZkuybzAfsfkLYTitZoWq97jpeQrz3o69sTsaEp5xnITO8yRKbpg2\r\nxgVyuOsYsdjjlOQQd5wHV64oRtWj+9hNsLKUWQbz2d9s6lRcgkf2qN3kJqEd\r\nMY08bYdYgUYmRND7mZlebHL953TvZqZaI3bQQJsKvotGoKsAmWLg/zth5yIY\r\n0ovoIAL+PeYzjf1pagxYPY7wybipfp1AO0ubk0+EuA6fnZxWKisXRHpleW4f\r\nylbDbK8z4RD+qvVTawXDfQLs3TNxODHvRcIMvV2+k9uwTjgku3tmfQnh02kx\r\nh9XHgoUstsfdIgNSgmPCux3rdS/mSbsUz3NBd+y0JaXo29ewUNIVPboiNbNb\r\nC+rYIl+QRhWkyPzl+sgJD0en+S/cffu6B4K4lq/456R9PV+yMyTTFWWf/YFH\r\nhK88pqT/reQSpim03Y7RERroe3VjlXJFXYYUq1DxYt94gNDeS8rpLgpJVs5z\r\nTYp2Yybqj3VG5hf1B6TgN4GGVx4Dbu5fdu4=\r\n=DiVC\r\n-----END PGP SIGNATURE-----\r\n","size":7646,"noattachment":false,"key":"/array.prototype.foreach/-/array.prototype.foreach-1.0.3.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array.prototype.foreach_1.0.3_1667453933145_0.8518282754785642"},"_hasShrinkwrap":false,"readme":"# array.prototype.foreach <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ES spec-compliant `Array.prototype.forEach` shim/polyfill/replacement that works as far down as ES3.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://tc39.es/ecma262/#sec-array.prototype.foreach).\n\nBecause `Array.prototype.forEach` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument.\n\n## Getting started\n\n```sh\nnpm install --save array.prototype.foreach\n```\n\n## Usage/Examples\n\n```js\nvar forEach = require('array.prototype.foreach');\nvar assert = require('assert');\n\nvar arr = [1, [2], [], 3, [[4]]];\nvar counter = 0;\nvar increaseCounter = function (x) { counter += 1; };\n\nassert.equal(forEach(arr, increaseCounter), undefined);\nassert.equal(counter, arr.length);\n```\n\n```js\nvar forEach = require('array.prototype.foreach');\nvar assert = require('assert');\n/* when Array#forEach is not present */\ndelete Array.prototype.forEach;\nvar shimmed = forEach.shim();\nvar counter = 0;\n\nassert.equal(shimmed, forEach.getPolyfill());\nassert.equal(arr.forEach(increaseCounter), forEach(arr, increaseCounter));\nassert.equal(counter, arr.length * 2);\n```\n\n```js\nvar forEach = require('array.prototype.foreach');\nvar assert = require('assert');\n/* when Array#forEach is present */\nvar shimmed = forEach.shim();\nvar counter = 0;\n\nassert.equal(shimmed, Array.prototype.forEach);\nassert.equal(arr.forEach(increaseCounter), forEach(arr, increaseCounter));\nassert.equal(counter, arr.length * 2);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/array.prototype.foreach\n[npm-version-svg]: https://versionbadg.es/es-shims/Array.prototype.forEach.svg\n[deps-svg]: https://david-dm.org/es-shims/Array.prototype.forEach.svg\n[deps-url]: https://david-dm.org/es-shims/Array.prototype.forEach\n[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.forEach/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.forEach#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/array.prototype.foreach.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/array.prototype.foreach.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/array.prototype.foreach.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=array.prototype.foreach\n[codecov-image]: https://codecov.io/gh/es-shims/Array.prototype.forEach/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/Array.prototype.forEach/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Array.prototype.forEach\n[actions-url]: https://github.com/es-shims/Array.prototype.forEach\n","publish_time":1667453933302,"_cnpm_publish_time":1667453933302,"dist-tags":{"latest":"1.0.7"}}