{"name":"array.prototype.push","version":"1.0.4","keywords":["Array.prototype.push","push","array","ES5","shim","polyfill","es-shim API"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"license":"MIT","_id":"array.prototype.push@1.0.4","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"homepage":"https://github.com/es-shims/Array.prototype.push#readme","bugs":{"url":"https://github.com/es-shims/Array.prototype.push/issues"},"dist":{"shasum":"5ae067bcde3c637fb9b7db2ed2b1b42c4a824e2c","tarball":"http://registry-npm.ywwl.com/array.prototype.push/download/array.prototype.push-1.0.4.tgz","fileCount":18,"integrity":"sha512-V/Ac0fe4KuOPuPuV3vXVF6PmIzoQTwRXBdx6gzA9NclRyhcpQoaGj7C9vyN2n+84d7t3EcXLccPG5rI2oMA1Jg==","signatures":[{"sig":"MEUCIQDQAx38laKPJ9Yfg7rEhtMUIh3oh79k23kOqV+yEWMaGAIgRzNIPgoCHdt58cWrdBh52bXZJ/ac86GoqxVW20ofDkc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23746,"size":7819,"noattachment":false,"key":"/array.prototype.push/-/array.prototype.push-1.0.4.tgz"},"main":"index.js","engines":{"node":">= 0.4"},"exports":{".":"./index.js","./auto":"./auto.js","./shim":"./shim.js","./polyfill":"./polyfill.js","./package.json":"./package.json","./implementation":"./implementation.js"},"funding":{"url":"https://github.com/sponsors/ljharb"},"gitHead":"4ed080118ea60f22d799e713ea12dc41421a9eb7","scripts":{"lint":"eslint --ext=js,mjs .","test":"npm run tests-only","prelint":"evalmd README.md","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"es-shim-api --bound","posttest":"aud --production","prepublish":"not-in-publish || npm run prepublishOnly","preversion":"auto-changelog","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"},"testling":{"files":"test/index.js"},"repository":{"url":"git+https://github.com/es-shims/Array.prototype.push.git","type":"git"},"_npmVersion":"9.8.0","description":"An ES spec-compliant `Array.prototype.push` shim/polyfill/replacement that works as far down as ES3.","directories":{},"_nodeVersion":"20.5.1","dependencies":{"call-bind":"^1.0.2","is-string":"^1.0.7","es-abstract":"^1.22.1","get-intrinsic":"^1.2.1","define-properties":"^1.2.0","has-property-descriptors":"^1.0.0"},"publishConfig":{"ignore":[".github/workflows"]},"_hasShrinkwrap":false,"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"aud":"^2.0.3","has":"^1.0.3","nyc":"^10.3.2","tape":"^5.6.6","eslint":"=8.8.0","evalmd":"^0.0.19","npmignore":"^0.3.0","in-publish":"^2.0.1","@es-shims/api":"^2.4.2","auto-changelog":"^2.4.0","has-strict-mode":"^1.0.1","safe-publish-latest":"^2.0.0","functions-have-names":"^1.2.3","@ljharb/eslint-config":"^21.1.0"},"_npmOperationalInternal":{"tmp":"tmp/array.prototype.push_1.0.4_1693282793328_0.07653227421853992","host":"s3://npm-registry-packages"},"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":1693282793522,"_cnpm_publish_time":1693282793522,"dist-tags":{"latest":"1.0.7"}}