{"_id":"babel-plugin-transform-for-of-as-array","_rev":"1759624","name":"babel-plugin-transform-for-of-as-array","description":"Transform all for-of loops into the equivalent array for loop","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"time":{"modified":"2026-11-23T09:10:22.000Z","created":"2017-04-29T22:22:00.447Z","1.1.1":"2018-02-08T06:08:59.860Z","1.1.0":"2018-02-01T06:55:13.150Z","1.0.4":"2017-10-15T23:45:41.244Z","1.0.3":"2017-04-30T17:09:03.417Z","1.0.2":"2017-04-30T04:14:59.206Z","1.0.1":"2017-04-30T01:57:37.002Z","1.0.0":"2017-04-29T22:22:00.447Z"},"users":{},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"versions":{"1.1.1":{"name":"babel-plugin-transform-for-of-as-array","version":"1.1.1","description":"Transform all for-of loops into the equivalent array for loop","repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"main":"lib/index.js","license":"MIT","devDependencies":{"babel-cli":"^7.0.0-beta.2","babel-plugin-transform-es2015-modules-amd":"^7.0.0-beta.2","babel-plugin-transform-es2015-modules-commonjs":"^7.0.0-beta.2","babel-preset-env":"^2.0.0-beta.2","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"mocha --compilers js:babel-register","test:watch":"npm run test -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["for","of","loop","array","babel-plugin"],"gitHead":"92f0a579420ce091a574120ed404ef5dc75ccfed","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","_id":"babel-plugin-transform-for-of-as-array@1.1.1","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"dist":{"integrity":"sha512-eE4hZJhOUKpX0q/X3adR8B4hLox+t8oe4ZqmhANUmv4cds07AbWt6O0rtFXK7PKFPPnW4nz/5mpbkPMkflyGeg==","shasum":"f18fcbcbfa2b8caed1445c3153893d37439a6537","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-for-of-as-array/download/babel-plugin-transform-for-of-as-array-1.1.1.tgz","fileCount":73,"unpackedSize":12391,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyl5upboxeJxt23O+ruAmrjlKTSTLRJoOSUZoWj3Ko1wIgVSwgUhsJqIrKA1+m5L5TUNv7fUdfTdgcX8ely/XmsgI="}],"size":5048,"noattachment":false,"key":"/babel-plugin-transform-for-of-as-array/-/babel-plugin-transform-for-of-as-array-1.1.1.tgz"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-transform-for-of-as-array_1.1.1_1518070139204_0.17914576324160736"},"_hasShrinkwrap":false,"publish_time":1518070139860,"_cnpm_publish_time":1518070139860},"1.1.0":{"name":"babel-plugin-transform-for-of-as-array","version":"1.1.0","description":"Transform all for-of loops into the equivalent array for loop","repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"main":"lib/index.js","license":"MIT","devDependencies":{"babel-cli":"^7.0.0-beta.2","babel-plugin-transform-es2015-modules-amd":"^7.0.0-beta.2","babel-plugin-transform-es2015-modules-commonjs":"^7.0.0-beta.2","babel-preset-env":"^2.0.0-beta.2","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"mocha --compilers js:babel-register","test:watch":"npm run test -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["for","of","loop","array","babel-plugin"],"gitHead":"089d18ae950fb66509ca4a31ccf13a0c4542b85a","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","_id":"babel-plugin-transform-for-of-as-array@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"dist":{"integrity":"sha512-T3II+875KgS+UsqGxhPuNYlRzjHT7YikwSdyJrOWzx1/r/u6jwjD/fHBrWXNm0dbdbo2uGkzJtTulgRpz0Gnjg==","shasum":"e0adf37260f6ad77d9ed02401a4fdf347f524255","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-for-of-as-array/download/babel-plugin-transform-for-of-as-array-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA90c0uZ9fH52S9HPK1qE6QmzGTx1auCl0I1Dxz36yxSAiEA2eTfekgeVOq/uBEMrARdpR0iXmSeT5ZeKaIh+NVzLoo="}],"size":4940,"noattachment":false,"key":"/babel-plugin-transform-for-of-as-array/-/babel-plugin-transform-for-of-as-array-1.1.0.tgz"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-transform-for-of-as-array-1.1.0.tgz_1517468112245_0.3537284075282514"},"directories":{},"publish_time":1517468113150,"_cnpm_publish_time":1517468113150},"1.0.4":{"name":"babel-plugin-transform-for-of-as-array","version":"1.0.4","description":"Transform all for-of loops into the equivalent array for loop","repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"main":"lib/index.js","license":"MIT","devDependencies":{"babel-cli":"^7.0.0-beta.2","babel-plugin-transform-es2015-modules-amd":"^7.0.0-beta.2","babel-plugin-transform-es2015-modules-commonjs":"^7.0.0-beta.2","babel-preset-env":"^2.0.0-beta.2","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"mocha --compilers js:babel-register","test:watch":"npm run test -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["for","of","loop","array","babel-plugin"],"gitHead":"bbaae4a2767655bce7b3e91bd75b2d7904bb97b9","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","_id":"babel-plugin-transform-for-of-as-array@1.0.4","_npmVersion":"5.3.0","_nodeVersion":"8.0.0","_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"dist":{"integrity":"sha512-Uvej8S/SmRZNn/d8arh7LECAWo+S0GMvNgd1wxJxLeujT7BmViOyhNFp93a+gHY1/90IYXgdgzV/J1djJpiIWg==","shasum":"05f04e8c2bf22f767f9c552e561d634fb18f35eb","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-for-of-as-array/download/babel-plugin-transform-for-of-as-array-1.0.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFypahZDX3Z9JzjUpUJzv/Szc0UE4aZLBYIT+kgKqgDRAiB7MVf6v/tU+vuCckGE5AX6y1Tcw6jV4Z15td/AzM3T1Q=="}],"size":3831,"noattachment":false,"key":"/babel-plugin-transform-for-of-as-array/-/babel-plugin-transform-for-of-as-array-1.0.4.tgz"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-transform-for-of-as-array-1.0.4.tgz_1508111140304_0.0778831378556788"},"directories":{},"publish_time":1508111141244,"_cnpm_publish_time":1508111141244},"1.0.3":{"name":"babel-plugin-transform-for-of-as-array","version":"1.0.3","description":"Transform all for-of loops into the equivalent array for loop","repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"main":"lib/index.js","license":"MIT","devDependencies":{"babel-cli":"^6.4.5","babel-preset-es2015":"^6.3.13","babel-preset-stage-0":"^6.3.13","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"mocha --compilers js:babel-register","test:watch":"npm run test -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["for","of","loop","array","babel-plugin"],"gitHead":"fd2b1482d433d46d45e5b25fed5aa4ea14fd45e7","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","_id":"babel-plugin-transform-for-of-as-array@1.0.3","_shasum":"7e44df28f5ef771c794bbdb51d5f8f47d392d449","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.0.0","_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"dist":{"shasum":"7e44df28f5ef771c794bbdb51d5f8f47d392d449","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-for-of-as-array/download/babel-plugin-transform-for-of-as-array-1.0.3.tgz","integrity":"sha512-WKj6FkV0X1z/i8GTNSafTErC2Ao0LUtte/kAjcyQ7rqyaE4cy3mRFvi6Rus9jIWysRYuBFe8tXmhHLA6OU/JcQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnn0og/3MoZYwoUWq7X9OFOhr7oDldukPygEm5ZdOvXAiEA3mudJfPra7HMpR3H2+qNMAxwKn6FUS0tg2s2UkDdbHw="}],"size":3490,"noattachment":false,"key":"/babel-plugin-transform-for-of-as-array/-/babel-plugin-transform-for-of-as-array-1.0.3.tgz"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-for-of-as-array-1.0.3.tgz_1493572142777_0.153978259768337"},"directories":{},"publish_time":1493572143417,"_cnpm_publish_time":1493572143417},"1.0.2":{"name":"babel-plugin-transform-for-of-as-array","version":"1.0.2","description":"Transform all for-of loops into the equivalent array for loop","repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"main":"lib/index.js","license":"MIT","devDependencies":{"babel-cli":"^6.4.5","babel-preset-es2015":"^6.3.13","babel-preset-stage-0":"^6.3.13","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"mocha --compilers js:babel-register","test:watch":"npm run test -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["for","of","loop","array","babel-plugin"],"gitHead":"f46ccab08d11ca824ee70685e772124331fda381","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","_id":"babel-plugin-transform-for-of-as-array@1.0.2","_shasum":"0e85266385cc5fa22cb806c640a34e1b804c8616","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.0.0","_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"dist":{"shasum":"0e85266385cc5fa22cb806c640a34e1b804c8616","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-for-of-as-array/download/babel-plugin-transform-for-of-as-array-1.0.2.tgz","integrity":"sha512-gBFMBCh/uDNul1vlFDfkRbBTY6+Z5p57F121Mf7XJWMy1lEtC8HmEJkYA+0TpE/4dqHKY+oe59EqIoRYhiOyrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfUkFVhyIfY8dZ1vetstXQhkunhIF4BWmtVqdRQEz9LAiBgtuMm+PPhFateK1yjLPRWHtAUr5iheCOrxODXG/lKnQ=="}],"size":3267,"noattachment":false,"key":"/babel-plugin-transform-for-of-as-array/-/babel-plugin-transform-for-of-as-array-1.0.2.tgz"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-for-of-as-array-1.0.2.tgz_1493525698402_0.24186188937164843"},"directories":{},"publish_time":1493525699206,"_cnpm_publish_time":1493525699206},"1.0.1":{"name":"babel-plugin-transform-for-of-as-array","version":"1.0.1","description":"Transform all for-of loops into the equivalent array for loop","repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"main":"lib/index.js","license":"MIT","devDependencies":{"babel-cli":"^6.4.5","babel-preset-es2015":"^6.3.13","babel-preset-stage-0":"^6.3.13","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"mocha --compilers js:babel-register","test:watch":"npm run test -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["for","of","loop","array","babel-plugin"],"gitHead":"f42308c1bde0a522b7df07542bcecc6fb6af48d9","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","_id":"babel-plugin-transform-for-of-as-array@1.0.1","_shasum":"783fb40e3d624c74dab67eafb8f73d1c39b4b823","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.0.0","_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"dist":{"shasum":"783fb40e3d624c74dab67eafb8f73d1c39b4b823","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-for-of-as-array/download/babel-plugin-transform-for-of-as-array-1.0.1.tgz","integrity":"sha512-4W/gTYzGa9++Q8+VdtApuAgDZTC9d3+t3L/DMg5tti/OTjZTmMKdA4ktrUKrjjMJZzXSCGfi2urNkZs5avRQpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMKzctUrjryk0ZRuUbGd5+kwSmT30P9zGPR7YdxyVg1wIhAMMFHbJsdwyemQlKdCl75iFgUi8EqI8Q7D1qLtu67fx+"}],"size":3213,"noattachment":false,"key":"/babel-plugin-transform-for-of-as-array/-/babel-plugin-transform-for-of-as-array-1.0.1.tgz"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-for-of-as-array-1.0.1.tgz_1493517455137_0.6895475848577917"},"directories":{},"publish_time":1493517457002,"_cnpm_publish_time":1493517457002},"1.0.0":{"name":"babel-plugin-transform-for-of-as-array","version":"1.0.0","description":"Transform all for-of loops into the equivalent array for loop","repository":{"type":"git","url":"git+https://github.com/jridgewell/babel-plugin-transform-for-of-as-array.git"},"author":{"name":"Justin Ridgewell","email":"justin+github@ridgewell.name"},"main":"lib/index.js","license":"MIT","devDependencies":{"babel-cli":"^6.4.5","babel-preset-es2015":"^6.3.13","babel-preset-stage-0":"^6.3.13","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"mocha --compilers js:babel-register","test:watch":"npm run test -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["for","of","loop","array","babel-plugin"],"gitHead":"302b32e53dcc13e3b0ac3256546c62d4579c238c","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","_id":"babel-plugin-transform-for-of-as-array@1.0.0","_shasum":"e16949efc91732327e08393eb717d8b5ca534122","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.0.0","_npmUser":{"name":"jridgewell","email":"justin+npm@ridgewell.name"},"dist":{"shasum":"e16949efc91732327e08393eb717d8b5ca534122","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-for-of-as-array/download/babel-plugin-transform-for-of-as-array-1.0.0.tgz","integrity":"sha512-U+ZXDMyLAw2BZ+g4hlJKEx6C5t7gkZm5KtPrHrLQXZwuJWjqEVVdPS9tz4ksqIhyhRQt+wnlECg+uC/9q4xcyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhWJuxSWuQ+fk7ATNmLQyvinviDxjWi1KIat47ZZu0CwIgKcSr52BPeY5efb8F/ci63f4zjyS6caHyj+4QMBQoh1E="}],"size":2964,"noattachment":false,"key":"/babel-plugin-transform-for-of-as-array/-/babel-plugin-transform-for-of-as-array-1.0.0.tgz"},"maintainers":[{"name":"jridgewell","email":"justin+npm@ridgewell.name"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-for-of-as-array-1.0.0.tgz_1493504518662_0.7285273936577141"},"directories":{},"publish_time":1493504520447,"_cnpm_publish_time":1493504520447}},"readme":"# babel-plugin-transform-for-of-as-array\n\nTransform all for-of loops into the equivalent array for loop\n\n## Example\n\n**In**\n\n```js\nconst array = [1, 2, 3];\nfor (const elm of array) {\n  console.log(elm);\n}\n\nlet item;\nfor ({ item } of array.map(item => ({ item }))) {\n  console.log(item);\n}\n```\n\n**Out**\n\n```js\nconst array = [1, 2, 3];\n\nfor (let _i = 0, _length = array.length; _i < _length; _i++) {\n  const elm = array[_i];\n  console.log(elm);\n}\n\nlet item;\nfor (let _i2 = 0, _array$map = array.map(item => ({ item })), _length2 = _array$map.length; _i2 < _length2; _i2++) {\n  ({ item } = _array$map[_i2]);\n\n  console.log(item);\n}\n```\n\n\n## `loose` transformation\n\nIn addition to the normal transform, we also support a null-ish checking `loose` transform. Passing `{ loose: true }` option into the plugin enables it:\n\n**In**\n\n```js\nconst array = null;\nfor (const elm of array) {\n  console.log(elm);\n}\n\nlet item;\nfor ({ item } of array.map(item => ({ item }))) {\n  console.log(item);\n}\n```\n\n**Out**\n\n```js\nconst array = null;\n\nfor (let _i = 0, _length = array == null ? 0 : array.length; _i < _length; _i++) {\n  const elm = array[_i];\n  console.log(elm);\n}\n\nlet item;\nfor (let _i2 = 0, _array$map = array.map(item => ({ item })), _length2 = _array$map == null ? 0 : _array$map.length; _i2 < _length2; _i2++) {\n  ({ item } = _array$map[_i2]);\n\n  console.log(item);\n}\n```\n\n\n## Installation\n\n```sh\n$ npm install babel-plugin-transform-for-of-as-array\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\"transform-for-of-as-array\"]\n}\n```\n\n### Via CLI\n\n```sh\n$ babel --plugins transform-for-of-as-array script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n  plugins: [\"transform-for-of-as-array\"]\n});\n```\n","_attachments":{},"homepage":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array#readme","bugs":{"url":"https://github.com/jridgewell/babel-plugin-transform-for-of-as-array/issues"},"license":"MIT"}