{"name":"@putout/plugin-apply-maybe","version":"1.0.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":"ef563eb91c46fb3697f72aa61490d9ad6738aac7","bugs":{"url":"https://github.com/coderaiser/apply-maybe/issues"},"_id":"@putout/plugin-apply-maybe@1.0.0","_nodeVersion":"18.13.0","_npmVersion":"9.1.3","dist":{"integrity":"sha512-WSFgA0uIGHAYe2GG5N5+iDdKpFTnWIBwjKabKj8Rr+Sn0PrGM5yhv67adAOVj0vsmyCYYNMMkHTUH/JpFD/6Pw==","shasum":"ece4681b72a897ee36cb3d1d9cefc5925c4fa919","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-maybe/download/@putout/plugin-apply-maybe-1.0.0.tgz","fileCount":7,"unpackedSize":4553,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH9y6e9PfrVvqPtbB/Ep0t77ffl4pUQFVdfDpvz7GVWUAiBa5OfrOCeBxupVyZYozFbEkkD0FQ/J7R9g+va0L7zo9Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3reaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTJhAAgG/YGof+yVqWJvKNjfEDs3SJePFxb+f2xeqCPcufnZp/gktX\r\n+eAm79ymdiWdoCGTLQwedCCTPwpIgBj+cMXvnLGdWXwwzJdASU+SEeVOkAbI\r\nTMH9wD3DtV9612PaaqcCHRt/v3/PIIGF85U3BquVzFAx36/0rT6tHjuJ5zDA\r\nfZe6HAodkNfuagurMp6I0Rj03pQTCnpHWgFkSfvG1WJu66kBn3+Buc5UPY5D\r\nj8Nc9mJAm/1H3SyG0zYpgQRQK6JB7hWLp8vmflW+F8Y8/z8AnELBohTx6+eH\r\nKO8gHmGoPsfWHmA0WEuEKTi3PYE5JKztUu6SAcNfJYtuGegPtkKfXan2rKV1\r\nvjFClELpOHtfUcpLdlEVjQwJNo0HgeZ5TlVhbdAXhmbxelB9d8m29MDLj286\r\nnq4HhktoUEOnjgt1ZuYhzd++mRg3yYEJzqgNalybQhyQqA93r/V+QL6MwEJI\r\nN+hkanUj3ezlS6SxF3nQATJtPWoyAqzmvE/Yik2VYXpC9bPlkIFmGUGjeERw\r\nS3EYT+ZLIunhpD4A8kHDd23A9NinC08TAiqX8SINgRY25itBHmpdof5LTPoC\r\nZCCmfEp/xNwGrZbmEVtGzwlghKSWHjWS7FXBFC8FZekk7tnkwDSOvEWcI6Xk\r\nnziIUO/9E8cNgwJURP1vzWLBUpjkqSetQQI=\r\n=FAx5\r\n-----END PGP SIGNATURE-----\r\n","size":2082,"noattachment":false,"key":"/@putout/plugin-apply-maybe/-/@putout/plugin-apply-maybe-1.0.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.0.0_1675540377970_0.6305117103193258"},"_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":1675540378156,"_cnpm_publish_time":1675540378156,"dist-tags":{"latest":"1.2.1"}}