{"_id":"array.prototype.flatten","_rev":"363677","name":"array.prototype.flatten","description":"An ESnext spec-compliant `Array.prototype.flatten` shim/polyfill/replacement that works as far down as ES3.","dist-tags":{"latest":"1.2.1"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2021-07-13T09:00:22.000Z","created":"2017-10-02T06:42:20.558Z","1.2.1":"2018-02-24T07:03:28.135Z","1.2.0":"2018-01-19T02:04:11.692Z","1.1.1":"2017-11-30T00:00:14.187Z","1.1.0":"2017-10-04T07:42:22.145Z","1.0.1":"2017-10-02T08:25:37.814Z","1.0.0":"2017-10-02T06:42:20.558Z"},"users":{},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"repository":{"type":"git","url":"git://github.com/es-shims/Array.prototype.flatten.git"},"versions":{"1.2.1":{"name":"array.prototype.flatten","version":"1.2.1","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"An ESnext spec-compliant `Array.prototype.flatten` shim/polyfill/replacement that works as far down as ES3.","license":"MIT","main":"index.js","scripts":{"prepublish":"safe-publish-latest","pretest":"npm run --silent lint && evalmd README.md","test":"npm run --silent tests-only","posttest":"npm run --silent security","pretests-only":"es-shim-api --bound","tests-only":"npm run --silent test:shimmed && npm run --silent test:module","test:shimmed":"node test/shimmed","test:module":"node test","coverage":"nyc npm run tests-only","lint":"eslint test/*.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/es-shims/Array.prototype.flatten.git"},"keywords":["Array.prototype.flatten","flatten","array","ESnext","shim","polyfill","flatMap","Array.prototype.flatMap","es-shim API"],"dependencies":{"define-properties":"^1.1.2","es-abstract":"^1.10.0","function-bind":"^1.1.1"},"devDependencies":{"@es-shims/api":"^2.1.2","@ljharb/eslint-config":"^12.2.1","covert":"^1.1.0","eslint":"^4.18.1","evalmd":"^0.0.17","nsp":"^3.2.1","nyc":"^10.3.2","safe-publish-latest":"^1.1.1","tape":"^4.9.0"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"9439859905c409529d2a46a73900678825469cae","bugs":{"url":"https://github.com/es-shims/Array.prototype.flatten/issues"},"homepage":"https://github.com/es-shims/Array.prototype.flatten#readme","_id":"array.prototype.flatten@1.2.1","_npmVersion":"5.6.0","_nodeVersion":"9.6.1","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"a77ae1b64524ce373b137fade324d12040d3c680","size":7357,"noattachment":false,"key":"/array.prototype.flatten/-/array.prototype.flatten-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/array.prototype.flatten/download/array.prototype.flatten-1.2.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array.prototype.flatten_1.2.1_1519455808059_0.3400761020023444"},"_hasShrinkwrap":false,"publish_time":1519455808135,"_cnpm_publish_time":1519455808135,"deprecated":"This method has been renamed to \"flat\" - please use `array.prototype.flat` instead"},"1.2.0":{"name":"array.prototype.flatten","version":"1.2.0","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"An ESnext spec-compliant `Array.prototype.flatten` shim/polyfill/replacement that works as far down as ES3.","license":"MIT","main":"./","scripts":{"prepublish":"safe-publish-latest","pretest":"npm run --silent lint && evalmd README.md","test":"npm run --silent tests-only","posttest":"npm run --silent security","pretests-only":"es-shim-api --bound","tests-only":"npm run --silent test:shimmed && npm run --silent test:module","test:shimmed":"node test/shimmed","test:module":"node test","coverage":"nyc npm run tests-only","lint":"eslint test/*.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/es-shims/Array.prototype.flatten.git"},"keywords":["Array.prototype.flatten","flatten","array","ESnext","shim","polyfill","flatMap","Array.prototype.flatMap","es-shim API"],"dependencies":{"define-properties":"^1.1.2","es-abstract":"^1.10.0","function-bind":"^1.1.1"},"devDependencies":{"@es-shims/api":"^2.1.2","@ljharb/eslint-config":"^12.2.1","covert":"^1.1.0","eslint":"^4.15.0","evalmd":"^0.0.17","nsp":"^3.1.0","nyc":"^10.3.2","safe-publish-latest":"^1.1.1","tape":"^4.8.0"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"4ebfbb6efbcc7c6352054c479f9862e2772f084f","bugs":{"url":"https://github.com/es-shims/Array.prototype.flatten/issues"},"homepage":"https://github.com/es-shims/Array.prototype.flatten#readme","_id":"array.prototype.flatten@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"e46fb18954f8796381a73755e122570647984be3","size":6040,"noattachment":false,"key":"/array.prototype.flatten/-/array.prototype.flatten-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/array.prototype.flatten/download/array.prototype.flatten-1.2.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array.prototype.flatten-1.2.0.tgz_1516327451552_0.8425102473702282"},"directories":{},"publish_time":1516327451692,"_cnpm_publish_time":1516327451692,"_hasShrinkwrap":false,"deprecated":"This method has been renamed to \"flat\" - please use `array.prototype.flat` instead"},"1.1.1":{"name":"array.prototype.flatten","version":"1.1.1","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"An ESnext spec-compliant `Array.prototype.flatten` shim/polyfill/replacement that works as far down as ES3.","license":"MIT","main":"./","scripts":{"prepublish":"safe-publish-latest","pretest":"npm run --silent lint && evalmd README.md","test":"npm run --silent tests-only","posttest":"npm run --silent security","tests-only":"es-shim-api --bound && npm run --silent test:shimmed && npm run --silent test:module","test:shimmed":"node test/shimmed","test:module":"node test","coverage":"nyc npm run tests-only","lint":"eslint test/*.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/es-shims/Array.prototype.flatten.git"},"keywords":["Array.prototype.flatten","flatten","array","ESnext","shim","polyfill","flatMap","Array.prototype.flatMap","es-shim API"],"dependencies":{"define-properties":"^1.1.2","es-abstract":"^1.10.0","function-bind":"^1.1.1"},"devDependencies":{"@es-shims/api":"^1.3.0","@ljharb/eslint-config":"^12.2.1","covert":"^1.1.0","eslint":"^4.12.0","evalmd":"^0.0.17","nsp":"^3.1.0","nyc":"^10.3.2","safe-publish-latest":"^1.1.1","tape":"^4.8.0"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"5dd1e26c949aa71f34d03d96eb99e931e3f6327d","bugs":{"url":"https://github.com/es-shims/Array.prototype.flatten/issues"},"homepage":"https://github.com/es-shims/Array.prototype.flatten#readme","_id":"array.prototype.flatten@1.1.1","_npmVersion":"5.5.1","_nodeVersion":"9.2.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"301b351aa8a632356ee2f5311c6c8e8f50d318cc","size":5932,"noattachment":false,"key":"/array.prototype.flatten/-/array.prototype.flatten-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/array.prototype.flatten/download/array.prototype.flatten-1.1.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array.prototype.flatten-1.1.1.tgz_1512000014047_0.27207071031443775"},"directories":{},"publish_time":1512000014187,"_hasShrinkwrap":false,"_cnpm_publish_time":1512000014187,"deprecated":"This method has been renamed to \"flat\" - please use `array.prototype.flat` instead"},"1.1.0":{"name":"array.prototype.flatten","version":"1.1.0","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"An ESnext spec-compliant `Array.prototype.flatten` shim/polyfill/replacement that works as far down as ES3.","license":"MIT","main":"./","scripts":{"pretest":"npm run --silent lint && evalmd README.md","test":"npm run --silent tests-only","posttest":"npm run --silent security","tests-only":"es-shim-api --bound && npm run --silent test:shimmed && npm run --silent test:module","test:shimmed":"node test/shimmed","test:module":"node test","coverage":"nyc npm run tests-only","lint":"eslint test/*.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/es-shims/Array.prototype.flatten.git"},"keywords":["Array.prototype.flatten","flatten","array","ESnext","shim","polyfill","flatMap","Array.prototype.flatMap","es-shim API"],"dependencies":{"define-properties":"^1.1.2","es-abstract":"^1.9.0","function-bind":"^1.1.1"},"devDependencies":{"@es-shims/api":"^1.3.0","@ljharb/eslint-config":"^12.2.1","covert":"^1.1.0","eslint":"^4.8.0","evalmd":"^0.0.17","nsp":"^2.8.1","nyc":"^10.3.2","tape":"^4.8.0"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"04883594d11f72f85a4ee4d7789f0677acb5940e","bugs":{"url":"https://github.com/es-shims/Array.prototype.flatten/issues"},"homepage":"https://github.com/es-shims/Array.prototype.flatten#readme","_id":"array.prototype.flatten@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"7d35e9fb0b5c4eabc52cd480bf630a285b8684ee","size":6043,"noattachment":false,"key":"/array.prototype.flatten/-/array.prototype.flatten-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/array.prototype.flatten/download/array.prototype.flatten-1.1.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array.prototype.flatten-1.1.0.tgz_1507102941329_0.9768813666887581"},"directories":{},"publish_time":1507102942145,"_cnpm_publish_time":1507102942145,"_hasShrinkwrap":false,"deprecated":"This method has been renamed to \"flat\" - please use `array.prototype.flat` instead"},"1.0.1":{"name":"array.prototype.flatten","version":"1.0.1","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"An ESnext spec-compliant `Array.prototype.flatten` shim/polyfill/replacement that works as far down as ES3.","license":"MIT","main":"./","scripts":{"pretest":"npm run --silent lint && evalmd README.md","test":"npm run --silent tests-only","posttest":"npm run --silent security","tests-only":"es-shim-api --bound && npm run --silent test:shimmed && npm run --silent test:module","test:shimmed":"node test/shimmed","test:module":"node test","coverage":"nyc npm run tests-only","lint":"eslint test/*.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/es-shims/Array.prototype.flatten.git"},"keywords":["Array.prototype.flatten","flatten","array","ESnext","shim","polyfill","flatMap","Array.prototype.flatMap","es-shim API"],"dependencies":{"define-properties":"^1.1.2","es-abstract":"^1.9.0","function-bind":"^1.1.1"},"devDependencies":{"@es-shims/api":"^1.3.0","@ljharb/eslint-config":"^12.2.1","covert":"^1.1.0","eslint":"^4.8.0","evalmd":"^0.0.17","nsp":"^2.8.1","nyc":"^10.3.2","tape":"^4.8.0"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"4dd8a60e64d950c618494c916da1519f88dc7f0d","bugs":{"url":"https://github.com/es-shims/Array.prototype.flatten/issues"},"homepage":"https://github.com/es-shims/Array.prototype.flatten#readme","_id":"array.prototype.flatten@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"3697b2c5c3036f21ffb3281aa84a5836fb76e0a2","size":5865,"noattachment":false,"key":"/array.prototype.flatten/-/array.prototype.flatten-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/array.prototype.flatten/download/array.prototype.flatten-1.0.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array.prototype.flatten-1.0.1.tgz_1506932737700_0.925657702377066"},"directories":{},"publish_time":1506932737814,"_cnpm_publish_time":1506932737814,"_hasShrinkwrap":false,"deprecated":"This method has been renamed to \"flat\" - please use `array.prototype.flat` instead"},"1.0.0":{"name":"array.prototype.flatten","version":"1.0.0","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"An ESnext spec-compliant `Array.prototype.flatten` shim/polyfill/replacement that works as far down as ES3.","license":"MIT","main":"./","scripts":{"pretest":"npm run --silent lint && evalmd README.md","test":"npm run --silent tests-only","posttest":"npm run --silent security","tests-only":"es-shim-api --bound && npm run --silent test:shimmed && npm run --silent test:module","test:shimmed":"node test/shimmed","test:module":"node test","coverage":"nyc npm run tests-only","lint":"eslint test/*.js *.js","security":"nsp check"},"repository":{"type":"git","url":"git://github.com/es-shims/Array.prototype.flatten.git"},"keywords":["Array.prototype.flatten","flatten","array","ESnext","shim","polyfill","flatMap","Array.prototype.flatMap","es-shim API"],"dependencies":{"define-properties":"^1.1.2","es-abstract":"^1.9.0","function-bind":"^1.1.1"},"devDependencies":{"@es-shims/api":"^1.3.0","@ljharb/eslint-config":"^12.2.1","covert":"^1.1.0","eslint":"^4.8.0","evalmd":"^0.0.17","nsp":"^2.8.1","nyc":"^10.3.2","tape":"^4.8.0"},"testling":{"files":["test/index.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"gitHead":"c823291b287c357083fb760edae17b28ee72ec5f","bugs":{"url":"https://github.com/es-shims/Array.prototype.flatten/issues"},"homepage":"https://github.com/es-shims/Array.prototype.flatten#readme","_id":"array.prototype.flatten@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"dist":{"shasum":"dbff303a943a5ff515acd0e727299d6aa52ff20e","size":5083,"noattachment":false,"key":"/array.prototype.flatten/-/array.prototype.flatten-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/array.prototype.flatten/download/array.prototype.flatten-1.0.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array.prototype.flatten-1.0.0.tgz_1506926540396_0.1725369116757065"},"directories":{},"publish_time":1506926540558,"_hasShrinkwrap":false,"_cnpm_publish_time":1506926540558,"deprecated":"This method has been renamed to \"flat\" - please use `array.prototype.flat` instead"}},"readme":"# array.prototype.flatten <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![Build Status][travis-svg]][travis-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 ESnext spec-compliant `Array.prototype.flatten` 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 proposed [spec](https://tc39.github.io/proposal-flatMap/).\n\nBecause `Array.prototype.flatten` 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.flatten\n```\n\n## Usage/Examples\n\n```js\nvar flatten = require('array.prototype.flatten');\nvar assert = require('assert');\n\nvar arr = [1, [2], [], 3, [[4]]];\n\nassert.deepEqual(flatten(arr, 1), [1, 2, 3, [4]]);\n```\n\n```js\nvar flatten = require('array.prototype.flatten');\nvar assert = require('assert');\n/* when Array#flatten is not present */\ndelete Array.prototype.flatten;\nvar shimmedFlatten = flatten.shim();\n\nassert.equal(shimmedFlatten, flatten.getPolyfill());\nassert.deepEqual(arr.flatten(), flatten(arr));\n```\n\n```js\nvar flatten = require('array.prototype.flatten');\nvar assert = require('assert');\n/* when Array#flatten is present */\nvar shimmedIncludes = flatten.shim();\n\nvar mapper = function (x) { return [x, 1]; };\n\nassert.equal(shimmedIncludes, Array.prototype.flatten);\nassert.deepEqual(arr.flatten(mapper), flatten(arr, mapper));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/array.prototype.flatten\n[npm-version-svg]: http://versionbadg.es/es-shims/Array.prototype.flatten.svg\n[travis-svg]: https://travis-ci.org/es-shims/Array.prototype.flatten.svg\n[travis-url]: https://travis-ci.org/es-shims/Array.prototype.flatten\n[deps-svg]: https://david-dm.org/es-shims/Array.prototype.flatten.svg\n[deps-url]: https://david-dm.org/es-shims/Array.prototype.flatten\n[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.flatten/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.flatten#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/array.prototype.flatten.png?downloads=true&stars=true\n[license-image]: http://img.shields.io/npm/l/array.prototype.flatten.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/array.prototype.flatten.svg\n[downloads-url]: http://npm-stat.com/charts.html?package=array.prototype.flatten\n","_attachments":{},"homepage":"https://github.com/es-shims/Array.prototype.flatten#readme","bugs":{"url":"https://github.com/es-shims/Array.prototype.flatten/issues"},"license":"MIT"}