{"_id":"@putout/plugin-apply-early-return","_rev":"5-ee0fe0faa43ecb87142a40ea8c0b6f7a","name":"@putout/plugin-apply-early-return","dist-tags":{"latest":"3.0.1"},"versions":{"1.0.0":{"name":"@putout/plugin-apply-early-return","version":"1.0.0","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","early-return"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-early-return@1.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"http://github.com/coderaiser/putout","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"60e78388b8c7ec2cbbf3879cb0bce28566f2c9e6","tarball":"https://registry.npmjs.org/@putout/plugin-apply-early-return/-/plugin-apply-early-return-1.0.0.tgz","fileCount":4,"integrity":"sha512-TGncGJo/xxdzMybR9uNjdRR5DCQ/1pBnDcoJEyPRZoPcAcpeZmucDCWBb7bSmTBGT4ZWZtVMjDlPtydWgssyEg==","signatures":[{"sig":"MEUCIQCWR4J2YRhetu517O/QqfzhzCwtp7CuPgvUTu7BharUPgIgKoXvQfFenHF5u3au+pw9Ql6qfkOyTOeh0bzuDM/K5hs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+IR0CRA9TVsSAnZWagAAxR8P/jHzHoPeMn7TIWvHnTbc\nLeAwrrJPFH5XOnJZhyslLMWR5QCXxAGUogYyQ0retPpgatgR1F34ypwZUq7S\nYdu1Doj9MCQWYOb2T9yFtCBuAhPwEyE+8QSKh/qehZSWhfQhheaLrCm/Xl3C\n9mhu/W8AfxOpSBj/i2Cr69kM8/tPY+HZj26vzF0mZIcK491SNQ5FdgHrBvMq\nPymji6ZhsenCWOGZYQga0drybrbJ9yCLeRJvjynXBbYT/nrWF4w8pY6h48Ui\nx5GWZTgigeWb6r/Fl4aV1LRYbfye0bfMLkB3a1NrtP7UQAriONGKri3O7ShC\ndpukmt2vOZYFBplwU2f3UuhjqUOfu2RoTOU1E+vIjcoqG9MWAVO4T95ha1Pe\nd0eBh3cLx0yYNsc2c/jpfc6O4EEwoJEPbPRkwaOCDPu+1xHFgH9f2sZ4A9mW\nfMfHCvACXxOJS+1NDyHDQTMl9Y8Xute95UUmy7wyHCzLlgOPXLwGmy6fPak5\n5BmtrCB4UGOUC+gYQ0ZvbKXxRjWEoYeXHsoE94139HJkwqRtcnNkPbqozkuE\nbtErkaalmiC69vxROsonPbgsRDAYpesuv88dbk7eUNOKxX30FfM+Ud0A6hRN\n8CteKZgw27K4lr1xPgJGWx3KT7oVoH/Gab81Q4bZq6LQ4pTJzstcgyezmkh8\nXVv/\r\n=7PYD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/apply-early-return.js","engines":{"node":">14"},"release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"7.19.1","description":"putout plugin adds ability use apply early return","directories":{},"_nodeVersion":"16.5.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.5.0","lerna":"^4.0.0","eslint":"^7.0.0","madrun":"^8.0.1","nodemon":"^2.0.1","@putout/test":"^3.0.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^8.0.0"},"peerDependencies":{"putout":">=18"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-early-return_1.0.0_1626899572743_0.9883538300441455","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@putout/plugin-apply-early-return","version":"1.0.1","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","early-return"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-early-return@1.0.1","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"http://github.com/coderaiser/putout","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"a90f8fa571062102ef72a7c9017f47a4065bdae7","tarball":"https://registry.npmjs.org/@putout/plugin-apply-early-return/-/plugin-apply-early-return-1.0.1.tgz","fileCount":4,"integrity":"sha512-AwTG337dD1ngHT6dQaDKbuzfgCAdGjLeXPHLGcTeKtWNuJaE3epEZ+Aupk1wpekbOOY6PZ76JnJoXzN3A/sMgg==","signatures":[{"sig":"MEUCIQCmxm22T7kzJdcROlFyjxOj4BMwA8qzplaG3Cp41a37wwIgFxAJcRaIVwc1ovfaziyRBCXEzNo6HYUaICi/yB/28bw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+cBdCRA9TVsSAnZWagAAt3wP/1wKJ+L7syf39yENy0nr\nfyqLT2Lo03NRTN8Xs6LKPU+FQR/VMjc6fCsJSwWCbDT5lFwqgFckaagZQDjJ\num62QElqAkIrXiDQNiRibJ8MoG2A1VFOClhGol7mcfLrpzNIs+25fBbA03c0\n7d7vcJRVCnJa3XvsfgC17OZfYtKiBJQ6ejFqRYdliyV31ypsQ3vADV/wPG1N\n4PYydq3XIkmM7CTk0y+VpCOCrxxOSLy1mH7lXmZQZLCRDp0o0IYdVtY0RD9K\nlfIvHVXG+LafGxMASUNF3W2SAYollgRud9H/XMzmqHe4yBOtZESzj68FNvHK\nSDx3diwa8ToJHyff+8s82MSo7D6HWbqCKLk0LAhqkndjZs78PJgdHPt0iGn8\nBD5Zmawoyag0swughUfzwwnNFYn1RIpzIaRtnqbp4xPSipQGWtP0zSL1suBc\nYLytl38EF0RHqxGExdVntwNSpJ90jKwwO18Vr+JQeNxLsWdeY7MhdeGvLcej\n9hLC3yqwCrF+ql8iBUC9L3vYNXivl0s2tQn3IAbnMR7FQmKP7TxQRo4o8FO6\nriNzDLsDINBEkMniXqfnKrlbWOqVlGadNyRr1AlE/nBEq9j1rM9dIBtLMk3H\nqs8qSDB38TbI539EMpRbbCCeNqO1ZkD9BlKGcK5CT5Kc0+taSIMh3ap7jKwc\nEZ7R\r\n=CB4J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/apply-early-return.js","engines":{"node":">=14"},"release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"7.19.1","description":"putout plugin adds ability use apply early return","directories":{},"_nodeVersion":"16.5.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.5.0","lerna":"^4.0.0","eslint":"^7.0.0","madrun":"^8.0.1","nodemon":"^2.0.1","@putout/test":"^3.0.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^8.0.0"},"peerDependencies":{"putout":">=18"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-early-return_1.0.1_1626980445853_0.4951787682111213","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@putout/plugin-apply-early-return","version":"2.0.0","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","early-return"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-early-return@2.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-early-return#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"b455653ce8fce3bd213fe6f579d069c2c54f4b85","tarball":"https://registry.npmjs.org/@putout/plugin-apply-early-return/-/plugin-apply-early-return-2.0.0.tgz","fileCount":4,"integrity":"sha512-pvmBlipG83c2CIsIZSaIVcelX4jztD6/zxvggvP7klAfRKXYJ6WT/BGBzkndeNNl4LXPi7hHTlj3Hkx8Z2bCag==","signatures":[{"sig":"MEUCIQDg8LSUz8IGQmEcJ+Y0hDOnnLagn1JcWsX8WDB+xrORagIgfU1ju5Dn25TRjwBjLMXNi6cM9fGqlu3BhcdeKsd3TRw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL04/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMMw//dT8lzixIp3HP3/AHTY2ktKWqOYeGxED7ixyed+HELKEq9/yh\r\nXuB86Uwm8BAcCZ7q1km2ftmzcUcGCGvsldXN83D0MTv5tI3OUVIGD1OsX/xj\r\ngwyFR0Sgvxj5zJC6/+6YTaxQIVENv5VRQ+SsJWsbjSegKUeFniSPhDJ6QKFv\r\ndZ8B2zJVH5N5Ypwzib/UTIHD+tKkuvqhgbixQo9ToRu6XG8Nu3XZrJDD9e8R\r\nUrhE3Om5YMNTuBdUIjSeAjMa8IimDEpItnV40bWqDzlqppISSjUdKCn08BBK\r\nx+gvijbkveBZEdxmrLTn4cTK0cJkb4NQeE2FBB1z3nxPsXhzZHHbhMWCYtHI\r\nU9HKpdTmgERxBUfHrP7j4haWXq5qmVB6Hhz2/ik9hl6BqwcTQ+H+gNDYi9zs\r\ni7ZhMLPsc5v671ZZE/GGwvn9+Avi3csfFrtZEzQC3JHe+BZx/ra9etnxvE9U\r\n8h4gocaYqM8KfNu7wz5VH8FXDXxvClUSnixoa6bier7uq+HDJO7tRQpc89Xj\r\ndpt/dUZG4L0q4GXULFBpjK5QR8Lf4HGMWyWHVphqnVI6Ixb6yWYOl76i9Gqd\r\nZAnpDHYM+Mt8q01Bu81+QsDQVJ93Q10e3NV72a1thRGQDaeFttQ3om62CpX/\r\nAEiIrbm4pVm4waHSaTGd0hcHASpCENZRWXg=\r\n=SQeO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/apply-early-return.js","type":"commonjs","engines":{"node":">=16"},"gitHead":"f33d102009f204b50b3b71983e68649318e6a44c","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"8.3.0","description":"putout plugin adds ability use apply early return","directories":{},"_nodeVersion":"16.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.5.0","lerna":"^4.0.0","eslint":"^8.0.1","madrun":"^9.0.0","nodemon":"^2.0.1","@putout/test":"^5.0.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^14.0.0"},"peerDependencies":{"putout":">=25"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-early-return_2.0.0_1647267391486_0.3357728873146595","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@putout/plugin-apply-early-return","version":"3.0.0","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","early-return"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-early-return@3.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-early-return#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"dc71de22becad7bec2872670899c970594235c5f","tarball":"https://registry.npmjs.org/@putout/plugin-apply-early-return/-/plugin-apply-early-return-3.0.0.tgz","fileCount":4,"integrity":"sha512-LAixktLtQaEc7r2fwYuKpnsQ93GYK8/nsKa6AEMeuzxlTRc278D/eEs8P8m6ef5fSyjhQy+S1fYI0nfG+Kr/MA==","signatures":[{"sig":"MEQCIEAXlXkZd1Zxi0j/U4TYgMg6/HSIq2X+HGmns+UN2+HLAiByZfzPPUP4rqP3Y+e4yLy51v0AoUUibc1RnbzrNXFpCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4289},"main":"lib/apply-early-return.js","type":"commonjs","engines":{"node":">=16"},"gitHead":"ed849fe142aa695bc237276faf102405bf8a49e9","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"9.6.6","description":"🐊Putout plugin adds ability use apply early return","directories":{},"_nodeVersion":"18.16.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.5.0","lerna":"^6.0.1","eslint":"^8.0.1","madrun":"^9.0.0","nodemon":"^2.0.1","@putout/test":"^6.0.0","eslint-plugin-n":"^16.0.0","eslint-plugin-putout":"^17.0.0"},"peerDependencies":{"putout":">=29"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-early-return_3.0.0_1686224630865_0.432324544504467","host":"s3://npm-registry-packages"}},"3.0.1":{"name":"@putout/plugin-apply-early-return","version":"3.0.1","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability use apply early return","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-early-return#readme","main":"lib/apply-early-return.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{},"keywords":["putout","putout-plugin","putout-plugin-apply","plugin","early-return"],"devDependencies":{"@putout/test":"^11.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^23.0.0","lerna":"^6.0.1","madrun":"^10.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=29"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-apply-early-return@3.0.1","gitHead":"0a04e7bdba57b1cda825c9e230312b33964f7fc7","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.13.1","_npmVersion":"10.9.0","dist":{"integrity":"sha512-p+0J3qdUEctqHGMJu1bORuEx6YUwPwNMfs5Wky/KIx7t7EEjPMU+iddFdh0Wc7Vii6nJ8jONnQgpVvFnlKcP/g==","shasum":"d11f2c6b9e60779ffb1558245849185cc45ea5a3","tarball":"https://registry.npmjs.org/@putout/plugin-apply-early-return/-/plugin-apply-early-return-3.0.1.tgz","fileCount":4,"unpackedSize":4360,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCbI56XICvBN1z8PqgT4Q6+zGQUcOeJHojvOh8iDfFfXgIgXRzkDPpi3knNcGhbgIIF4cEWWY/sM9Iw1bIe6S5NZa0="}]},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-apply-early-return_3.0.1_1738163400795_0.31405087061667114"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-21T20:32:52.683Z","modified":"2025-01-29T15:10:01.213Z","1.0.0":"2021-07-21T20:32:52.868Z","1.0.1":"2021-07-22T19:00:45.973Z","2.0.0":"2022-03-14T14:16:31.692Z","3.0.0":"2023-06-08T11:43:51.054Z","3.0.1":"2025-01-29T15:10:00.989Z"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"license":"MIT","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-early-return#readme","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","early-return"],"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"description":"🐊Putout plugin adds ability use apply early return","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"readme":"# @putout/plugin-apply-early-return [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-early-return.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-early-return\"npm\"\n\n> In short, an **early return** provides functionality so the result of a conditional statement can be returned as soon as a result is available, rather than wait until the rest of the function is run. Merged with [`@putout/plugin-return`](https://www.npmjs.com/package/@putout/plugin-return).\n>\n> (c) [dev.to](https://dev.to/jenniferlynparsons/early-returns-in-javascript-5hfb)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply **early return**.\n\n## Install\n\n```\nnpm i @putout/plugin-apply-early-return\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"apply-early-return\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nfunction get(a) {\n    let b = 0;\n    \n    if (a > 0)\n        b = 5;\n    else\n        b = 7;\n    \n    return b;\n}\n```\n\n## ✅ Example of correct code\n\n```js\nfunction get(a) {\n    if (a > 0)\n        return 5;\n    \n    return 7;\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}