{"name":"array.prototype.push","version":"1.0.7","description":"An ES spec-compliant `Array.prototype.push` shim/polyfill/replacement that works as far down as ES3.","main":"index.js","exports":{".":"./index.js","./auto":"./auto.js","./polyfill":"./polyfill.js","./implementation":"./implementation.js","./shim":"./shim.js","./package.json":"./package.json"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","preversion":"auto-changelog","prelint":"evalmd README.md","lint":"eslint --ext=js,mjs .","postlint":"es-shim-api --bound","pretest":"npm run lint","test":"npm run tests-only","posttest":"npx npm@\">= 10.2\" audit --production","tests-only":"nyc tape 'test/**/*.js'","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.push.git"},"keywords":["Array.prototype.push","push","array","ES5","shim","polyfill","es-shim API"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/es-shims/Array.prototype.push/issues"},"homepage":"https://github.com/es-shims/Array.prototype.push#readme","engines":{"node":">= 0.4"},"devDependencies":{"@es-shims/api":"^2.5.1","@ljharb/eslint-config":"^21.1.1","auto-changelog":"^2.5.0","encoding":"^0.1.13","eslint":"=8.8.0","evalmd":"^0.0.19","functions-have-names":"^1.2.3","has-strict-mode":"^1.1.0","hasown":"^2.0.2","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.9.0"},"dependencies":{"call-bind":"^1.0.8","call-bound":"^1.0.4","define-properties":"^1.2.1","es-abstract":"^1.23.9","es-errors":"^1.3.0","es-object-atoms":"^1.1.1","get-intrinsic":"^1.3.0","has-property-descriptors":"^1.0.2","is-string":"^1.1.1"},"testling":{"files":"test/index.js"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"_id":"array.prototype.push@1.0.7","gitHead":"ec26d7e56c0783fad5ca32430b6332a3771d0f5c","_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-TYyNvrD1GpY3e6/tthQfwcuGPUtP99N1uDQ6WA8RBlOYZAYHpicIO1JXHP8t9CeC0EiiVZZu4Ikl1bI5BSZAEQ==","shasum":"aa3d32dc34495cdab1894f0c17e025afbb5f61e0","tarball":"http://registry-npm.ywwl.com/array.prototype.push/download/array.prototype.push-1.0.7.tgz","fileCount":18,"unpackedSize":26886,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBLBDe9KdfGSSITsHPpClLr67sLuWSEoVfjbVqv9yQm3AiEA5pApWvDD4oYjl4GeJgdzAh65a+koTzbycVnKRQwfASI="}],"size":8790,"noattachment":false,"key":"/array.prototype.push/-/array.prototype.push-1.0.7.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/array.prototype.push_1.0.7_1741966087593_0.6045685516983921"},"_hasShrinkwrap":false,"readme":"# array.prototype.push <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.push` 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.push).\n\nBecause `Array.prototype.push` depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.\n\n## Engines where this is needed\n\nNote: this list is not exhaustive.\n\n  - in node/chrome (including node 18-19): `push` fails to throw on a nonwritable `length` property\n  - IE 8 and below, and pre-ES6 engines: `deleteCount` isn't defaulted to `length - start` until ES6\n  - Safari 5.0: sometimes it returns `undefined`\n  - Safari 7/8: sparse arrays of size 1e5 or greater break\n  - Opera 12.15: breaks on small sparse arrays\n\n## Example\n\n```js\nvar push = require('array.prototype.push');\nvar assert = require('assert');\n\nvar a = [1, 1, 1];\nassert.equal(push(a, 1, 2), 5);\nassert.deepEqual(a, [1, 1, 1, 1, 2]);\n```\n\n```js\nvar push = require('array.prototype.push');\nvar assert = require('assert');\n/* when Array#push is not present */\ndelete Array.prototype.push;\nvar shimmed = push.shim();\nassert.equal(shimmed, push.getPolyfill());\nassert.equal(shimmed, Array.prototype.push);\nvar a = [1, 2, 3];\nvar b = [1, 2, 3];\nassert.equal(a.push(1, 2, 3), push(b, 1, 2, 3));\nassert.deepEqual(a, b);\n```\n\n```js\nvar push = require('array.prototype.push');\nvar assert = require('assert');\n/* when Array#push is present */\nvar shimmed = push.shim();\nassert.equal(shimmed, Array.prototype.push);\nassert.deepEqual([1, 2, 3].push(1, 2, 3), push([1, 2, 3], 1, 2, 3));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/array.prototype.push\n[npm-version-svg]: https://versionbadg.es/es-shims/Array.prototype.push.svg\n[deps-svg]: https://david-dm.org/es-shims/Array.prototype.push.svg\n[deps-url]: https://david-dm.org/es-shims/Array.prototype.push\n[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.push/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.push#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/array.prototype.push.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/array.prototype.push.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/array.prototype.push.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=array.prototype.push\n[codecov-image]: https://codecov.io/gh/es-shims/Array.prototype.push/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/Array.prototype.push/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Array.prototype.push\n[actions-url]: https://github.com/es-shims/Array.prototype.push/actions\n","publish_time":1741966087789,"_cnpm_publish_time":1741966087789,"dist-tags":{"latest":"1.0.7"}}