{"id":24026925,"url":"https://github.com/ljharb/safe-push-apply","last_synced_at":"2025-09-15T05:02:09.807Z","repository":{"id":270166795,"uuid":"909517797","full_name":"ljharb/safe-push-apply","owner":"ljharb","description":"Push an array of items into an array, while being robust against prototype modification.","archived":false,"fork":false,"pushed_at":"2024-12-29T05:58:35.000Z","size":14,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T03:46:27.042Z","etag":null,"topics":["apply","array","push","pushapply","safe"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ljharb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":"ljharb","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":"ljharb","custom":null}},"created_at":"2024-12-29T00:04:50.000Z","updated_at":"2025-06-25T20:44:38.000Z","dependencies_parsed_at":"2025-01-16T03:37:00.832Z","dependency_job_id":null,"html_url":"https://github.com/ljharb/safe-push-apply","commit_stats":null,"previous_names":["ljharb/safe-push-apply"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ljharb/safe-push-apply","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Fsafe-push-apply","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Fsafe-push-apply/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Fsafe-push-apply/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Fsafe-push-apply/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ljharb","download_url":"https://codeload.github.com/ljharb/safe-push-apply/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Fsafe-push-apply/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275207875,"owners_count":25423896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apply","array","push","pushapply","safe"],"created_at":"2025-01-08T16:54:29.833Z","updated_at":"2025-09-15T05:02:09.764Z","avatar_url":"https://github.com/ljharb.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://ko-fi.com/ljharb","https://thanks.dev/ljharb"],"categories":[],"sub_categories":[],"readme":"# safe-push-apply \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e\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\nPush an array of items into an array, while being robust against prototype modification.\n\n## Getting started\n\n```sh\nnpm install --save safe-push-apply\n```\n\n## Usage/Examples\n\n```js\nvar safePushApply = require('safe-push-apply');\nvar assert = require('assert');\n\nvar arr = [1, 2, 3];\n\nvar orig = Array.prototype[Symbol.iterator];\ndelete Array.prototype[Symbol.iterator];\nassert.throws(() =\u003e {\n    try {\n        arr.push(...[3, 4, 5]);\n    } finally {\n        Array.prototype[Symbol.iterator] = orig;\n    }\n}, 'array is not iterable anymore');\n\ndelete Array.prototype.push;\nsafePushApply(arr, [3, 4, 5]);\n\nassert.deepEqual(arr, [1, 2, 3, 3, 4, 5]);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/safe-push-apply\n[npm-version-svg]: https://versionbadg.es/ljharb/safe-push-apply.svg\n[deps-svg]: https://david-dm.org/ljharb/safe-push-apply.svg\n[deps-url]: https://david-dm.org/ljharb/safe-push-apply\n[dev-deps-svg]: https://david-dm.org/ljharb/safe-push-apply/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/safe-push-apply#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/safe-push-apply.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/safe-push-apply.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/safe-push-apply.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=safe-push-apply\n[codecov-image]: https://codecov.io/gh/ljharb/safe-push-apply/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/safe-push-apply/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/safe-push-apply\n[actions-url]: https://github.com/ljharb/safe-push-apply/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljharb%2Fsafe-push-apply","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fljharb%2Fsafe-push-apply","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljharb%2Fsafe-push-apply/lists"}