{"name":"@putout/plugin-apply-maybe","version":"1.2.0","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin applies Maybe monad","homepage":"https://github.com/coderaiser/apply-maybe/tree/master/packages/plugin-apply-maybe#readme","main":"lib/index.js","commitType":"colon","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/apply-maybe.git"},"scripts":{"wisdom":"madrun wisdom","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","apply-maybe-plugin","plugin","apply-maybe"],"devDependencies":{"@putout/test":"^5.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0","lerna":"^6.0.1","madrun":"^9.0.0","montag":"^1.2.1","nodemon":"^2.0.1"},"peerDependencies":{"putout":">=28"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"4ef9391ab01e6131143c1dbbf6a7e7248925038c","bugs":{"url":"https://github.com/coderaiser/apply-maybe/issues"},"_id":"@putout/plugin-apply-maybe@1.2.0","_nodeVersion":"18.14.2","_npmVersion":"9.1.3","dist":{"integrity":"sha512-+P8KBUjs1hBNvkyZ7zlY19txNluuHdcyi2V7hlVn8/yaBtiwsvt8UJWyUOCaL5NX4ViZpyO1Dmaep5rkyZ2r4w==","shasum":"ddc110fa517cec7028b7e09a439ee114d322edc2","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-maybe/download/@putout/plugin-apply-maybe-1.2.0.tgz","fileCount":8,"unpackedSize":5352,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDsklP5xhr3CSs2PF9IYjiYBCQyaxGCh5g9uMUIdX3cgIgY5WTzB1zh66Z4RTuIf3pymxHSFzkhAmDmCXQG1+JY1E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBRBrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSVxAAhiAwj3KWfthb6WLSbNKGElgr6oliKD8s1iQsnArMuUf7VGFz\r\nmzlcBtKUP4v2O0cLbmY8YziNkqdLEKaaeqCvTeF1Oj3ky84hbuCIoi9lcUW4\r\nTyMAo/1gHtITfrgQ3ctfBIRTql2H8nChsl4uc7HOQPGkKuIc9auVgtGcJoAc\r\nYDV+gbR8MX0Uv8ZZCgkJD7ZacHf7snlGA+X7l7vPsp7zxFWXRTmRHyQT7z0W\r\n6GX/A42wXBEBu3Bkubo5TuYamSHwE0a0+QwS5y0SzjNL4NMS37MybtV1fW5V\r\noB7DPiumU0qGSM3kzWoNfkcliuiLXuN/XcQ/KC8P0wYkHpt5RMgNB6Y+sPGo\r\nkjA2GtoddeZ70BSTxy7RkxrIVB7bptjIJ8CQpj+WNhawU29pbd1S2X+9Xsxm\r\nyabGnM/wbOYQQXnKTj1crY8KBsdHAOfpVn1l7IM22bXgrh10NdyYFstJT+bR\r\nrAOkDcCfKOjEQMOoK7qBI6OUmaqmK37cFSyQSlcvLxTqm2Zc/bSuBBEfhxoM\r\nDO6/ygrw5Y+yA4OOt385s9OH8ODI7D4YMnCga9Lghq0UZbxeMUQMRvKrim+3\r\nKMxSeeQKFc0HM8FKHOQHE0JhSTJNAkI8URMwHMRGg/Gy4wDTlOKHX+QXafaT\r\nkC8Xvt6vHTGFHy98OTETpqMb/9ZUynqV3xI=\r\n=vfDW\r\n-----END PGP SIGNATURE-----\r\n","size":2297,"noattachment":false,"key":"/@putout/plugin-apply-maybe/-/@putout/plugin-apply-maybe-1.2.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-apply-maybe_1.2.0_1678053483140_0.27372073200575064"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-apply-maybe [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-maybe.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-maybe\"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps with `maybe` monad. Depends on [`@putout/declare`](https://github.com/coderaiser/putout/tree/master/packages/plugin-declare#readme). Renamed to [`@putout/plugin-maybe`](https://www.npmjs.com/package/@putout/maybe).\n\n## Install\n\n```\nnpm i @putout/plugin-apply-maybe -D\n```\n\n## Rules\n\n```json\n{\n    \"rules\": {\n        \"apply-maybe/array\": \"on\",\n        \"apply-maybe/empty-array\": \"on\",\n        \"apply-maybe/fn\": \"on\"\n    }\n}\n```\n\n## array\n\n### ❌ Example of incorrect code\n\n```js\nconst array = isArray(a) ? a : [a];\n```\n\n### ✅ Example of correct code\n\n```js\nconst maybeArray = (a) => isArray(a) ? a : [a];\nconst array = maybeArray(a);\n```\n\n## empty-array\n\n### ❌ Example of incorrect code\n\n```js\nconst array = !a ? [] : a;\n```\n\n### ✅ Example of correct code\n\n```js\nconst maybeArray = (a) => !a ? [] : a;\nconst array = maybeEmptyArray(a);\n```\n\n## fn\n\n### ❌ Example of incorrect code\n\n```js\nconst fn = isFn(a) ? a : () => {};\n```\n\n### ✅ Example of correct code\n\n```js\nconst noop = () => {};\nconst maybeFn = isFn(a) ? a : noop;\nconst fn = maybeFn(a);\n```\n\n## noop\n\n### ❌ Example of incorrect code\n\n```js\nconst fn = f || (() => {});\n```\n\n### ✅ Example of correct code\n\n```js\nconst noop = () => {};\nconst fn = fn || noop;\n```\n\n## License\n\nMIT\n","publish_time":1678053483316,"_cnpm_publish_time":1678053483316,"dist-tags":{"latest":"1.2.1"}}