103 lines
5.4 KiB
JSON
103 lines
5.4 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "babel-plugin-transform-es2015-for-of@^6.5.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "babel-plugin-transform-es2015-for-of",
|
||
|
"name": "babel-plugin-transform-es2015-for-of",
|
||
|
"rawSpec": "^6.5.0",
|
||
|
"spec": ">=6.5.0 <7.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-preset-react-native"
|
||
|
]
|
||
|
],
|
||
|
"_from": "babel-plugin-transform-es2015-for-of@>=6.5.0 <7.0.0",
|
||
|
"_id": "babel-plugin-transform-es2015-for-of@6.23.0",
|
||
|
"_inCache": true,
|
||
|
"_location": "/babel-plugin-transform-es2015-for-of",
|
||
|
"_nodeVersion": "6.9.1",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "packages-12-west.internal.npmjs.com",
|
||
|
"tmp": "tmp/babel-plugin-transform-es2015-for-of-6.23.0.tgz_1487027061167_0.7569211190566421"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "loganfsmyth",
|
||
|
"email": "loganfsmyth@gmail.com"
|
||
|
},
|
||
|
"_npmVersion": "3.10.8",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "babel-plugin-transform-es2015-for-of@^6.5.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "babel-plugin-transform-es2015-for-of",
|
||
|
"name": "babel-plugin-transform-es2015-for-of",
|
||
|
"rawSpec": "^6.5.0",
|
||
|
"spec": ">=6.5.0 <7.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/babel-preset-fbjs",
|
||
|
"/babel-preset-react-native"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz",
|
||
|
"_shasum": "f47c95b2b613df1d3ecc2fdb7573623c75248691",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "babel-plugin-transform-es2015-for-of@^6.5.0",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-preset-react-native",
|
||
|
"dependencies": {
|
||
|
"babel-runtime": "^6.22.0"
|
||
|
},
|
||
|
"description": "Compile ES2015 for...of to ES5",
|
||
|
"devDependencies": {
|
||
|
"babel-helper-plugin-test-runner": "^6.22.0"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"shasum": "f47c95b2b613df1d3ecc2fdb7573623c75248691",
|
||
|
"tarball": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz"
|
||
|
},
|
||
|
"keywords": [
|
||
|
"babel-plugin"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"main": "lib/index.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "amasad",
|
||
|
"email": "amjad.masad@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "hzoo",
|
||
|
"email": "hi@henryzoo.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "jmm",
|
||
|
"email": "npm-public@jessemccarthy.net"
|
||
|
},
|
||
|
{
|
||
|
"name": "loganfsmyth",
|
||
|
"email": "loganfsmyth@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "sebmck",
|
||
|
"email": "sebmck@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "thejameskyle",
|
||
|
"email": "me@thejameskyle.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "babel-plugin-transform-es2015-for-of",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# babel-plugin-transform-es2015-for-of\n\n> Compile ES2015 for...of to ES5\n\n## Example\n\n**In**\n\n```js\nfor (var i of foo) {}\n```\n\n**Out**\n\n```js\nvar _iteratorNormalCompletion = true;\nvar _didIteratorError = false;\nvar _iteratorError = undefined;\n\ntry {\n for (var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var i = _step.value;\n }\n} catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n} finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n}\n```\n\n## Installation\n\n```sh\nnpm install --save-dev babel-plugin-transform-es2015-for-of\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```js\n// without options\n{\n \"plugins\": [\"transform-es2015-for-of\"]\n}\n\n// with options\n{\n \"plugins\": [\n [\"transform-es2015-for-of\", {\n \"loose\": true\n }]\n ]\n}\n```\n\n### Via CLI\n\n```sh\nbabel --plugins transform-es2015-for-of script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n plugins: [\"transform-es2015-for-of\"]\n});\n```\n\n## Options\n\n### `loose`\n\n`boolean`, defaults to `false`\n\nIn loose mode, arrays are put in a fast path, thus heavily increasing performance.\nAll other iterables will continue to work fine.\n\n#### Example\n\n**In**\n\n```js\nfor (var i of foo) {}\n```\n\n**Out**\n\n```js\nfor (var _iterator = foo, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var i = _ref;\n}\n```\n\n#### Abrupt completions\n\nIn loose mode an iterator's `return` method will not be called on abrupt completions caused by thrown errors.\n\nPlease see [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and\n[babel/babel#838](https://github.com/babel/babel/issues/838) for more information.\n\n### Optimization\n\nIf a basic array is used, Babel will compile the for-of loop down to a regular for loop.\n\n**In**\n\n```js\nfor (let a of [1,2,3]) {}\n```\n\n**Out**\n\n```js\nvar _arr = [1, 2, 3];\nfor (var _i = 0; _i < _arr.length; _i++) {\n var a = _arr[_i];\n}\n```\n",
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-for-of"
|
||
|
},
|
||
|
"scripts": {},
|
||
|
"version": "6.23.0"
|
||
|
}
|