{"_id":"safe-array-concat","_rev":"305285","name":"safe-array-concat","description":"`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2024-02-17T15:45:16.000Z","created":"2023-04-20T16:56:07.967Z","1.1.0":"2024-01-15T17:15:46.648Z","1.0.1":"2023-09-06T00:40:05.687Z","1.0.0":"2023-04-20T16:56:07.967Z"},"users":{},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ljharb/safe-array-concat.git"},"versions":{"1.1.0":{"name":"safe-array-concat","version":"1.1.0","description":"`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"sideEffects":false,"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated && npm run emit","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)\")\"","prelint":"npm run tsc","lint":"eslint --ext=js,mjs .","preemit":"rm -f *.ts *.ts.map test/*.ts test/*.ts.map","emit":"npm run tsc -- --noEmit false --emitDeclarationOnly","tsc":"tsc -p .","postlint":"evalmd README.md","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","pretest":"npm run lint","tests-only":"nyc tape test","test":"npm run tests-only","posttest":"aud --production"},"keywords":["safe","Array","concat","push","isConcatSpreadable"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/safe-array-concat.git"},"bugs":{"url":"https://github.com/ljharb/safe-array-concat/issues"},"homepage":"https://github.com/ljharb/safe-array-concat#readme","devDependencies":{"@ljharb/eslint-config":"^21.1.0","@types/call-bind":"^1.0.5","@types/get-intrinsic":"^1.2.2","@types/has-symbols":"^1.0.2","@types/isarray":"^2.0.2","@types/mock-property":"^1.0.2","@types/tape":"^5.6.4","aud":"^2.0.4","auto-changelog":"^2.4.0","eslint":"=8.8.0","evalmd":"^0.0.19","in-publish":"^2.0.1","mock-property":"^1.0.3","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","set-function-length":"^1.2.0","tape":"^5.7.3","typescript":"^5.4.0-dev.20240114"},"dependencies":{"call-bind":"^1.0.5","get-intrinsic":"^1.2.2","has-symbols":"^1.0.3","isarray":"^2.0.5"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows","!*.d.ts","!*.d.ts.map"]},"engines":{"node":">=0.4"},"_id":"safe-array-concat@1.1.0","gitHead":"4315d1bea4d8fd70d83a77453d55153de850be6f","types":"./index.d.ts","_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"shasum":"8d0cae9cb806d6d1c06e08ab13d847293ebe0692","size":6947,"noattachment":false,"key":"/safe-array-concat/-/safe-array-concat-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/safe-array-concat/download/safe-array-concat-1.1.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-array-concat_1.1.0_1705338946488_0.9037202284399293"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-15T17:15:46.648Z","publish_time":1705338946648,"_source_registry_name":"default","_cnpm_publish_time":1705338946648},"1.0.1":{"name":"safe-array-concat","version":"1.0.1","description":"`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","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)\")\"","lint":"eslint --ext=js,mjs .","postlint":"evalmd README.md","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","pretest":"npm run lint","tests-only":"nyc tape test","test":"npm run tests-only","posttest":"aud --production"},"keywords":["safe","Array","concat","push","isConcatSpreadable"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/safe-array-concat.git"},"bugs":{"url":"https://github.com/ljharb/safe-array-concat/issues"},"homepage":"https://github.com/ljharb/safe-array-concat#readme","devDependencies":{"@ljharb/eslint-config":"^21.1.0","aud":"^2.0.3","auto-changelog":"^2.4.0","eslint":"=8.8.0","evalmd":"^0.0.19","in-publish":"^2.0.1","mock-property":"^1.0.0","npmignore":"^0.3.0","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.6.6"},"dependencies":{"call-bind":"^1.0.2","get-intrinsic":"^1.2.1","has-symbols":"^1.0.3","isarray":"^2.0.5"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">=0.4"},"_id":"safe-array-concat@1.0.1","gitHead":"994fa15fb2adf29f60308f17cad0c9aee9ac1255","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"shasum":"91686a63ce3adbea14d61b14c99572a8ff84754c","size":4629,"noattachment":false,"key":"/safe-array-concat/-/safe-array-concat-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/safe-array-concat/download/safe-array-concat-1.0.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-array-concat_1.0.1_1693960805478_0.8450296857893591"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-06T00:40:05.687Z","publish_time":1693960805687,"_source_registry_name":"default","_cnpm_publish_time":1693960805687},"1.0.0":{"name":"safe-array-concat","version":"1.0.0","description":"`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","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)\")\"","lint":"eslint --ext=js,mjs .","postlint":"evalmd README.md","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","pretest":"npm run lint","tests-only":"nyc tape test","test":"npm run tests-only","posttest":"aud --production"},"keywords":["safe","Array","concat","push","isConcatSpreadable"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/safe-array-concat.git"},"bugs":{"url":"https://github.com/ljharb/safe-array-concat/issues"},"homepage":"https://github.com/ljharb/safe-array-concat#readme","devDependencies":{"@ljharb/eslint-config":"^21.0.1","aud":"^2.0.2","auto-changelog":"^2.4.0","eslint":"=8.8.0","evalmd":"^0.0.19","in-publish":"^2.0.1","mock-property":"^1.0.0","npmignore":"^0.3.0","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.6.3"},"dependencies":{"call-bind":"^1.0.2","get-intrinsic":"^1.2.0","has-symbols":"^1.0.3","isarray":"^2.0.5"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">=0.4"},"gitHead":"f929a1b65eb3525d93296ecc12f709b18089081c","_id":"safe-array-concat@1.0.0","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"shasum":"2064223cba3c08d2ee05148eedbc563cd6d84060","size":4434,"noattachment":false,"key":"/safe-array-concat/-/safe-array-concat-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/safe-array-concat/download/safe-array-concat-1.0.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-array-concat_1.0.0_1682009767767_0.2196527115452167"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-20T16:56:07.967Z","publish_time":1682009767967,"_cnpm_publish_time":1682009767967}},"readme":"# safe-array-concat <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\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\n`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable\n\n## Getting started\n\n```sh\nnpm install --save safe-array-concat\n```\n\n## Usage/Examples\n\n```js\nvar safeConcat = require('safe-array-concat');\nvar assert = require('assert');\n\nassert.deepEqual([].concat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'arrays spread as expected with normal concat');\nassert.deepEqual(safeConcat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'arrays spread as expected with safe concat');\n\nString.prototype[Symbol.isConcatSpreadable] = true;\nassert.deepEqual([].concat('foo', Object('bar')), ['foo', 'b', 'a', 'r'], 'spreadable String objects are spread with normal concat!!!');\nassert.deepEqual(safeConcat('foo', Object('bar')), ['foo', Object('bar')], 'spreadable String objects are not spread with safe concat');\n\nArray.prototype[Symbol.isConcatSpreadable] = false;\nassert.deepEqual([].concat([1, 2], 3, [[4]]), [[], [1, 2], 3, [[4]]], 'non-concat-spreadable arrays do not spread with normal concat!!!');\nassert.deepEqual(safeConcat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'non-concat-spreadable arrays still spread with safe concat');\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/safe-array-concat\n[npm-version-svg]: https://versionbadg.es/ljharb/safe-array-concat.svg\n[deps-svg]: https://david-dm.org/ljharb/safe-array-concat.svg\n[deps-url]: https://david-dm.org/ljharb/safe-array-concat\n[dev-deps-svg]: https://david-dm.org/ljharb/safe-array-concat/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/safe-array-concat#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/safe-array-concat.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/safe-array-concat.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/safe-array-concat.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=safe-array-concat\n[codecov-image]: https://codecov.io/gh/ljharb/safe-array-concat/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/safe-array-concat/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/safe-array-concat\n[actions-url]: https://github.com/ljharb/safe-array-concat/actions\n","_attachments":{},"homepage":"https://github.com/ljharb/safe-array-concat#readme","bugs":{"url":"https://github.com/ljharb/safe-array-concat/issues"},"license":"MIT"}