{"name":"array.prototype.foreach","version":"1.0.4","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.4","es-abstract":"^1.20.4","es-array-method-boxes-properly":"^1.0.0","get-intrinsic":"^1.1.3","is-string":"^1.0.7"},"devDependencies":{"@es-shims/api":"^2.2.3","@ljharb/eslint-config":"^21.0.0","aud":"^2.0.1","auto-changelog":"^2.4.0","eslint":"=8.8.0","evalmd":"^0.0.19","functions-have-names":"^1.2.3","has-strict-mode":"^1.0.1","in-publish":"^2.0.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.6.1"},"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":"0685b3e9e019eb8aa1595c0bfbd16a6e7bf6d242","_id":"array.prototype.foreach@1.0.4","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-OYqqGR/56CopyheXNwdlJvFtbSvf2Z9RGvL20X6GvAuKePJ76L/D46BqZn3bITd36QA2Ti7Iy0UwVJaD/YwXZA==","shasum":"ea248e0bc250fef587c369cc7102908a43d9f23c","tarball":"http://registry-npm.ywwl.com/array.prototype.foreach/download/array.prototype.foreach-1.0.4.tgz","fileCount":19,"unpackedSize":23962,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH6wXnelyjlrEhaceiVWVH+4jT959rHE7PnxjefUqvT5AiEA3IPt+f55uYxPSmLxuMZrkoxcfy+XhiVbqN6PTsfCGXw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY+SsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoiHBAAmWXCISCZhQ40kIt6ohyXcRSzVbMsOmx730/W107RAM/Xq+/b\r\nrbXye+aKTVo9+zWAkIbJeaiFD90wSOmzFaw0GW7Bbg2V2glTNj87X0Yo6M3K\r\nq8037wnqT8i7AQ11laAD4O12kwSSZZOOMxoRXDd9qyU3CuUD4376BwOCDBDU\r\n4ByLBzeVyIC4/UVZmbQgQWdEHHISTOjMKkNEqPTZ2kz3udykIco9QwVFJOZJ\r\nZc0CJm/lY2JTER5ZqzJhOANjMVE4nd3eJS69E/7/wUujiqgpLYwlemT/YpJA\r\nfkQyb1AJTs7ncAxGakOXDr25FXch0jNZZcSHUfkAaLGY5exXnCc2HE1emdpi\r\ni6jjdRDqwgFpO+ZOeiN+/tXGzg239WMOqBts/4syx10IPFK26XrNceoJQaGv\r\nD1YgK6/Reev5mPM1GIybLeLM/E90IAVPZn3vA0kBlB4wLkYGEMxshiqnOdgY\r\n3wIfG2LqTQWw0HUa4gZsQlxU/7ndnx62Zk5BJi0w5JzzbunElwQ5keDM54fT\r\n4lmGN2XN94rPX1gUfl/hHKhZ4mkyiyDDLo1roW1q/OgftK9ZiIMmGYt4Ct9Y\r\nBZb2l+OUYtXStyQozPHJMTOLK3LKfWHEOmg5OsIoNvA+V3IxRcyc1Pbzezav\r\naGaesIRVgAHsKoBgmaD7WAliuOQE6um23LY=\r\n=XcPN\r\n-----END PGP SIGNATURE-----\r\n","size":7802,"noattachment":false,"key":"/array.prototype.foreach/-/array.prototype.foreach-1.0.4.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.4_1667490988741_0.5517706221244525"},"_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":1667490988902,"_cnpm_publish_time":1667490988902,"dist-tags":{"latest":"1.0.7"}}